SmartTest documentation
SmartTest reads a change, follows it through your code to the tests that can detect a regression, and runs only those, through Jest, Vitest, node --test, Playwright, Cypress, Angular, pytest, unittest, PHPUnit or Pest. When it cannot rule a test out, it runs it.
- 1Install and look
smarttest initInstall@tkmremi/smarttestas a dev dependency;initdetects the runners and explains the config before writing it. - 2Gate commits and pushes
smarttest hook installRuns the affected tests on exactly what is committed or pushed. - 3Run it in CI
smarttest ciFinds the base, deepens shallow clones, and keeps the full suite where you want it.
Start#
- Getting startedInstall, run
smarttest init, read the first selection. - Commit and push hooksTest exactly what is committed or pushed, in a temporary checkout when needed.
- Running in CIPick the base, deepen shallow clones, shard by recorded durations.
- Rolling out to a repositoryThe steps that caught a problem in each real rollout, in order.
Guides#
- Auditing selectionInject faults, record traces and compare imports to measure missed tests.
- AngularTemplates and styles as edges,
angular.jsonper project,ng test. - Python (preview)pytest and unittest, analysed without running Python.
- PHP (preview)PHPUnit, Pest and Laravel, analysed without running PHP.
- StudioA local browser view of the analysis: impact, tests and evidence.
- VS CodeWhich tests protect a function, on hover; run what a change affects.
- PluginsThe frozen Plugin SDK: edges, rules, reporters and adapters.
Concepts#
- How selection worksFrom a diff to symbols, the dependency graph and a selection with reasons.
- Safety modelWhat SmartTest never does, and why unsure means selected.
- Runtime evidenceTraces of what a test ran, combined with the static graph.
- Running less, fasterResult cache, fail-fast order, parallel runners, adaptive mode.
- Change trackingGit, Mercurial, Subversion, or snapshots without version control.
- RulesArchitecture as testing policy: critical paths, required tests.
Reference#
- CLIEvery command and flag, with exit codes.
- ConfigurationEvery key of
smarttest.config, with defaults. - Public contractsWhat is frozen at 1.0.0 and what needs a major version.
- BenchmarksSelection and speed on the fixture harness, regenerated each release.
- ChangelogWhat changed in each version.
Results#
- Case study: LeadsItThe first real migration: six projects, no root package.
- Benchmarks for 1.0.0Real repositories replayed at 0 missed failures.
- Benchmarks for 1.2.0OpenPro's four JavaScript repositories: 0 missed failures, 16–75% less test time.
- External repositoriesThe 0.6.0 adoption check on repositories never seen before.
Project#
- RoadmapWhat comes next, in points, with exit gates.
- Roadmap 1.xThe 1.x sprints and their status.
- Delivery logWhat each version actually delivered.
- ArchitecturePackages, boundaries and data flow.
- Decision recordsAccepted architecture decisions.
- Security reviewThe 1.0.0 review of what SmartTest reads, writes and runs.
- Design systemTokens, type and colour shared by Studio and this site.
- SpecificationThe product specification; sections are cited as §11.4.
Section numbers such as §11.4 refer to the specification. The same pages are in the repository under documentation/.