Probe Tests: A Strategy for Growing Automated Tests around Legacy Code

  • Authors:
  • Asim Jalis

  • Affiliations:
  • -

  • Venue:
  • Proceedings of the Second XP Universe and First Agile Universe Conference on Extreme Programming and Agile Methods - XP/Agile Universe 2002
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

Legacy code lacking unit tests is difficult to refactor. Without unit tests all changes to the code are dangerous. On the other hand in its unrefactored state the code lacks the modularity necessary for adding unit tests. Therefore, use Probe Tests. Probe tests are assertions placed in code which instead of crashing the program on failure simply log their success or failure to a file. The logged success or failure can then be presented through any xUnit framework. Probe tests balance these forces: time to recover from test failure, ease of parsing log files, difficulty of testing poorly refactored code, separation of production and test code.