{ "name": "module-audit-and-test", "description": "module-audit-and-test", "tags": [ "regression", "testing", "quality-assurance", "modules" ], "category": "dev", "created": "2026-06-18T00:41:25.711Z", "updated": "2026-06-24T21:58:03.530Z", "content": "---\nname: module-audit-and-test\ncategory: dev\ntags: [regression, testing, quality-assurance, modules]\n---\n\n# Module Regression & Testing Framework\n\nThis skill provides a formal methodology for ensuring that module modifications do not introduce regressions and that new features meet quality standards.\n\n## 1. Testing Levels\n- **Unit Test**: Isolating a single function within a module using `test_module`.\n- **Integration Test**: Testing the module's interaction with other modules or the VFS.\n- **Regression Test**: Running a set of known \"golden\" inputs and comparing outputs to ensure previous fixes remain active.\n\n## 2. The Regression Workflow\nWhen modifying a module, follow this cycle:\n\n### Phase A: Baselining (Pre-Edit)\n1. **Capture Current State**: Run the module with 3-5 standard inputs and save the output to a file in `/tests/baselines/[module_name]/`.\n2. **Identify Edge Cases**: Document at least one \"failure mode\" (e.g., empty input, oversized payload) that the module currently handles correctly.\n\n### Phase B: Controlled Modification\n1. **Edit**: Use `edit_module` to implement the change.\n2. **Verify**: Use `test_module` to confirm the specific fix/feature works in isolation.\n\n### Phase C: Regression Run (Post-Edit)\n1. **Compare**: Re-run the baseline inputs.\n2. **Diff Analysis**: Compare current output vs. baseline. Any unexpected change is a regression.\n3. **Edge Case Check**: Re-verify the previously identified failure modes.\n\n## 3. VFS Test Registry Structure\nMaintain tests in the following hierarchy:\n- `/tests/baselines/` $\\to$ Expected outputs for stable versions.\n- `/tests/suites/` $\\to$ Scripts or lists of inputs to be run sequentially.\n- `/tests/logs/` $\\to$ Execution history of test runs.\n\n## 4. Failure Protocol\nIf a regression is found:\n1. **Revert**: Use `reload_module` to return to the original state.\n2. **Analyze**: Use `debug-deep-dive` to find the conflict between the new logic and the baseline.\n3. **Refine**: Rewrite the logic to accommodate both the new feature and the baseline requirement.\n" }