Software testing has become popular in introductory courses, but many educators are unfamiliar with how to write software tests or how they might be used in the classroom. This workshop provides a practical introduction to JUnit for educators. JUnit is the Java testing framework that is most commonly used in the classroom. Participants will learn how to write and run JUnit test cases; how-to&rquo;s for common classroom uses (as a behavioral addition to an assignment specification, as part of manual grading, as part of automated grading, as a student-written activity, etc.); and common solutions to tricky classroom problems (testing standard input/output, randomness, main programs, assignments with lots of design freedom, assertions, and code that calls exit()).
This workshop is intended for CS educators who want to write software tests or who want students to write tests for their own assignments. No prior experience with testing is required. Java fluency is expected. Basic knowledge of Eclipse is preferred, but not required. The examples presented will focus on CS1- and CS2-level Java assignments.
You might find the following materials useful and interesting as they provide a background on why TDD and Unit testing.
What is Test-driven Development?: Read a brief overview of what TDD is.
What is JUnit?: A lightning overview of this testing framework.
Set up your IDE for using JUnit: You can install support for JUnit in your IDE of choice. We have instructions on how to do so for BlueJ, jGrasp, NetBeans, and Eclipse. If you prefer to use the command line, that's fine too. We will be using JUnit 4.x in our examples.
JUnit Discussion Forum: we have an on-line forum set up (use Facebook Connect to login, or create an account) on the Web-CAT web site for you to ask questions, discuss ideas, and share with each other; feel free to use it before, during, and after the workshop.
The goal is to give participants a solid introduction to using JUnit in the classroom. The workshop will be discussion-oriented and driven primarily by live examples. As examples are demonstrated, participants can ask questions as they arise and answers or alternatives can be illustrated in real time. The agenda we will follow includes: