liveBook · Manning

Unhappy path

As explained in BDD in Action, Second Edition

An unhappy path scenario is a scenario in which invalid inputs, exceptional conditions, or failures produce behavior other than the normal successful outcome.

An unhappy path describes what happens when invalid inputs, errors, or other failures prevent an actor from achieving the normal goal. It makes the expected consequence explicit instead of merely copying current system behavior, helping teams reconcile expected and actual outcomes. section 14.1.5

Use unhappy paths to make failure behavior visible and verifiable:

  • Include negative variations alongside happy path scenarios rather than attempting to enumerate every possible route through the system. section 14.1.4
  • Describe the consequence in terms of what the actor should experience when the system rejects input or encounters an error. section 14.1.5
  • Use the resulting expectations to identify misunderstood requirements or defects before automating behavior. section 14.1.5

Invalid registration details

A sign-up scenario becomes unhappy when invalid registration details prevent the actor from proceeding to sign-in. Validation rules should activate, the account should remain unregistered, and guidance should explain how to correct the problems. section 14.1.5

Figure 14.9 Visualize both happy and unhappy path scenarios to highlight their different consequences.

Compare happy and unhappy scenarios visually to distinguish their different consequences. section 14.1.5

How BDD in Action, Second Edition covers it

How deep it goes
Defines failure consequences and gives a registration example, but defers exhaustive path coverage and detailed automation implementation.
Examples
Uses invalid sign-up details, form validation, blocked account registration, and corrective guidance as the central example.
What it assumes
Builds on workflows, actors, happy path scenarios, and expected outcomes while keeping path variability within individual features.
What you can do after
Apply it via acceptance tests to specify invalid-input behavior and compare desired outcomes with actual system behavior.
How it connects
Connects unhappy paths with happy paths, acceptance tests, Journey Maps, business rules, and expected-versus-actual behavior.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.