Workshop 4: The Absolute Beginner’s Guide to JUnit in the Classroom
Part I
Part I. Intro to Unit Test and Uses in the Classroom
- A quick introduction to concepts of unit testing and an overview of JUnit and how it works, both on the command line and in typical IDEs (Eclipse and BlueJ); the difference between JUnit 3 and JUnit 4 (15 minutes).
- Discussion of the various strategies commonly used to employ unit testing in the classroom (15 minutes):
- public “acceptance tests” as part of an assignment specification
- private “reference tests” run by course staff during manual grading
- “reference tests” used for automated grading
- student-written tests for self-checking and/or grading
- and student-written tests of pre-existing code for developing debugging/testing skills
- Hands-on activity (and discussion): Practice writing JUnit tests for a classroom example (participants have two to choose from) (20 minutes).
- Using reference tests for automated grading, and the issues it raises. Writing software tests for student programs that have little or no constraints on student code structure (i.e., “open- ended” design problems, where students come up with the design themselves). Practical strategies for giving feedback (20 minutes).
- Hands-on activity (and discussion): Practice adding JUnit tests for an assignment. Participants pick the assignment (two to choose from) and pick the strategy they wish to employ (public tests to enhance the assignment spec, reference tests for grading, requiring students to write tests, etc.), and adapt the assignment and/or practice writing the corresponding tests. Participants exchange results and discuss. (20 minutes + break).