Ask five people on a game team whether a feature is done and you’ll get five answers:
- The programmer says yes: the code is merged.
- The designer says almost: it doesn’t feel right yet.
- QA says no: two bugs are still open.
- The producer says it was done last sprint, so why is it on the board again?
- The lead opens the editor to find out.
Nobody is wrong. They’re each answering a different question, because “done” was never written down in a form everyone could check. This article is about fixing that, using an approach the wider software industry has refined for two decades, and about how ZagalaSpec brings it into Unreal Engine.
TDD, BDD and ATDD in four paragraphs
Test-driven development (TDD), popularised by Kent Beck, is a design habit: write a test describing the behavior you want, watch it fail, make it pass, then clean up. Red, green, refactor.
Behavior-driven development (BDD), introduced by Dan North, gives those tests a shape everyone can read: Given a situation, When something happens, Then this is observable.
Acceptance test-driven development (ATDD) applies the same loop one level higher. Before a feature is built, the people who want it and the people who build it agree on concrete examples of it working. Those examples become the acceptance criteria, and they’re automated. Gojko Adzic calls the practice Specification by Example.
The point of ATDD isn’t the tests. It’s the conversation that produces them, and the fact that its output can be executed.
From conversation to scenario
Ron Jeffries describes a user story as three things: a card (a short reminder of the need), a conversation (where the details are worked out) and a confirmation (how we’ll know it works). Most studios do the first two and lose the third in meeting notes.
ATDD makes the confirmation a deliverable. Take a door that needs a key:
Feature: Locked doors
As a player, I want locked doors to need the right key,
so that exploring the level rewards finding keys.
Scenario: The right key opens the door
Given a door locked with the "Red" key
And the player carries the "Red" key
When the player interacts with the door
Then the door opens
Scenario: The wrong key keeps it shut
Given a door locked with the "Red" key
And the player carries the "Blue" key
When the player interacts with the door
Then the door stays closed
And the player is told the door needs the "Red" key
A designer can write this. A producer can read it. QA can spot the missing case (“what if the player has no key at all?”). A programmer can implement against it. And in ZagalaSpec, once each sentence is connected to the game, every scenario is an automation test.
Writing scenarios that age well
Good scenarios follow INVEST, a checklist coined by Bill Wake for user stories:
- Independent. Each scenario sets up its own state and can run alone, in any order.
- Negotiable. It describes an outcome, not an implementation, so it can change when the design changes.
- Valuable. It matters to a player, a designer or the business.
- Estimable. The team can say roughly how big it is.
- Small. One behavior per scenario, done in a short time.
- Testable. It’s only finished when it passes.
The most common mistake is writing how instead of what:
| Avoid (imperative, implementation-level) | Prefer (declarative, product-level) |
|---|---|
When I call UDoorComponent::TryOpen with KeyId 3 |
When the player interacts with the door |
Then bIsOpen is true |
Then the door opens |
Given I spawn BP_Door at 0,0,0 and set LockType to 2 |
Given a door locked with the "Red" key |
The left column breaks the moment someone renames a function. The right column keeps working through refactors, because the translation from sentence to engine lives in one place below it. Part 5 of this series covers that layer.
Who does what in a studio
ATDD isn’t “programmers writing more tests”. Each discipline has a clear job:
- Designers own the intent. They write or co-write the scenarios, especially the edge cases they care about.
- Producers use scenarios as the definition of done and as status. A feature with 8 of 10 scenarios green is a fact, not a feeling.
- QA turn their test plans into scenarios and spend their manual time on exploratory testing, where people beat scripts.
- Programmers connect sentences to the game once, and reuse those steps across features.
- Tech leads guard the step vocabulary and the architecture, and make the scenarios a gate in CI.
The ZagalaSpec docs call the person in the middle, usually a technical designer or QA engineer, the configurator: they make sure every sentence is understood by an existing step and fill in the values, without writing code.
“Is it done?” becomes “is it green?”
Once scenarios run, status stops being an opinion:
- Each scenario is one line in the Session Frontend and in the CI report, named after its identifier, for example
Features.MyGame.Features.Doors.WrongKeyKeepsItShut. - Red is falsifiable. A failing scenario means the feature, as agreed, isn’t releasable. It comes with a reason the step author wrote in product terms, such as the door opened with the “Blue” key.
- Green is honest about its limits. It means the agreed examples pass, nothing more. The game can still have bugs nobody wrote a scenario for.
- Bugs become scenarios. When QA finds a bug, the first fix is a scenario that reproduces it. If it ever comes back, the scenario catches it.
Work in progress doesn’t have to break the build either: untick Include In Tests on a scenario until it’s ready.
Running your first specification workshop
You don’t need a process overhaul to start. Try this on the next feature that’s about to be built:
- Pick one feature with a history of misunderstandings or regressions.
- Book 45 minutes with one designer, one programmer and one QA person (the “three amigos” format, popularised by George Dinwiddie).
- List examples, not rules. “What happens when…?” is the most useful question in the room.
- Write 3 to 6 scenarios in Given / When / Then. Stop when new examples stop teaching you anything.
- Name the missing cases and decide which are in scope now.
- Commit the scenarios as a ZagalaSpec feature, through the Feature Editor or by importing the text file. They’re red until the steps exist. That’s expected: you now have a backlog you can run.
The first workshop feels slow. By the third, the team writes scenarios during the kickoff and the “is it done?” conversation shrinks to a glance at a test list.
Next in the series
Part 3 takes you from installing ZagalaSpec to running, breaking and writing your first executable specification, without writing any code. Start from the series overview if you missed it, or read the concepts page in the documentation for the full model.