← Testing and quality guides

How to run quality gates after SpecDD changes

How-To Testing and quality Intermediate 1131004HOWTO-1131004

HOWTO-1131004Testing and qualityIntermediate

This guide shows you how to run quality gates after spec-driven development changes.

Quality gates are the checks that must pass before a change is accepted. In a SpecDD workflow, those gates should cover both sides of the contract: the .sdd files must be valid and the implementation must satisfy the behavior, boundaries, tasks, and Done when criteria in the governing specs.

The exact commands depend on the project. SpecDD gives you the structure for deciding which checks matter.

Short answer

After a SpecDD change, lint edited specs, run the relevant tests or checks for the behavior, run project quality checks such as formatting, linting, type checking, docs checks, contract checks, or builds, then verify Done when before marking tasks complete. If a check cannot run, report why and state what remains unverified.

When to use this guide

Use this guide when:

What belongs in project-wide check instructions

Project-wide commands such as formatter, linter, typechecker, test, build, and docs-check commands belong in .specdd/bootstrap.project.md. Local specs should describe local behavior and completion criteria, not global command conventions.

A local spec can still say what must be verified:

Done when:
  Missing-place validation is covered by a check.
  Destination search behavior remains unchanged.

The project bootstrap can say which commands run those checks.

Steps

1. Classify the change

Ask what changed:

The quality gate should match the risk. A typo fix does not need the same gate as a public API contract change.

2. Lint changed specs

Use the SpecDD CLI after editing .sdd files:

specdd lint path/to/spec-or-directory

For a single edited spec, lint that file first. If several specs changed, lint the relevant directory too.

Spec linting checks the SpecDD files. It does not prove implementation behavior.

3. Run behavior checks

Use the spec to choose the checks:

Must:
  Reject itinerary items without a place name.

Scenario: missing place name
  Given the place name is empty
  When the person adds the itinerary item
  Then validation fails
  And no itinerary item is stored

Done when:
  Missing-place validation is covered by a check.

Run the focused test or test group that proves the scenario. If no test exists, add one or report the coverage gap.

4. Run boundary checks where needed

For Must not and Forbids, choose practical evidence:

Must not:
  Save itinerary items directly from UI components.

Forbids:
  UI importing ../adapters/*

Possible gates:

Not every negative rule needs a unit test. The gate should match the risk and the kind of constraint.

5. Run project quality checks

Depending on the project, this may include:

Use the commands the project defines. Do not invent a command in the spec when the project already has a standard bootstrap rule for checks.

6. Verify Done when before task status changes

If a task moves from [ ] to [x], verify:

Do not mark a task complete because code was written.

7. Report skipped checks

When a gate cannot run, report:

This keeps review honest. A skipped check is not automatically a failure, but it is not the same as a passing check.

Example gate plan

For an itinerary validation change:

Spec gate:
  specdd lint src/trips/itinerary-validation.sdd

Behavior gate:
  missing-place validation test
  validation failure preserves existing itinerary items

Boundary gate:
  confirm itinerary validation does not import trip storage

Project gate:
  project lint
  focused unit test command
  typecheck if the project uses one

Use actual project commands in the implementation report.

Common mistakes

How to verify the result

Quality gates are working when:

← Testing and quality guides