All glossary terms

AI test maintenance

AI test maintenance is the use of AI to keep an automated test suite working as the application under test changes. Instead of an engineer editing broken scripts after every release, models detect what moved in the interface or API, repair the affected steps, and flag the failures that point at real defects.

Automated suites don't decay because the tests were written badly. They decay because software moves. A selector gets renamed, a field is added to a form, a payload changes shape, and a test that passed on Friday fails on Monday for reasons that have nothing to do with a bug. On a large suite this becomes a standing tax: teams routinely spend more hours repairing tests than writing new ones, and coverage stops growing because everyone is busy keeping what exists alive.

AI test maintenance attacks that tax directly. When a step fails, the system compares the current state of the application against what the test expected and works out whether the target simply moved. It looks at more than one signal, the element's text, its position, its role on the page, its neighbors, the history of how it's been identified before, and picks the best match. If it finds one with enough confidence, it repairs the step, continues the run, and records what it changed. If it doesn't, the test fails, which is what you want, because that's the case where something is genuinely broken.

The interesting part is the second half: separating noise from signal. A suite where 80 percent of failures are maintenance artifacts trains people to ignore red builds. Cutting those artifacts out means the failures that remain are worth reading. Maintenance work doesn't disappear, though. It changes from editing code to reviewing what the system decided, and teams still have to check that a repaired test asserts the thing it was written to assert. See also what happens after every commit, which is where the cost of a brittle suite shows up first.


How it works

  • A run detects a failed step and captures the state of the application at that moment rather than stopping immediately.
  • The system scores candidate elements against several attributes, not one selector, so a renamed ID doesn't sink the whole test.
  • Repairs above a confidence threshold are applied mid-run; anything below it is left to fail and surface for review.
  • Every change is logged, so an engineer can see what was swapped and approve or reject it.
  • Failures are triaged into likely defects and likely drift, which is what keeps a red build meaningful.

Where you'll see it

  • Teams shipping weekly or daily, where a UI refactor would otherwise break dozens of tests at once.
  • Long-lived regression suites that have accumulated years of hand-written selectors nobody wants to touch.
  • Migrations, where an old Selenium or Cypress suite is being moved onto a platform that repairs itself instead of breaking.
  • Small QA functions maintaining a suite far larger than the headcount would normally support.

Benefits and challenges

BenefitChallenge
Engineering hours move from repairing scripts to widening coverage. A confident repair can mask a real bug, so healed steps need review rather than blind trust.
Fewer false failures, which makes the remaining red builds worth investigating. Tuning the confidence threshold takes a few release cycles before a team trusts where it sits.
Suites survive UI refactors that would previously have meant a week of rework. It repairs how a test finds things, not what a test checks. An assertion that no longer matches the product still has to be rewritten by a person.
The cost of a large suite stops scaling with the number of tests in it. Audit trails matter in regulated environments, and a system that changes tests silently isn't acceptable there.

Frequently asked questions

Is AI test maintenance the same as self-healing tests?

Self-healing is the mechanism, AI test maintenance is the broader practice. Healing repairs a step during a run. Maintenance also covers triaging failures, spotting tests that have gone stale, and deciding which ones need a person. You can read how Klarent handles the healing side in the self-healing runs documentation.

Won't automatic repairs hide real bugs?

They can, which is why the confidence threshold and the change log matter. A step should only be repaired when the evidence says the element moved, not when the behavior changed. Anything ambiguous is better off failing, and every applied repair should be visible for someone to check.

Does it work on an existing test suite?

It depends on the tool. Some platforms apply healing only to tests authored inside them, others can wrap an existing suite. Teams usually migrate the most brittle, highest-value tests first rather than moving everything at once.


How Klarent helps

Klarent's agents repair tests during a run when the application's interface or API has shifted, and record what changed so a QA engineer reviews the decision instead of rewriting the script. It's part of the same lifecycle as AI test automation, not a separate step bolted on afterwards.


Ready to eliminate QA bottlenecks? Talk to our team for a personalised walkthrough.

Book a free 30 minute call