Workshop 4: The Absolute Beginner’s Guide to JUnit in the Classroom
Part II
Writing Assignments with Unit Testing Components
- An overview of common problems that instructors run into when writing software tests, and how they can be addressed (30 minutes).
- testing standard input/output behaviors
- testing programs that use random numbers
- testing main() programs instead of individual methods
- testing code with assertions
- testing code that calls exit()
- testing graphical user interfaces
- Hands-on activity (and discussion): Practice writing JUnit tests for a classroom example that uses stdio or random numbers (participants have two to choose from. (20 minutes plus 15- minute break.)
- Hands-on activity (and discussion): Practice writing JUnit tests for a simple GUI that has a button and some simple mouse interaction. (20 minutes)
- Wrap-up: open discussion of testing issues. Participants can discuss their own experiences, and ask questions about classroom experience or how specific assignment issues can best be tested or handled (10 minutes).