Do you want to learn the basics of ATDD/BDD so that you can ensure clear
communications between business and development?
Do you want to go beyond building to a specification, and build what is
valuable instead?
Agile teams often relied on user stories and acceptance criteria alone. Then more advanced teams started doing TDD (Test Driven Development) so that developers could build what they thought the business asked for. When it became clear that TDD was not enough, ATDD (Acceptance Test Driven Development) / BDD (Behaviour Test Driven Development) became popular, as they provide a common language for business and development.
But building what the business wanted is not enough!
With HDD (Hypothesis Driven Development), we can test our business case, just like we test our code. When we find that results don’t match our expectation, we adjust our business case to get better business results.
In this presentation, we'll create several examples in ATDD/BDD and then extend out to the business case level with HDD.
How AI, OpenAI, and ChatGPT impact business and software.
An Intro to ATDD/BDD and HDD: Get What You Need, Not What You Ask For!
1. Get What You Need,
Not What You Ask For!
An Intro to ATDD/BDD and HDD
David Bulkin
David.Bulkin@LitheSpeed.com
2. About Me
David Bulkin
VP Training Services LitheSpeed
+1.215-764-6822
David.Bulkin@lithespeed.com
@davidbulkin
www.LitheSpeed.com
www.linkedin.com/in/davidbulkin
8. TDD
Developer builds what she thinks the
business explained.
1. Write a failing test
As a bonus, get a
better design and
automated unit
testing.
Red
1. Write a
failing test
Refactor
3. Make code better
Green
2. Make code work
9. ATDD/BDD
Use shared language to build what
the business really requested.
As a bonus get
automated
acceptance test
10. HDD
Use shared language
to better understand
what is really needed.
Learn and pivot
for real success!
1. Develop a Business Plan
Case
Learn
Ideas
Data
Build
Code
Measure
3. Adjust the Business
Goals & Approach
2. Deliver Working
System
12. Example: We’re developing an early, basic,
consumer calculator.
It’s 1972, the year of the last Apollo
mission to the moon.
7
8
9
4
5
6
1
2
3
+
0
=
Clear
13. Calculator Constraints
• 8 bits
7
8
9
4
5
6
1
2
3
+
0
=
Clear
• Can store 0 to 255.
• Unsigned, meaning that it
cannot handle negative
numbers.
• Handles only plus and minus
operations.
14. With this calculator, the user can:
•
•
•
•
Enter a number
Enter an operand
(plus or minus)
Enter another
number
Press the “=“ to
calculate
For example,
12 + 10 = 22
14 + 3 = 17
10 – 8 = 2
12
7
4
1
8
75
42
9
+
69
8
3 610
75 8 9 =
+ 1- 42*53 8 9
7 6
Cle
22
=2 5 6
ar + 1- 4*73 8 9
Cl
=2 3
ear+ 1 4* 5 6
Cl
ear
+ = 2* 3
1Cl
0
ear+ = =
Clear
15. Let’s create simple tests for the results
that do the following:
• Ensure math is correct
• Check boundaries
• Test for results our calculator
can’t handle
• Checking only for valid
sequence of input:
1. Number
2. Operand (+ or -)
3. Number
4. Equals
7
8
9
4
5
6
1
2
3
+
0
-
Clear
=
16. What I mean by valid sequence of input:
7
8
9
4
5
6
1
2
3
+
0
=
Clear
Not worried about:
• + +
• 12 - - 10
• etc.
Just valid entry sequence
to test math:
12 + 10 = 22
17. Let’s create a test of the math, assuming valid
input, and checking the boundaries of what our
calculator can handle.
Number (A)
0
Operand
+
Number (B)
0
Result?
0
18. Let’s create a test of the math, assuming valid
input, and checking the boundaries of what our
calculator can handle.
Number (A)
0
0
1
Operand
+
+
+
Number (B)
0
1
254
Result?
0
1
255
19. Now that I got
you started, do
some more
examples…
20. Let’s create a test of the math, assuming valid
input, and checking the boundaries of what our
calculator can handle.
Number (A)
0
0
1
1
255
1
1
Operand
+
+
+
+
-
Number (B)
Result?
0
1
254
255
254
0
2
0
1
255
ERR
1
1
ERR
26. A ticket to Agile Land:
Agile Land Theme Park
Admit One – Ages 3 to 103
• Valid 364 Days a Year (not valid on Christmas)
• Valid for standard park opening and closing times of
9:00 AM to 9:00 PM
• Valid for one child, 3 and up, or adult
• Provides free access to most park rides
and attractions, some attractions are
additional.
27. Approximately 1,000 tickets sold and
used each month
1060
1040
1020
1000
980
960
940
920
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
30. Solution Quantity Discount Story:
As a member of a sizable
group
I want to purchase large
blocks of one day passes
So that I can get quantity
discounts and save money
31. Acceptance Criteria Pricing
q
q
q
Purchase <= 50 tickets at $50.00
each, from 1 to 50 inclusive
Purchase 51 to 100 tickets at $40.00
each, from 1 to 100 inclusive
Purchase 101 or more tickets at $30.00
each, from 1 to infinity
33. <= 50 tickets at $50.00 each, from 1 to 50 inclusive
51 to 100 tickets at $40.00 each, from 1 to 100 inclusive
101 or more tickets at $30.00 each, from 1 to infinity
Count
Price Each
Total?
0
$50
$0
1
$50
$50
35. <= 50 tickets at $50.00 each, from 1 to 50 inclusive 51 to 100
tickets at $40.00 for all tickets, from 1 to 100 inclusive 101 or
more tickets at $30.00 each for all tickets, from 1 to infinity
Count
Price Each
Total?
0
$50
$0
1
$50
$50
50
$50
$2,500
51
$40
$2,040
100
$40
$4,000
101
$30
$3,030
36.
37. We bridged the gap of
understanding,
but…
Didn’t deliver value!
(We verified but didn’t
validate.)
38. Let’s Fix Our Acceptance
Criteria…
Acceptance Criteria Pricing
q
Purchase <= 50 tickets at $50.00 each,
from 1 to 50 inclusive
q
q
Purchase 51 to 100 tickets at $40.00
each, from 1 to 100 inclusive
Purchase 101 or more tickets at $30.00
each, from 1 to infinity
39. Acceptance Criteria Pricing
q Purchase <= 50 tickets at $50.00
each, from 1 to 50 inclusive
q Purchase 51 to 100 tickets at $40.00
each, for tickets 51 to 100 inclusive
q Purchase 101 or more tickets at $30.00
each, for tickets 101 to infinity
57. In Summary
•
User stories and acceptance criteria are easily
misunderstood, so support them with testable
examples.
•
Our business rules are not always well thought
out, so use testable examples to question,
identify, and fix bad rules
•
We often don’t understand the business impact
of what we build, so question & prove
assumptions with HDD, realign & pivot as
necessary!
58. Said Another Way…
TDD: Developer building what he/she thinks the
business wants is not enough!
ATDD/BDD: Getting on the same page about what
to build is good, and questioning what you agreed
to with ATDD/BDD is incredibly helpful,
but…