Image for Given-When-Then format

Given-When-Then format

The Given-When-Then format is a way to clearly describe how a feature or system should work, often used in software development. "Given" sets the initial context or conditions, "When" describes the action or event that occurs, and "Then" explains the expected result or outcome. It helps teams understand what needs to happen in specific situations, making it easier to test and ensure the system behaves correctly. Think of it as a structured way to outline a scenario: starting with the setup, then the trigger, and finally the expected response.