BDD and The Feynman Technique
With a slight modification, the Feynman Technique can help you understand your user stories better and produce better acceptance tests.
Join the DZone community and get the full member experience.Join For Free
Nobel Prize winner and accomplished physicist Richard Feynman was renowned for his ability to explain complex subjects.
It was for this reason that he was known by many as “The Great Explainer.”
“If you can’t explain it simply, you don’t understand it enough.” - Albert Einstein/Richard Feynman
Feynman learned by trying to explain things. If he couldn’t explain it simply, he didn’t understand it as thoroughly as he had thought. It is from this that the Feynman Technique for learning emerged:
- Pick a concept — write it at the top of a fresh page in your notebook.
- Pretend to teach it to a student — explain it on paper as if you are teaching it.
- Study it more when you get stuck — keep studying until you can resume explaining it.
- Simplify and use analogies — relate it to things people already understand.
This is what we are doing at a team level when we’re practicing BDD…
If we can’t tell the user story simply, we don’t understand it enough.
The purpose of writing a customer scenario isn’t to produce an artifact or an automated test. The purpose of writing a customer scenario is to drive a conversation, drawing it down to the right level of detail to establish a shared, coherent understanding — to learn together.
If the scenarios that tell variations on a user story can’t be explained simply, we don’t understand the story enough as a team.
Each edit, each refinement we try to make, takes the conversation and our understanding deeper. We gradually get closer to a better understanding of what the customer is trying to achieve and why.
When we can articulate our understanding of a scenario simply and our customer agrees that we’re aligned, that’s a good sign that we understand it enough to take the next step — implementing just enough to see that scenario pass. Now we’re stuck and it’s time to explore the next scenario.
The simpler the scenario, the more the team understands what the customer is trying to do.
The process of reflecting and evolving our understanding in the actual product continues into the process of implementation. Unit-level specs (unit tests) drive the conversation with our pair-programming partner (or mob) — capturing our understanding of how we’ll achieve the outcome we’re looking for — and expressing the way we’ve achieved it through our system metaphor (arguably, XP as a whole is a software development approach analogous to the Feynman Technique).
This process is iterative. There will still be gaps in our understanding — we don’t need it to be perfect the first time, every time. Addressing that is exactly what short cycles and frequent feedback are for.
Published at DZone with permission of Antony Marcano, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.