Adding Software Testing to Programming Assignments

SIGCSE 2006 Workshop Companion Web Site

This web site contains the companion materials for the SIGCSE 2006 Workshop: Adding Software Testing to Programming Assignments, presented by Stephen Edwards from Virginia Tech's Department of Computer Science.

This web site contains electronic copies of all the workshop materials, together with links to installable versions of all required software.

Workshop Abstract

Software testing is a critical skill for practitioners, but it is rarely given appropriate coverage in undergraduate curricula. If we want to change the culture of how students program, they should practice basic testing skills on every assignment all the time. This workshop provides a practical introduction to incorporating software testing activities as a regular part of programming assignments. While this can be done for many languages, the focus here is on leveraging XUnit-style tools and test-first coding techniques to infuse software testing throughout courses that teach object-oriented programming concepts. Empirical evidence suggests that, when assignments are transformed this way, students produce higher-quality results (averaging 28% fewer bugs/KSLOC) and are more likely to turn assignments in on time. Further, test-first strategies preempt "big bang" integration disasters, and students report greater confidence in their own work.

This workshop presents five different models for how one can incorporate testing into assignments, provides live programming demonstrations of the techniques, and discusses the corresponding advantages and disadvantages of each. Approaches to assessment--using testing to assess student code, assessing tests that students write, and automated grading--are all discussed. Advice for writing "testable" assignments is given. Hands-on examples for participants are also provided.

Keywords: computer science education, test-driven development, test-first coding, JUnit, unit testing, automated grading

Level: Beginner

Workshop Contents

Resources

In addition to the materials on this web site, you may find the following on-line resources useful:

Tools You May Need

While you can view the source code on this web-site directly, if you wish to use it in an IDE, be sure to use an environment that supports an appropriate unit testing framework.

Sponsorship

We gratefully acknowledge the support provided to this work by our sponsors. This work is sponsored in part by the National Science Foundation under Grant No. DUE-0127225, by a Virginia Tech Institute for Distance and Distributed Learning research fellowship, and by an Eclipse Innovation Grant from IBM. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation, IBM, or IDDL.