Trabajo
Stephen H. EDWARDS Dept. of Computer Science, Virginia Tech 660 McBryde Hall, Mail Stop 0106 Blacksburg, VA 24061, USA +1 540 231 5723 edwards@cs.vt.edu
ABSTRACT
There is a need for better ways to teach software testing skills to computer science undergraduates, who areroutinely underprepared in this area. This paper proposes the use of test-driven development in the classroom, requiring students to test their own code in programming assignments. In addition, an automated grading approach is used to assess student-written code and student-written tests together. Students receive clear, immediate feedback on the effectiveness and validity of their testing. This approachhas been piloted in an undergraduate computer science class. Results indicate that students scored higher on their program assignments while producing code with 45% fewer defects per thousand lines of code. Keywords: Computer science, software testing, testfirst coding, programming assignments, automated grading
enough and specifically enough for students to improve their performance? Thispaper proposes the use of test-driven development in the classroom. In conjunction, an automated grading strategy is used to assess student-written code and student-written tests together, providing clear and immediate feedback to students about the effectiveness and validity of their testing.
2. BACKGROUND
The goal is to teach software testing in a way that will encourage students to practicetesting skills in many classes and give them concrete feedback on their testing performance, without requiring a new course, any new faculty resources, or a significant number of lecture hours in each course where testing will be practiced [3].
2.1 Why Test-driven Development?
Test-driven development (TDD) is a code development strategy that has been popularized by extreme programming [1, 2]. InTDD, one always writes a test case (or more) before adding new code. In fact, new code is only written in response to existing test cases that fail. By constantly running all existing tests against a unit after each change, and always phrasing operational definitions of desired behavior in terms of new test cases, TDD promotes a style of incremental development where it is always clear whatbehavior has been correctly implemented and what remains undone. While TDD is not, strictly speaking, a testing strategy—it is a code development strategy [1]—it is a practical, concrete technique that students can practice on their own assignments. Most importantly, TDD provides visceral benefits that students experience for themselves. It is applicable on small projects with minimal training. Itgives the programmer a great degree of confidence in the correctness of their code. It encourages students to always have a running version of what they have completed so far. Finally, it encourages students to test features and code as they are implemented. This preempts the “big bang” integration problems that students often run into when they work feverishly to write all the code for a largeassignment, and only then try to run, test, and debug it.
1. INTRODUCTION
Many computer science educators have been looking for an effective way to improve the coverage of software testing skills that undergraduates receive [13]. Rather than adding a single course on the subject, some have proposed systematically infusing testing concerns across the curriculum [6, 7, 8, 11, 12]. However, thereis no clear consensus on how this goal is best achieved. One approach is to require students to test their own code in programming assignments, and then assess them on this task as well as on the correctness of their code solution. Two critical issues immediately arise, however: 1. What testing approach should students use? The approach must provide practical benefits that students can see, and...
Regístrate para leer el documento completo.