Skip to content

Repository files navigation

testament

testament is a Rust CLI and library workspace for evaluating test quality guardrails from static test IR and optional dynamic evidence. The first supported target is Ruby test suites, with RSpec, Minitest, and test-unit adapters. Ruby syntax is parsed with Prism through the ruby-prism crate.

What It Measures

  • Adequacy signals such as assertion density, line/branch coverage, mutation score, checked coverage from trace evidence, and a separately identified static checked-coverage approximation.
  • Redundancy signals from static similarity, assertion overlap, per-test coverage, and per-test mutation evidence.
  • Maintainability signals from test-smell rules.

Requirements

  • Rust 1.91, managed by rust-toolchain.toml
  • Ruby 3.1 or newer for the Ruby probe syntax/runtime checks

Installation

Install the CLI from crates.io:

cargo install testament-cli

Install the optional Ruby probe from RubyGems.org:

gem install testament-probe-ruby

To install the current main branch directly from the repository:

cargo install --git https://github.com/ydah/testament testament-cli

Usage

testament check
testament report --format json spec/user_spec.rb
testament explain adequacy.assertion_density
testament explain --file spec/user_spec.rb
testament check --no-rename-tracking

Development

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --locked
ruby -c probes/ruby/testament-probe-ruby/lib/testament/probe.rb

Run a fixture report:

cargo run -p testament-cli -- --config fixtures/evidence/testament.toml report --format json fixtures/ruby/sample_spec.rb

Ruby Probe

The Ruby probe can collect per-test coverage and trace evidence:

require "testament/probe"

By default it writes .testament/per-test-coverage.json and .testament/trace.json. See Ruby probe README for probe-specific options.

License

This project is licensed under the MIT license. See LICENSE.

Maintainer release instructions are documented in RELEASING.md.

About

Research-informed test quality guardrails for Ruby, powered by Rust and Prism.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages