Why do we need Specification by Example?

By Sherry Hsu
Many of the expensive bugs are created in the design phase, by assumptions and implicit requirements. Specification by Example, if done right, is a very powerful tool which is able to align understanding of the requirements between different stakeholders and prevents many expensive bugs from rising. However, it is also one easily misunderstood practice that people take the tools without understanding the process; therefore found the process clumsy, examples hard to understand, tests brittle.
Common Problems with Software development:
> Block to Continuous Delivery: Long regression tests cycle
> Test cases and feature documentation get out of sync
> Agile Development: Shorter iterations and frequent releases. To do so, we want shorter regression test cycle; we want to automate tests; we want to know what features are checked automatically and what require manual attention.
What are the processes involved in Specification by Example?
> 3 Amigos workshop: a conversation between SME (Subject Matter Experts), developers and testers on a feature. By including specific examples of the feature, we make sure 1. the terminology is used and interpreted in the same way and 2. the understanding of the capability and boundary of the features are aligned.
What are the tools involved in Specification by Examples?
> Cucumber, Selenium, a programming language (Ruby, Java etc)
Common Myths
> We should automate all tests
> We need to make the examples clear and map each step to one mouse/keyboard action
> We need to capture the requirements in each Jira ticket in the Given/When/Then examples, including UI designs, components present …etc
Key Points on the Feature Files
> Declarative: Focus on “What” to test, not “How”, so that they are easier to understand
> Express the scenarios in terms of the domain instead of the user interface
> Focus on KEY examples, not all combinations: https://gojko.net/2014/05/05/focus-on-key-examples/
> Avoid Scripts and flows
Related Reading (Richard’s recommendation):
http://specificationbyexample.com/ (book)
http://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off
http://woki/display/OHP/Behaviour+Driven+Development
http://skillsmatter.com/podcast/agile-testing/refuctoring-your-cukes
Course: 
https://peopletech.co.za/courses/specification-by-example/

Related Articles

Responses

Your email address will not be published. Required fields are marked *