State Transition Testing is a black-box technique for systems whose behavior depends on their current STATE and the events that move between states. You model states, transitions, events, and actions, then design tests for valid and invalid transitions.
You draw a state transition diagram (or table): states (e.g. Logged Out, Logged In, Locked), events (login, wrong password x3, logout), and the resulting transitions/actions. Tests cover valid transitions (login → Logged In), invalid ones (can you jump states illegally?), and sequences (3 wrong passwords → Locked). It's ideal for workflows, account lifecycles, order status, and any system with modes. It catches bugs where the system allows an illegal transition or mishandles an event in a given state. A powerful technique for stateful features and a strong senior-level answer.
An account lockout: Active → (3 failed logins) → Locked → (admin unlock) → Active. Tests verify the lock happens exactly at the 3rd failure and that a locked account rejects even correct credentials until unlocked.
A user account locks after 3 failed logins and unlocks only via admin. What technique tests this and what transitions do you check?