Two MoTacon attendees are on the left. The MoTaacon logo is in the center, and to the right a prompt to Get Your Ticket.

State leakage

State leakage image
State leakage happens when data, configuration, or system state from one action, test, or user session unintentionally affects another. Instead of starting from a clean and predictable state, behaviour is influenced by something left behind earlier.

This often shows up in tests that pass when run alone but fail when run together. For example, a test might rely on data created by a previous test, a user session might remain active longer than expected, or a cached value might change the outcome of a later action. The system appears inconsistent, even though the logic itself has not changed.

State leakage is risky because it hides real problems. Tests may pass for the wrong reasons, failures may be hard to reproduce, and bugs may only appear in certain orders or environments. This can lead to flaky tests and false confidence in system stability.

Reducing state leakage involves being clear about setup and cleanup, isolating tests where possible, and validating assumptions about system state. When state is controlled and predictable, behaviour becomes easier to reason about and failures become easier to trust.
Explore MoT
Orchestrating Functional Quality at AI Speed image
See how agentic testing workflows help teams deliver faster without sacrificing quality.
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter