Skip to content

Improve output reports with more details #4

@sakost

Description

@sakost

Summary

The current report outputs (text, JSON, HTML) provide basic mutation testing results but lack several useful details that would help users understand and act on the results.

Current State

  • Text report: Shows aggregate stats (files scanned, mutants generated/tested/killed/survived/timeouts/errors) and lists survived mutants with file:line, operator name, and original → mutated text
  • JSON report: Serializes the full MutationReport struct
  • HTML report: Self-contained with summary table, per-file annotated source with color-coded lines (killed=green, survived=red, no-coverage=gray)

Suggested Improvements

Per-file summary

  • Add a per-file breakdown showing mutation score per file
  • Helps identify which modules have the weakest test coverage

Per-operator summary

  • Show statistics grouped by mutation operator (e.g., "ArithmeticOp: 45 killed / 50 total = 90%")
  • Helps identify which types of mutations are consistently surviving

Per-test coverage analysis

  • Show which tests killed which mutants (data is available from pytest-cov context)
  • Helps understand test effectiveness

Diff-style output

  • Show mutations as unified diffs rather than just "original → mutated" text
  • Easier to understand the context of each mutation

Comparative/baseline reports

  • Support comparing results across runs (e.g., "score improved from 85% to 92%")
  • Useful for CI integration

HTML report enhancements

  • Show full source line content (currently only shows the mutated fragment)
  • Add sortable/filterable tables
  • Add a navigation sidebar for multi-file reports
  • Add mutation score trend chart (when session DB is available)

Getting Started

The report implementations are in src/report/:

  • text.rs — text report
  • json.rs — JSON report
  • html.rs — HTML report
  • types.rsMutationReport and MutantResult data structures

The MutationReport struct already contains all individual MutantResult entries with file paths, operator names, and status — most improvements just need to aggregate this existing data differently.

Pick any single improvement from the list above and submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions