Delta debugging testcase 01

From CDOT Wiki
Jump to: navigation, search

(Back to Delta Debugging Test Cases)


Hello World Test


This test case runs the famous HelloWorld script written in perl. This is the correct content of


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://


  • 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.

Test Method

  • Download the source code from the repository!. The test can't be run straight from the zipped source code.
 svn checkout svn:// 
  • Run the Ensure that the test passes (i.e. fix the error in
  • Modify in the HelloWorld directory to induce compilation error (e.g. change print to prints)
  • Run the again. Ensure that the test fails. You may receive this line.
$ perl
Undefined subroutine &main::prints called at HelloWorld/ line 6.
hello.log is zero-size.
  • Run the The algorithm will then go backward in time and find the revision that passes the test.