Regression Testing

Steven J Zeil

Last modified: Apr 11, 2024
Contents:

Abstract

Regression testing monitors the changes, for better or worse, of the system as we make changes to it. Regression testing generally involves large numbers of tests, often selected as a mixture of test cases originally developed as unit, integration, and system tests.

In this lesson we will look at what is required for support of regression testing.

1 Regression Frameworks

What Makes a Testing Framework a Regression Framework?

Little agreement, but IMNSHO


Open Possibilities

1.1 DejaGnu


Test Results

Standard for test frameworks.

Possible outputs for any test:


Sample Test

set testdata {
   {"addition" "22 + 1" "23"}
   {"multiplication" "21 * 2" "42"}
   {"division" "14 / 3" "4"}
     ⋮
}
foreach pattern $testdata {
   eval "spawn ./calc [lindex $pattern 1]"
   expect {
     -re [lindex $pattern 2] {
              pass [lindex $pattern 0] }
     default {fail [lindex $pattern 0] }
   }
}


Running DejaGnu

runtests --tool calcTests

runs all tests in the calcTests directory, producing output like:

 PASS addition
 PASS multiplication
   ⋮
 # of expected passes          12
 # of unexpected failures       2

1.2 What Else?

There are lots of lists of “most popular regression testing tools” on the web. Example

Apparently, so few organizations actually do regression testing that people have forgotten what it means!