Failure clustering
Sort a run's failures into groups that look alike — the same error, stack trace or failing component — so a hundred red tests become a handful of problems to investigate.
How it works
When an environment breaks or a shared component regresses, a large test run fails in dozens or hundreds of places at once, and reading each failure separately wastes hours. Clustering compares failures by their error messages, stack traces, failing step and timing, after removing the parts that vary (IDs, timestamps, memory addresses), and groups those that are similar. Similarity-based grouping of this kind has been available in test-reporting tools for some years; language models improve it on messy, free-text errors, where the same cause produces differently worded messages, and can label each cluster in plain language. The output is a short list of clusters, largest first, each with a representative failure.
When to use it
Large automated suites, especially end-to-end and integration runs; nightly runs reviewed in the morning; when infrastructure problems and product bugs fail tests at the same time and need separating; and when the same failure keeps being investigated by different people.
Limitations
Clustering groups by symptom, not cause: two different bugs can produce the same timeout, and one bug can produce several unrelated-looking errors. A cluster label written by a model sounds like a diagnosis and isn't one. Rare failures end up as singletons at the bottom of the list, which is sometimes exactly where the interesting bug is.
Watch for
A new product bug fails with the same timeout as a known environment outage, joins that cluster and is closed with it when the environment is fixed. After closing a cluster, re-run its tests and investigate any that still fail.
What you still own
Investigating each cluster, and checking that the failures in it really share a cause before closing them together.
Cite this
Qlarify Labs. (2026). Failure clustering. Retrieved from https://labs.qlarify.fi/ai-in-testing/failure-clustering


