REFACTOR THE TESTWARE

From Test Automation Patterns
Jump to navigation Jump to search
.................................................................................................................Main Page / Back to Process Patterns / Back to Test Automation Patterns

Pattern summary

Testware must be refactored regularly just as application code.

'James Tony': Tests have technical debt too! It may be harder to measure than the technical debt of the code being tested, but cutting corners when writing tests can lead to a build-up of technical debt that can slow you down to a crawl in the future

Category

Process

Context

Use this pattern for long lasting automation projects in order to keep maintenance costs low. For short lived solutions you will not need it

Description

Refactoring means that scripts and test data should be checked regularly:

  • are the automated test cases still valid and useful? .
  • can the automation scripts be improved?.
  • can similar scripts be merged?
  • is the data up to date?
  • is the documentation up to date?
  • is the technical implementation as efficient as it can be? For example, wait times, communication methods etc. See article mentioned under Experiences below.

Implementation

After you have determined what should be refactored schedule when to execute the updates and control that they get done:

Potential problems

Refactoring will often be postponed when a project is running out of time. Be careful not to build up too much technical debt

Issues addressed by this pattern

AUTOMATION DECAY
DATA CREEP
OBSCURE TESTS
REPETITIOUS TESTS
SCRIPT CREEP

Experiences

Dot: I came across an article on LinkedIn by Bhushit Joshipura, called "Efficient Running of Test Automation". He describes a series of technical "fine-tuning" that enabled him to reduce the execution time of a set of automated tests from 4.5 hours to less than 1.5 hours. A good example of technical re-factoring. You can read it here:
linkedin

If you have also used this pattern and would like to contribute your experience to the wiki, please go to Feedback to submit your experience or comment.

.................................................................................................................Main Page / Back to Process Patterns / Back to Test Automation Patterns