See how BDD, UCD and DDD can be brought together to help you create fast, actionable, scalable and trustworthy acceptance test suites that run in milliseconds, provide visibility for both technical and business audience and help you test-drive the development of your products at the system scale.
8. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
9. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
before? after?
10. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
BDD
regression
testing
limited testing opportunities
UI-heavy
slow and “flaky”
verify, don’t validate
testability built in
business-focused
validate and verify
VS
11. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
BDD
Scenario: Connie looks for the next train
Given Jubilee line trains leave Canary Wharf at 16:59, 17:01
When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Then she should be told about the train at 17:01
12. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
BDD
Scenario: Connie looks for the next train
Given Jubilee line trains from Stratford leave Canary Wharf at 16:59, 17:01
When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Then she should be told about the train at 17:01
13. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
BDD
Scenario: Connie looks for the next train
Given Jubilee line trains from Stratford leave Canary Wharf at 16:59, 17:01
When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Then she should be told about the train at 17:01
14. serenity-js.org#SerenityJS @JanMolak
Find the fastest route
As a commuter,
I’d like to know the fastest route between two stations,
So that I get to my destination as quickly as possible
BDD
Scenario: Connie looks for the next train
Given Jubilee line trains from Stratford leave Canary Wharf
↪ at 16:59, 17:01, 17:03, 17:09, 17:11
When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Then she should be told about the trains at 17:01, 17:03, 17:09
15. serenity-js.org#SerenityJS @JanMolak
“44-80%
of all software defects are caused by unclear,
ambiguous or incorrect requirements
sources:
- 44% - “Out of Control - Why Control Systems Go Wrong and How to Prevent Failure”
- 56% - “An Information Systems Manifesto”
- 80% - “Requirements: A quick and inexpensive way to improve testing”
29. serenity-js.org#SerenityJS @JanMolak
System under test
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Web
Interface
REST
Interface
Domain
Services
actors interactions interfaces business logic
30. serenity-js.org#SerenityJS @JanMolak
System under test
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Web
Interface
REST
Interface
Domain
Services
actors interactions interfaces business logic
business logic adapters
31. serenity-js.org#SerenityJS @JanMolak
System under test
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Web
Interface
REST
Interface
Domain
Services
actors interactions interfaces business logic
32. serenity-js.org#SerenityJS @JanMolak
System under test
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Web
Interface
REST
Interface
Domain
Services
actors interactions interfaces business logic
33. serenity-js.org#SerenityJS @JanMolak
System under test
Carrier 12:00 PM
Page Title
http://www.domain.com Google
Web
Interface
REST
Interface
Domain
Services
actors interactions interfaces business logic
42. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Open the
Journey
Planner
Choose
origin
Choose
destination
Choose time
of departure
Confirm
selection
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
tasks
43. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Open the
Journey
Planner
Choose
origin
Choose
destination
Choose time
of departure
Confirm
selection
Enter
“Canary
Wharf”
Pick
the first
suggestion
Press
[Arrow
Down]
Press
[Enter]interactions
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
tasks
44. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Open the
Journey Planner
Choose
origin
Choose
destination
Choose time
of departure
Confirm
selection
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
tasks
PlanAJourney.from(‘Canary Wharf’)
.to(‘Waterloo’)
.departingAt(‘17:00’)
45. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Open the
Journey Planner
Choose
origin
tasks
OpenTheJourneyPlanner()
ChooseOrigin.of(‘Canary Wharf’)
ChooseDestination.of(‘Waterloo’)
ChooseTime.ofDeparture(‘17:00’)
ConfirmSelection()
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
PlanAJourney.from(‘Canary Wharf’)
.to(‘Waterloo’)
.departingAt(‘17:00’)
Choose
destination
Choose time
of departure
Confirm
selection
46. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Send GET
request
Request.get(‘https://api.tfl.gov.uk/
↪ Journey/JourneyResults/
↪ Canary%20Wharf/to/Waterloo
↪ ?time=1700’)
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
tasks
PlanAJourney.from(‘Canary Wharf’)
.to(‘Waterloo’)
.departingAt(‘17:00’)
47. serenity-js.org#SerenityJS @JanMolak
scenario decomposition
Send domain
event
JourneyPlanner.find({
origin: ‘Canary Wharf’,
destination: ‘Waterloo’,
departing_at: ’17:00’
});
step When Connie wants to travel from Canary Wharf to Waterloo at 17:00
Plan a journeygoal
actor Connie
PlanAJourney.from(‘Canary Wharf’)
.to(‘Waterloo’)
.departingAt(‘17:00’)
tasks
65. serenity-js.org#SerenityJS @JanMolak
actor
System under test
Web
Interface
REST
Interface
Domain
Services
scenarios
find next train
tasksfeatures
journey
planner
offline map
service
disruption
notifications
capabilities
plan a
journey
online
74. serenity-js.org#SerenityJS @JanMolak
key benefits
Focus
on the user journey
and a common
business vocabulary
Scales well
to teams with
varying levels of
experience
Good design
principles
leading to lower
maintenance costs
Code reuse
within and across
teams and projects