Skip to main content

Stop running tests that will never fail.

Run only the tests affected by your change — and the ones most likely to fail — first.
Feedback in seconds, not minutes. Full suite still runs. Lower CI bills.

One-block install · MIT licensed · Java 17–26 · No code changes needed

More demos → · Try it in your project →

Skip the tests your change can't break.

What if your build pipeline could predict which tests actually matter for a given change? test-order tracks which parts of your application are exercised by which tests, so when you change a class it can run only the tests that touch it — giving you useful feedback within seconds rather than minutes. Pair it with priority scoring to surface likely-failing tests first.

# Run only the tests affected by your uncommitted changes
mvn test-order:affected test

# or, with Gradle:
./gradlew testOrderAffected

Why test-order?

Most CI time is spent waiting for tests that were never going to fail. test-order fixes that without touching your test code.

20+
real bugs caught
across 30+ OSS Java projects
See the patches →
~95%
detection accuracy
top-3 prioritized tests caught 20 of 21 injected bugs
Validation harness →
92.9%
APFD on first run
sample suite — first failure at position 1 / 7
How APFD is scored →

Numbers from a 30-project third-party validation run (June 2026) and a sample APFD report. Plus three freebies: 0 config to add, 100% of the original coverage preserved, runs on existing JUnit / TestNG suites.

Alphabetical / declaration order
The default. Bug-catching tests run whenever — could be first, could be last. Flaky tests stay anywhere.
Hand-tuned @Order or test groups
Works for tiny suites, rots fast. Nobody updates it after the third refactor. @Order docs →
test-order
Learns from your CI history. Runs the tests most likely to fail first — automatically, every build.

Built on decades of research in test prioritization and impact analysis. See the bibliography →

An experimental tool by the SapMachine team — SAP's OpenJDK distribution. Tested on 30+ open-source Java projects.

Built for real test suites

Three things test-order does that random ordering, alphabetical ordering, and stale heuristics don't.

Everything that ships in the box

Every feature links to the relevant docs section.

See your suite, ranked

The dashboard ships with every install. Open it after a single test run to see what's slow, what's failing, and which tests are doing the most work. Open live demo → · Dashboard reference →

Add it to your project.

One block in your build file. No code changes. No annotations.

<!-- pom.xml — add the plugin -->
<plugin>
<groupId>me.bechberger</groupId>
<artifactId>test-order-maven-plugin</artifactId>
<version>0.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<goals><goal>prepare</goal></goals>
</execution>
</executions>
</plugin>

Also add to ~/.m2/settings.xml (one-time, enables the short mvn test-order:show prefix):

<!-- ~/.m2/settings.xml — lets you use the short mvn test-order:show prefix -->
<settings>
<pluginGroups>
<pluginGroup>me.bechberger</pluginGroup>
</pluginGroups>
</settings>

Then just mvn test (or ./gradlew test) — the plugin learns from each run.

Available on Maven Central. Full setup: Maven →Gradle →

How it works

Four steps. The first two are things you already do.

1

Learn once

mvn test

Records which source classes each test actually exercises. Stored in .test-order/ — happens automatically on first run.

2

Make a change

# edit a source file
# or add a new test
3

Run affected tests

mvn test-order:affected test
AffectedTouch changed code → run first
4

Run remaining

mvn test-order:run-remaining test
RestOnly if step 3 succeeds
Prefer one command? mvn test-order:auto test combines all of the above — learns on first run, then runs affected tests first and the rest after, automatically.

Stop running tests that will never fail.

Read the getting-started guide →