Difference between revisions of "Delta debugging testcase 01"
|Line 1:||Line 1:|
== Name ==
== Name ==
Revision as of 20:47, 13 December 2006
Hello World Test
This test case runs the famous HelloWorld script written in perl. This is the correct content of helloworld.pl.
#!/usr/bin/perl use warnings; use strict; print ("Hello world!");
The purpose of this test is to purposely wreck HelloWorld (bet you never thought of that!) and let Delta Debugging Algorithm recover the correct version from the SVN.
The test uses svn://cdot.senecac.on.ca/deltatest.
- Build Script.
- Since HelloWorld is a Perl file, and Perl combines compilation and execution, the Build Script calls the program and pipes the result to a log file.
- If the compilation fails, the log file will not be created.
- Test Module.
- Tests if the log file exists, and it is not empty. The test fails otherwise.
- Delta Debugging Script.
- Runs the Delta Debugging Algorithm to detect failed test (in this case, compilation error) and perform fixes.
- Unit test, runs the build and test the program.
- Download the source code.
- Run the testHello.pl. Ensure that the test passes (i.e. fix the error in helloworld.pl).
- Modify helloworld.pl in the HelloWorld directory to induce compilation error (e.g. change print to prints)
- Run the testHello.pl again. Ensure that the test fails. You may receive this line.
$ perl testHello.pl Undefined subroutine &main::prints called at HelloWorld/helloWorld.pl line 6. hello.log is zero-size. 0
- Run the deltadebughello.pl. The algorithm will then go backward in time and find the revision that passes the test.