12
Regression testing Tor Stållhane

Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Embed Size (px)

Citation preview

Page 1: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Regression testing

Tor Stållhane

Page 2: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

What is regression testing – 1

Regression testing is testing done to check that a system update does not re-introduce errors that have been corrected earlier.

All – or almost all – regression tests aim at checking

• Functionality – black box tests.

• Architecture – grey box tests

Page 3: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

What is regression testing – 2

Since they are supposed to test all functionality and all previously done changes, regression tests are usually large.

Thus, regression testing needs automatic

• Execution – no human intervention

• Checking. Leaving the checking to developers will not work.

Page 4: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Automating regression tests – 1 We face the same challenge when doing

automating regression test as we face when doing automatic test checking in general:

Which parts of the output should be checked against the oracle?

This question gets more important as we need to have more version of the same test due to system variability.

Page 5: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Automating regression tests – 2

Simple but annoying – and some times expensive – problems are e.g.

• Use of date in the test output

• Changes in number of blanks or line shifts

• Other format changes

• Changes in lead texts

Page 6: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Automating regression tests – 3

A simple solution seems to be to use assertions. This is not a good alternative for the following reasons: The assertion will have to be

• Inside the system all the time – extra space and execution time

• Only in the test version – one extra version per variation to maintain.

Page 7: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Automating regression tests – 4

The answer to the question on the previous slide is to parameterize the test results.

Instead of using a complete output file as the oracle we use:

• A tool to extract the relevant info from the output file

• Compare the extracted info with the info stored in the oracle

Page 8: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Automating regression tests – 5

Build tests for version x

Test data

Run tests for version x

Build results for version x

Compare Verdict

Page 9: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Run all regression testsSince a regression test is large, it is always a need

to identify which parts of the regression tests need to be run after a change – e.g. an error correction.

Thus, traceability – which components are used to realize which functionality or requirement – is important info for two reasons:

• Save execution time. Fast and cheap hardware is, however, steadily reducing this need.

• Know which tests to change when we change functionality.

Page 10: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Improving the regression test

Once we have a regression test, it is important to update it each time we

• Fix a bug• Add, change or remove functionality• Change platform

If we create variants of the system, we also need to create parallel variants of the regression test suite.

Page 11: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Bug fixing – 1

When somebody reports a bug, the first activity is to reproduce it – preferably with the simplest input sequence possible.

When the bug is reproduced, we need to make a new entry in the regression test. This entry will be one of the following

• The original reported input sequence

• The simplest possible input sequence

Page 12: Regression testing Tor Stållhane. What is regression testing – 1 Regression testing is testing done to check that a system update does not re- introduce

Bug fixing – 2

• The original reported input sequence– Pro: is the real thing and will tell us something

about how the system is used in real life.– Con: can be large, complex and difficult to

understand

• The simplest possible input sequence– Pro: is (usually) simple to understand – Con: is an artificial input sequence and has no

info beside being able to reproduce a reported bug