Resource

Requirement evidence example

Follow one synthetic requirement from its wording through code, tests and documentation to see what counts as evidence that it is met.

On this page
  1. Evidence of completion
  2. 1. The requirement
  3. 2. The code
  4. 3. The tests
  5. 4. The documentation
  6. 5. The status

Evidence of completion

A requirement counts as met only when it is linked by evidence to the code, a passing test and the documentation. Follow one credit limit requirement through each link, then apply the same test to your own backlog. The company, requirement and code are synthetic.

1. The requirement

FR-012. Credit limit check. When a sales order would take a customer over their credit limit, the order is held for approval by the credit controller.

Acceptance criteria:

  • An order within the limit is released automatically.
  • An order that exceeds the limit is held, with the reason recorded.
  • Only the credit controller can release a held order.

2. The code

The change is one rule added to the order approval step, and the requirement is named in its commit message: “Hold orders that would exceed the customer’s credit limit (FR-012).”

if (customer.balance + order.total > customer.creditLimit) {
  order.hold("Exceeds credit limit", "CREDIT_CONTROLLER");
}

3. The tests

Each test is named against its requirement, so the link from requirement to test is recorded in the test itself.

TestRequirementChecksResult
TC-SALES-041FR-012An order within the limit is releasedPassed
TC-SALES-042FR-012An order over the limit is held with its reasonPassed
TC-SALES-043FR-012A user without the credit controller role cannot release itPassed

4. The documentation

FR-012 is named in the user guide’s section on order approval, along with what a held order means for the sales team.

5. The status

RequirementCodeTestsDocumentationStatus
FR-012FR-012 named in commitFR-012 named in three passing testsFR-012 named in user guideComplete
FR-013FR-013 named in commitNo test for FR-013Not writtenUnevidenced

FR-013 is the other case. Its code exists but is proved by no test, so it stays unevidenced however confident its author is, and the work moves to the next stage only when FR-013 is named by a passing test.