QlarifyLabs
← AI in Testing
Keeping automation healthyEstablished

Predictive test selection

Learn from past runs which tests tend to fail for which kinds of change, and run the most relevant tests first, or only those, instead of the whole suite on every commit.

How it works

The baseline to beat first is plain dependency-based selection: run the tests that depend on the changed code. Predictive selection goes further. A model is trained on history: for each past change it sees the files touched, how far the dependencies are from each test, each test's own failure record, and whether the test failed. For a new change, it ranks tests by how likely they are to fail, and CI runs down the list until it reaches a budget. This is classic machine learning rather than an LLM, and large engineering organisations have published on running it in production. The full suite still runs on a schedule to catch what the selection skipped, and those misses feed back into training.

This changefiles touchedHistorypast runs, missesModelranks every testTests, most likely to fail firstCI runs thesebudgetskipped this timeFull suite, on a schedulecatches what was skipped
CI runs the top of the ranking up to a budget; the scheduled full run catches the rest, and its misses feed back into training.

When to use it

Suites too slow to run on every change, large monorepos, and teams where CI cost or queue time is the bottleneck. It needs plenty of history containing real failures.

Limitations

It learns from the past, so new kinds of change, new tests and rare failures get underweighted. Flaky tests corrupt the training labels. A skipped test that would have failed stays invisible until the next full run. Small teams may not have enough history to train on, and proven at very large scale doesn't mean worth it at small scale.

Watch for

A change to a shared config file, which history links to few failures, gets few tests selected, merges green and breaks in the next full run after others have built on it. Always run the full suite for changes to config, schemas and dependency versions.

What you still own

How often the full suite runs, which tests are never skipped, and keeping an eye on the miss rate.

Cite this

Qlarify Labs. (2026). Predictive test selection. Retrieved from https://labs.qlarify.fi/ai-in-testing/predictive-test-selection