Testing the product against its intended behavior
Spec-Based Testing is an additional automated regression-testing mechanism: an independent verification agent exercises the application against human-approved specifications. It complements unit testing, linting and static analysis, integration testing, end-to-end testing, and human User Acceptance Testing (UAT); it replaces none of them.
Important: Spec-Based Testing Is Regression Testing, Not Initial Acceptance
Regression checks are effective for functionality already validated and approved by a person. If an implementation agent documents incorrect behavior, a verifier may confirm that code matches that documentation while missing the original business error. A specification generated from the same unapproved implementation cannot independently establish correctness against business intent. Initial functional acceptance requires human validation. Once approved, the functionality’s approved specification becomes a regression baseline for identifying unintended impacts from subsequent changes.
What the verifier receives
- The implementation agent develops functionality and continuously maintains a human-readable current specification describing what has been implemented.
- The Product Engineer and stakeholders validate and approve the functionality through the appropriate human review process.
- The approved specification becomes the regression baseline for that functionality.
- The independent verification agent uses that approved baseline to exercise the application and check for regressions, using tools such as Playwright with authorized access and human-authorized execution. Explicit manually authored test scripts are not necessarily required.
The current implementation specification and approved regression baseline are distinct. The implementation agent may update the current specification continuously, but must not silently rewrite the approved baseline to match newly introduced behavior. Report ambiguity rather than inventing requirements.
What the verifier does
For each meaningful requirement, derive representative positive, negative, boundary, and permission-related checks as appropriate. Exercise user interactions, application interfaces, or other externally observable behavior where feasible. Identify which requirements were tested, what evidence was observed, and which checks could not be completed. Existing unit, integration, and end-to-end tests remain valuable; independent spec-based verification complements them.
Reporting outcomes
A useful report distinguishes Pass, Fail, Blocked, and Needs clarification. A pass identifies the behavior observed and its link to an expected requirement. A fail records the mismatch and how to reproduce it. Blocked identifies an environment, data, or access limitation. Needs clarification identifies a specification that cannot support a defensible judgment.
The Product Engineer closes the loop
Findings return to the Product Engineer, who decides whether the software must change, the specification must be clarified, or a limitation requires another specialist or stakeholder decision. Corrections are tested again. The specification remains the reference for intended behavior; accepted changes to that intention must be recorded rather than making tests conform silently to an accidental implementation. The continuously updated current implementation specification and the human-approved regression baseline are separate references. Cycle 1 UAT establishes the first approved baseline. In Cycle 2, independent spec-based regression checks use the previously approved specifications; relevant changes enter that baseline only after appropriate human validation and approval. Updating current specifications must never silently replace approved expectations.
What this cannot prove
A verification agent can fail to notice a problem, misread a requirement, or generate incomplete test coverage. A perfectly passing specification may also omit an important business need. Security, performance, accessibility, and regulatory assurances may require specialist techniques beyond feature-level verification. Spec-Based Testing does not replace architect review, UX judgment, or UAT.
Where to learn the procedure
The Run Spec-Based Testing practitioner guide provides a repeatable workflow and example result record. The Reference Project demonstrates what a small specification-to-test trace looks like.