Files
gps-denied-onboard/.cursor/skills/refactor/phases/05-test-sync.md
T
Oleksandr Bezdieniezhnykh 6044a33197 chore: WIP pre-implement
Bundled hygiene commit before cycle-3 /implement (AZ-776, AZ-777). Mixes
two concerns by user choice (autodev option B):

- Cycle-3 autodev artifacts not yet committed by Step 9 (new-task):
  task specs for AZ-776 / AZ-777 under _docs/02_tasks/todo/ and the
  updated _docs/02_tasks/_dependencies_table.md.
- Accumulated skill / rule tooling maintenance under .cursor/ (skills:
  autodev, code-review, decompose, deploy, implement, new-task, plan,
  refactor, retrospective, test-spec; rules: coderule, cursor-meta,
  meta-rule, testing; new release skill scaffolding).
- Autodev bootstrap state: _docs/_autodev_state.md (step 10 in_progress)
  and _docs/_process_leftovers/2026-05-11_d_cross_cve_1_opencv_pin_deferred.md
  (replay timestamp refreshed; gtsam 4.2 still numpy<2-only).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 13:14:11 +03:00

2.7 KiB

Phase 5: Test Synchronization

Role: QA engineer and developer Goal: Reconcile the test suite with the refactored codebase — remove obsolete tests, update broken tests, add tests for new code Constraints: All tests must pass at the end of this phase. Do not change production code here — only tests.

Skip condition: If the run name contains testability, skip Phase 5 entirely — no test suite exists yet to synchronize. Proceed directly to Phase 6.

5a. Identify Obsolete Tests

  1. Compare the pre-refactoring codebase structure (from Phase 0 inventory) with the current state
  2. Find tests that reference removed functions, classes, modules, or endpoints
  3. Find tests that duplicate coverage due to merged/consolidated code
  4. Decide per test: delete (functionality removed) or merge (duplicates)

Write RUN_DIR/test_sync/obsolete_tests.md:

  • Test file, test name, reason (target removed / target merged / duplicate coverage), action taken (deleted / merged into)

5b. Update Existing Tests

  1. Run the full test suite — collect failures and errors
  2. For each failing test, determine the cause:
    • Renamed/moved function or module → update import paths and references
    • Changed function signature → update call sites and assertions
    • Changed behavior (intentional per refactoring plan) → update expected values
    • Changed data structures → update fixtures and assertions
  3. Fix each test, re-run to confirm it passes

Write RUN_DIR/test_sync/updated_tests.md:

  • Test file, test name, change type (import path / signature / assertion / fixture), description of update

5c. Add New Tests

  1. Identify new code introduced during Phase 4 that lacks test coverage:
    • New public functions, classes, or modules
    • New interfaces or abstractions introduced during decoupling
    • New error handling paths
  2. Write tests following the same patterns and conventions as the existing test suite
  3. Ensure coverage targets from Phase 3 are maintained or improved

Write RUN_DIR/test_sync/new_tests.md:

  • Test file, test name, target function/module, coverage type (unit / integration / blackbox)

Self-verification:

  • All obsolete tests removed or merged
  • All pre-existing tests pass after updates
  • New code from Phase 4 has test coverage
  • Overall coverage meets or exceeds Phase 3 baseline (75% overall, 90% critical-path floor / 100% aim — per .cursor/rules/cursor-meta.mdc Quality Thresholds)
  • No tests reference removed or renamed code

Save action: Write test_sync artifacts; implemented tests go into the project's test folder

GATE (BLOCKING): ALL tests must pass before proceeding to Phase 6. If tests fail, fix the tests or ask user for guidance.