Post on 20-May-2020
transcript
Emily Bache, Bache Consulting & Pagero
Readable, Executable Requirements: Hands-On
@esconfs#esconfs
Insert speaker picture here, no more than 150x150 pixels
Agile Requirements
User Story Conversation+ Example+
From “Agile Testing” by Crispin, Gregory
Requirement=
3
ATDD vs BDD vs Spec by Example?
Where we choose to call it BDD or ATDD or Specification by Example, we want the same result – a shared common understanding of what is to be built to try to build the ‘thing’ right the first time.
-- Janet Gregory
http://janetgregory.blogspot.se/2010/08/atdd-vs-bdd-vs-specification-by-example.html 4
Thought LeadersATDD:◦ Janet Gregory, Lisa Crispin, Markus Gärtner
Specification by Example:◦Gojko Adzic, David Evans
BDD:◦Liz Keogh, Dan North, Chris Matts
5
TDD inner & outer loops
from “Growing Object Oriented Software, Guided by Tests” by Freeman, Pryce
Write a failing unit test
make the test passrefactor
Write a failing acceptance test
6
TDD won’t help you if...
You don’t know what problem to solve
Write a failing unit test
make the test passrefactor
7
TDD is less useful if... you tend to have a lot of integration errors
8
Write a failing unit test
make the test passrefactor
TDD inner & outer loops
from “Growing Object Oriented Software, Guided by Tests” by Freeman, Pryce
Write a failing unit test
make the test passrefactor
Write a failing acceptance test
9
Where does this come from?
Agile Requirements
User Story Conversation Example
Requirement
+ +
From “Agile Testing” by Crispin, Gregory
=
10
Example => Acceptance Test
Features + User Stories
User Story: A slice through a feature that can be built in 1-2 days
FeatureAs a <stakeholder>I want <feature>So that <benefit>
11
Business Analyst
Agile Requirements
User Story Conversation Coaching Test
Requirement
+ +
From “Agile Testing” by Crispin, Gregory
=
12
Conversation: combine perspectives
Developer
Business AnalystTester
“The Three Amigos”
+ other stakeholders
13
A Feature has many Scenarios
ScenarioGiven <assumption>When <event>Then <outcome>
14
FeatureAs a <stakeholder>I want <feature>So that <benefit>
ScenarioGiven <assumption>When <event>Then <outcome>
Discovering Scenarios
Developer
Business AnalystTester
“The Three Amigos”
+ other stakeholders
Scenarios are concrete examples
discovered through conversation
15
Feature & Scenario
Feature: Free DeliveryAs an online retailerI want to offer free delivery to customers who place larger ordersSo that customers spend more money on our siteScenario: Customer qualifies for Free DeliveryGiven my shopping basket contains 550:- of goodsWhen I place an orderThen I am offered free delivery
16
Discover Scenarios in Conversation
Feature: Free Delivery
Scenario: Order is large enough
Scenario: Order total is too low
Scenario: VIP Customer
Scenario: Customer chooses express delivery instead
Scenario: Customer has bad payment history
Scenario: Customer lives overseas
As an online retailerI want to offer free delivery to customers who place larger ordersSo that customers spend more money on our site
Order total Destination Free delivery?500:- Sweden yes499:- Sweden no500:- Norway yes500:- France no
Table format
Deliberate Discovery
Developer
Business AnalystTester
Bugs often come from missed scenarios
19
Is there another context in which this event will create a different outcome?
Is this the only outcome that matters?
Agile Requirements
User Story Conversation Examples
Requirement
+ +
From “Agile Testing” by Crispin, Gregory
=
20
A comprehensive regression test suite?
Having the conversation is the most important thing
write down the scenarios you need to remember
automate the important ones
Automation should make things easier to change, not harder!
21
Developer
Business AnalystTester
Write Code
Code & unit tests Scenarios automated as functional tests
Testers
Collaborate
Developers
22
Scenario -> Regression test
BEFORE code is written, it’s a requirement specification
AFTER code is written it’s a regression test
Important to preserve the language & format
23
Living Documentation
When the code “works”
Developer
Business AnalystTester
“The Three Amigos”
+ other stakeholders
Close the feedback loop Check scenarios, do manual testing
Continue to run automated regression tests
24
Using Cucumber
Feature
System Under Test (SUT)
Step Definitions
http://cukes.info
Exercise: FizzBuzz
Press “Start”Note your animal
26
http://54.228.126.85/?id=A7F4BF65F2
FizzBuzz - solution
http://54.228.126.85/?id=CBF012F624
27
Exercise: Gilded Rose
Existing System Complicated existing Requirements New Requirement
GildedRose - solution
http://54.228.126.85/?id=DC3E0B2C26
29
Exercise: Gilded Rose
Press “Start”Note your animal
30
http://54.228.126.85/?id=BD2E43F85E