Example 3: Sets (abstract data types)

Assignment Sets
Course CS2114
Level Mid-semester
Language Java, Web-CAT
More Info...
  • Test Driven Development slides
  • Lab 6 description
  • Starting code (zip file)
Brief Description
This assignment is a more traditional abstract data type assignment. It uses a Set interface and an ArraySet implementation in a lab assignment. Students have to complete the implementation and the testing for it.

Back to Menu

Teaching Test Driven Development

  • Emphasize importance of testing in computing
  • Unit testing, test each part individually (reduces complexity)
  • Test-driven development - test becomes "requirements"
  • For us, BlueJ has excellent support for testing... lets play a little with testing

JUnit (4.0)

  • JUnit home http://junit.org/
  • JUnit Cookbook - http://junit.sourceforge.net/
  • JUnit Cookbook, good JUnit intro (short) http://junit.sourceforge.net/doc/cookbook/cookbook.htm
  • JUnit Test Infected: Programmers Love Writing Tests, by Kent Beck and Erich Gamma. Published in Java Report, 3(7), July 1998. http://junit.sourceforge.net/doc/testinfected/testing.htm

Set lab

  • Uses generics...
  • Instructions
  • Starting code (all in one zip file), or grab them individually:
    • Set.java
    • ArraySet.java
    • ArraySetTest.java
  • Add them to your IDE, together with student.jar
  • Submission to Web-CAT graded by combination of scores and our reference tests ReferenceArraySetTest.java

Back to Menu