Using Test-Driven Development in the Classroom: Providing Students with Automatic, Concrete Feedback on Performance

Author(s): S. Edwards
Venue: Proc. Int’l Conf. on Education and Information Systems: Technologies and Applications (EISTA)
Date: August 2003


Edwards writes that the main problem is the need to teach software testing skills to Computer Science undergraduates. There is a need to improve coverage of software testing skills. However finding the appropriate way to do this brings up several issues. One of these issues is the double-grading burden put on professors who have to grade correctness of code as well as the quality of the student’s test code. Lastly, the professors need to find a testing approach that the students see beneficial and will continue to use and appreciate. Edwards proposes using Test-Driven Development (TDD) with an automated grading system called Web-based Center for Automated Testing (Web-CAT). TDD promotes a style of development where it is clear what is implemented and what remains undone. Web-CAT is a tool that assesses both correctness of code and quality of tests.

The study that Edwards conducted is taken from his paper Using Software Testing to Move Students from Trial-and-Error to Reflection-in-Action. I have written a separate summary of this study and the results that can be referred to. This paper doesn’t focus on the study itself, but the role that Web-CAT played in it and how it can facilitate bringing the TDD methodology into the classroom. Current automated grading systems usually only check student’s code for compilation and execution. They hardly ever, if at all, deal with checking quality and completeness of test code. These automated systems hinder student’s testing skills for several reasons. They shift student’s focus to only on correct output. This yields bad designs by students. Students are also not rewarded for doing testing, and thus do less testing.

The purpose of Web-CAT is to not only check compilation and execution of student’s code like other automated grading systems, but to also assess the validity and completeness of student tests. It grades based on three factors: test validity score (checks consistency of tests with the assignment problem), test completeness score (checks for test coverage), and code correctness score (checks compilation and execution).

The results of the TDD study integrated with the Web-CAT assessments can be found in the summary for Edward’s paper: Using Software Testing to Move Students from Trial-and-Error to Reflection-in-Action. By using Web-CAT and TDD, students code contained 45% fewer defects. Furthermore, 73.5% of the students agreed that they would like to use Web-CAT and TDD for future projects even if they were not required.

TDD with Web-CAT provides immediate feedback on the student’s code, test coverage, and test validity, promoting education of software testing skills without the bad side-effects of other automated grading systems. Web-CAT allows unlimited submissions so the student’s can see concrete improvement of their test-coverage and correctness of their code and quality of there tests. Edwards believes that Web-CAT and TDD solves the issues of teaching software-testing skills to Computer Science undergraduates.