Skip to content

Hygiene, KPI boundary tests and mutation testing - #1

Merged
vidit-16 merged 1 commit into
mainfrom
overhaul/hygiene-depth
Sep 16, 2026
Merged

vidit-16 merged 1 commit into
mainfrom
overhaul/hygiene-depth

Conversation

@vidit-16

Copy link
Copy Markdown
Owner

Small hygiene pass. The repo already had CI, Docker, docs, a license and a large test suite, so this only fills gaps.

Changes

  • Hygiene: removed a committed local tool config file (.claude/launch.json). .gitignore now covers .env*, coverage output, mutation output and IDE folders. Added .env.example for the optional OPENAI_API_KEY.
  • Mutation testing: added scripts/mutation_test.py, an AST-based mutation tester (mutmut doesn't run on Windows). It swaps comparison and arithmetic operators and nudges integer constants, one at a time, and restores the file afterwards.
  • Tests: added tests/test_kpis_edges.py with 8 boundary tests: zero and unit denominators for fill rate, cancellation rate, mix, growth and target variance, a missing sales type, and rounding precision.
  • README: updated the test count and added a mutation testing row.

Results

  • ruff check .: passes
  • pytest: 316 passed (308 existing + 8 new) locally on Windows
  • KPI mutation score: 13/37 (35%) → 34/37 (92%). The 3 survivors are equivalent mutants (> 0 → >= 0 where the count is never 0, or where 0/0 is already NaN).

Not changed

  • Dockerfile, CI and docs were already in good shape.
  • No ruff format: it would reformat 50 files for no functional gain.
  • No new A/B comparison: scripts/evaluate_forecasts.py already benchmarks five forecasting models.

- Remove committed local tool config and ignore it, plus secrets, coverage and IDE files
- Add .env.example documenting the optional OPENAI_API_KEY
- Add scripts/mutation_test.py, an AST mutation tester that runs on Windows
- Add KPI boundary tests (zero/unit denominators, rounding precision); KPI mutation score 35% -> 92%
- README: test count and mutation result
@vidit-16
vidit-16 merged commit e63af91 into main Sep 16, 2026
3 checks passed
@vidit-16
vidit-16 deleted the overhaul/hygiene-depth branch September 16, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant