SixthSense

Evidence-based test suite adequacy analysis for Ruby projects.

SixthSense scores test files across three axes:

  • Adequacy: coverage, checked coverage, and mutation score where available.
  • Redundancy: coverage- and mutation-requirement overlap, plus static clone detection.
  • Quality: test smells, assertion density, and flaky-test triggers.

Installation

Add the gem to your application's Gemfile:

gem "sixth_sense"

Then install dependencies:

bundle install

For local development from this repository:

bundle install
rake test

Usage

Run a static quality and redundancy pass:

ruby -Ilib exe/sixth_sense analyze spec --level 0

Run coverage and checked-coverage analysis:

ruby -Ilib exe/sixth_sense analyze spec --level 1 --format json

Run Level 2 analysis after producing mutation cache data:

ruby -Ilib exe/sixth_sense mutation-run spec --mutation-mode matrix
ruby -Ilib exe/sixth_sense analyze spec --level 2

Use guard mode in CI:

ruby -Ilib exe/sixth_sense guard --diff origin/main

Explain an analyzer and its references:

ruby -Ilib exe/sixth_sense explain adequacy/mutation

Capabilities

  • RSpec, Minitest, and test-unit discovery and parsing.
  • Per-example coverage through subprocess probes, plus in-process coverage mode.
  • TracePoint checked coverage with windowed and strict modes.
  • Built-in mutation matrix producer for RSpec, Minitest, and test-unit.
  • External mutant score ingestion when available.
  • Console, JSON, Markdown, HTML, and SARIF reports.
  • Baseline ratcheting for gradual adoption.
  • Plugin hooks for custom adapters and analyzers.

Configuration

Create .sixth_sense.yml when defaults need to be adjusted:

guardrail:
  fail_under:
    adequacy: 70
    redundancy: 60
    quality: 75
  require_level: 1
  ratchet: true
  tolerance: 1.0
coverage:
  enabled: true
  load_path: lib
  checked_mode: windowed # windowed | strict
  checked_window: 20
adequacy:
  coverage_transform: raw # raw | calibrated
  coverage_gamma: 0.5
mutation:
  cache_dir: .sixth_sense_cache/kill_matrix
  mode: score # score | matrix
  score_engine: auto # auto | mutant | builtin
  timeout: 10
  timeout_policy: killed # killed | separate
  max_mutants: 500
  equivalent_threshold: 0.2
  operators:
    exclude: []

Development

Run the test suite:

rake test

Build the gem locally:

gem build sixth_sense.gemspec

License

SixthSense is available under the MIT License.