Lab: Head to Head Testing

Steven J. Zeil

Old Dominion University, Dept. of Computer Science

Table of Contents

1. Lab Instructions
2. Problem Description: Triangle Diagnosis

There are many circumstances where you are working on a program but have access to a working (or nearly working) executable.

Whenever you find yourself working on a system for which you already have a (nearly) working executable, you can take advantage of this by doing head to head testing, in which you

  1. Run the old code on a set of inputs, capturing the outputs into a file.

  2. Run your new code on the same set of inputs, capturing the outputs into a differnet file.

  3. Compare the two output files to see what, if any, differences you can find between them.

    • Those differences might represent bugs in your new code.

    • Or they might be due to bugs in the old code that you have just successfuly fixed.

    • Or they might represent the new behavior or functionality and that you were working to add ot the old program.

Whatever the reason, its' the differences in outputs that are particularly interesting. And there are simple tools that you can use to find those differences even if they are buried in a sea of nearly identical outputs.