Workshop 17: The Absolute Beginner’s Guide to JUnit in the Classroom

Friday March 7, 2014, 7:00pm-10:00pm, SIGCSE 2014, Atlanta, GA

Workshop #17 Abstract

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()).

SIGCSE 2014, Atlanta, NC

Fri Mar 7, 2014, 7:00pm-10:00pm

Intended audience

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.

Background material

You might find the following materials useful and interesting as they provide a background on why TDD and Unit testing.

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:

Part I. Intro to JUnit Tests

Part II. Beginner's Strategy

Part III. JUnit tips

Part IV. Adding JUnit to assignments