Blog

How to trace requirements to automated tests

You trace requirements to automated tests by breaking each requirement into conditions that one test can prove, linking every condition to its tests, and counting a condition as covered only when a linked test checks a result and passed its last run. SmartestQA measures coverage exactly this way.

The problem

A traceability matrix in a spreadsheet is true on the day it is written. After that, tests are renamed, requirements change, and the matrix drifts away from what actually runs.

A link also proves less than it looks. A test that is linked but never ran, failed, or checks nothing does not prove a requirement.

How SmartestQA does it

Requirements and tests live in the same place, so the link and the result are always current.

  • One condition, one result. Requirements are split until a single test can prove each part.
  • Coverage from real runs. A condition counts only when a linked test checks a result and passed.
  • Risk first. The untested conditions are listed, most critical first.
  • Evidence on demand. Save the picture before a release, or print it.

Questions and answers

What is requirements traceability?

The ability to follow a requirement forward to the tests that prove it, and a test back to the requirement it exists for.

How is requirement coverage different from code coverage?

Code coverage measures which lines ran. Requirement coverage measures which stated conditions have a passing test. Code can be fully executed while a business rule goes unchecked.

Does a linked test count as coverage?

Only when it checks a result and passed its last run.

Where to read more

See How do I prove every requirement is tested?, or the documentation: Test Health.