SlideShare a Scribd company logo
Understanding 
BDD 
& 
TDD 
with 
LEGO 
Kev 
McCabe 
@bigmadkev 
! 
Adapted 
from: 
Bryan 
Beecham 
@BillyGarnet 
Mike 
Bowler 
@mike_bowler 
http://bigmadkev.com/resources
http://bigmadkev.com/resources 
House 
Keeping! 
▪ Please 
have 
your 
phones 
out 
! 
▪ Please 
talk 
and 
have 
side 
conversations 
! 
▪ Please 
Tweet, 
Facebook, 
Blog, 
Rave 
about 
todays 
sessions! 
– 
only 
if 
their 
good 
ones 
Have 
Fun!!!!!!
http://bigmadkev.com/resources 
BDD 
& 
TDD 
▪ BDD 
= 
Behavior 
Driven 
Development 
! 
▪ TDD 
= 
Test 
Driven 
Development
http://bigmadkev.com/resources 
BDD 
& 
TDD 
▪ They 
solve 
separate 
problems 
! 
▪ They 
work 
together 
! 
▪ TDD 
– 
Build 
the 
thing 
right 
▪ Low 
level 
fast 
tests 
! 
▪ BDD 
– 
Build 
the 
right 
thing 
▪ Conversations 
& 
Examples
http://bigmadkev.com/resources 
Thanks 
to 
Nat 
Pryce 
and 
Steve 
Freeman 
for 
im5 age
http://bigmadkev.com/resources 
Thanks 
to 
Nat 
Pryce 
and 
Steve 
Freeman 
for 
im6 age
http://bigmadkev.com/resources 
BDD 
▪ Three 
Amigos 
▪ Tester 
▪ Developer 
▪ Stakeholder 
! 
! 
!
http://bigmadkev.com/resources 
BDD 
User 
stories 
& 
acceptance 
criteria 
Domain 
Learning 
Examples 
ExEaxmampplelses ExEaxmampplelses 
New 
Stories Open 
Questions
http://bigmadkev.com/resources Having 
Conversations 
! 
Is 
more 
important 
than 
capturing 
conversations 
! 
Is 
more 
important 
than 
automating 
conversations 
www.slideshare.net/lunivore/behavior-­‐driven-­‐development-­‐11754474 
Liz 
Keogh 
@lunivore
http://bigmadkev.com/resources BDD IS NOT 
ABOUT THE 
TOOLS! 
! 
IT’S ABOUT THE 
CONVERSATIONS
http://bigmadkev.com/resources 
Agile 
Stories 
As 
a 
<role>, 
I 
want 
to 
<do 
something> 
so 
that 
<I 
get 
some 
value>.
http://bigmadkev.com/resources 
Value 
Agile 
Stories 
In 
order 
to 
<get 
some 
value> 
<role> 
should 
be 
able 
to 
<do 
something>
13
Understanding bdd and tdd with lego
https://speakerdeck.com/jbrains/the-­‐next-­‐decade-­‐of-­‐agile-­‐software-­‐development 
The 
Next 
Decade 
(of 
Agile 
Software 
Development) 
by 
J. 
B. 
Rainsberger
https://speakerdeck.com/jbrains/the-­‐next-­‐decade-­‐of-­‐agile-­‐software-­‐development 
The 
Next 
Decade 
(of 
Agile 
Software 
Development) 
by 
J. 
B. 
Rainsberger
17
http://bigmadkev.com/resources 
Exercise 
-­‐ 
1 
▪ Open 
up 
one 
LEGO 
packet 
each 
! 
▪ Build 
a 
person 
and 
a 
house 
out 
of 
LEGO
http://bigmadkev.com/resources 
Admire 
your 
work 
▪ Take 
a 
photo. 
Upload 
to 
Twitter. 
Brag 
to 
your 
friends
Reference
http://bigmadkev.com/resources 
What 
is 
the 
goal 
of 
TDD? 
▪ It 
creates 
clean 
code 
that 
works 
~ 
Ron 
Jefferies
http://bigmadkev.com/resources 
TDD 
▪ It 
is 
a 
predictable 
way 
to 
develop. 
You 
know 
when 
you 
are 
finished, 
without 
having 
to 
worry 
about 
a 
long 
bug 
trail.
http://bigmadkev.com/resources 
TDD 
▪ It 
gives 
you 
a 
chance 
to 
learn 
all 
of 
the 
lessons 
that 
the 
code 
has 
to 
teach 
you. 
If 
you 
only 
slap 
together 
the 
first 
thing 
you 
think 
of, 
then 
you 
never 
have 
time 
to 
think 
of 
a 
second, 
better 
thing.
http://bigmadkev.com/resources 
TDD 
▪ It 
improves 
the 
lives 
of 
the 
users 
of 
your 
software.
http://bigmadkev.com/resources 
TDD 
▪ It 
lets 
your 
teammates 
count 
on 
you, 
and 
you 
on 
them.
http://bigmadkev.com/resources 
TDD 
▪ It 
feels 
good 
to 
write 
it.
The 
Mantra 
Red 
-­‐ 
Green 
-­‐ 
Refactor 
photo 
from 
doolwind.com
http://bigmadkev.com/resources 
The 
Mantra 
– 
Red 
▪Write 
a 
small 
test 
that 
shows 
the 
code 
doesn’t 
work
http://bigmadkev.com/resources 
The 
Mantra 
– 
Green 
▪ Do 
the 
minimum 
to 
make 
the 
code 
work
http://bigmadkev.com/resources 
The 
Mantra 
-­‐ 
Refactor 
▪ Eliminate 
duplication 
! 
▪ Ensure 
code 
clarity 
! 
▪ Is 
it 
the 
simplest 
it 
could 
be?
http://bigmadkev.com/resources 
You 
won’t 
stay 
agile 
without 
clean 
code 
! 
You 
can’t 
have 
clean 
code 
without 
refactoring 
! 
You 
can’t 
refactor 
without 
good 
automated 
tests
http://bigmadkev.com/resources 
Exercise 
-­‐ 
2 
▪ Build 
a 
person 
and 
a 
house 
with 
TDD
http://bigmadkev.com/resources 
Prepare 
your 
environment 
▪ Clear 
the 
area 
in 
front 
of 
you. 
! 
▪ This 
is 
your 
program. 
! 
▪ The 
perfect 
program!
http://bigmadkev.com/resources 
First 
Test 
▪ Does 
the 
person 
exist? 
! 
▪ No?
Hurray!!! 
We 
failed 
the 
test! 
Celebrate! 
High 
5s!
http://bigmadkev.com/resources 
Minimum 
to 
pass 
the 
test 
▪ Add 
a 
block. 
Can 
that 
be 
a 
person?
http://bigmadkev.com/resources 
Hurray!!! 
▪ The 
person 
now 
exists! 
! 
▪ Not 
very 
impressive 
but 
it 
could 
represent 
a 
person. 
! 
▪ We 
passed 
the 
test! 
We 
are 
rocking 
now!
http://bigmadkev.com/resources 
Refactor 
▪ Remove 
any 
duplication. 
In 
this 
case 
we’re 
good.
http://bigmadkev.com/resources 
Same 
thing 
for 
house 
▪ Is 
there 
a 
house?
http://bigmadkev.com/resources 
Same 
thing 
for 
house 
▪ You 
know 
what 
to 
do 
now 
right?
http://bigmadkev.com/resources 
We 
need 
a 
new 
test 
▪ The 
house 
is 
taller 
then 
the 
person. 
! 
▪ Assert.IsTrue(house.height 
> 
person.height);
Hurray!!! 
-­‐ 
More 
Failure 
The 
person 
is 
the 
same 
size 
so 
we 
fail 
this 
test. 
Well 
done!
Failure 
= 
Learning 
Opportunity 
▪ If 
you’re 
not 
failing, 
you’re 
not 
learning. 
! 
▪ If 
you’re 
not 
learning...
http://bigmadkev.com/resources 
Minimum 
to 
pass 
the 
test 
▪ From 
the 
audience 
this 
time. 
! 
▪ Anyone?
http://bigmadkev.com/resources 
Hurray!!! 
-­‐ 
Success 
▪ Alright, 
we 
passed 
the 
test.
http://bigmadkev.com/resources 
Refactor 
▪ Still 
very 
simple. 
Still 
nice 
and 
clean.
http://bigmadkev.com/resources 
Software 
Requirements 
▪ Software 
must 
do 
three 
things: 
▪ It 
must 
work 
▪ It 
must 
be 
understandable 
▪ It 
must 
be 
updatable
http://bigmadkev.com/resources 
We 
need 
a 
new 
test 
▪ Is 
the 
house 
wider 
then 
the 
person? 
No? 
! 
▪ We 
failed 
another 
test! 
Awesome! 
We 
are 
learning 
a 
lot 
about 
improvements 
that 
are 
needed 
to 
our 
code. 
! 
▪ Let’s 
do 
the 
minimum 
to 
pass 
the 
test. 
! 
▪ Any 
duplication 
to 
remove?
Exercise 
-­‐ 
3 
Partners! 
▪ Break 
into 
groups 
of 
two 
for 
this 
next 
exercise. 
! 
▪ When 
developers 
do 
this 
we 
call 
it 
Pair 
Programming 
! 
▪ Berkley 
photo 
from 
the 
web
http://bigmadkev.com/resources 
Lego 
Sim 
Town 
In 
order 
to 
have 
a 
town 
to 
run 
The 
Mayor 
requires 
A 
small 
town 
comprised 
of: 
! 
A 
family 
A 
house 
A 
tree 
An 
animal 
A 
vehicle
http://bigmadkev.com/resources 
We 
need 
a 
new 
test 
▪ Work 
together 
and 
write 
down 
a 
new 
test 
▪ Build 
minimally 
pass 
the 
test 
▪ Repeat 
(Don’t 
worry 
about 
Refactoring 
for 
now) 
▪ Here’s 
a 
few 
if 
you 
get 
stuck: 
▪ Is 
the 
house 
at 
least 
x 
bricks 
tall? 
▪ Is 
the 
tree 
the 
same 
size 
as 
the 
house? 
▪ Is 
the 
animal 
smaller 
than 
the 
person?
Exercise 
3 
– 
Lego 
Sim 
Town 
▪A 
family 
▪A 
house 
▪A 
tree 
▪An 
animal 
▪A 
vehicle 
▪ Is 
the 
house 
at 
least 
x 
bricks 
tall? 
! 
▪ Is 
the 
tree 
the 
same 
size 
as 
the 
house? 
! 
▪ Is 
the 
animal 
smaller 
than 
the 
person?
http://bigmadkev.com/resources 
Non-­‐TDD 
Solution 
53
http://bigmadkev.com/resources 
Review 
▪ Test-­‐Driven 
Development 
/ 
Design 
▪ Refactoring 
▪ Pair 
Programming 
▪ A 
bit 
of 
developer 
speak 
▪ Experience 
working 
on 
a 
software 
team
http://bigmadkev.com/resources
http://bigmadkev.com/resources 
Four 
Elements 
of 
Simple 
Design 
▪ Passes 
its 
tests 
! 
▪ Minimizes 
duplication 
! 
▪ Maximizes 
clarity 
! 
▪ Has 
fewer 
elements
http://bigmadkev.com/resources 
Closing 
Circle 
▪ What 
did 
you 
learn 
today? 
! 
▪ What 
surprised 
you 
today? 
! 
▪ What 
will 
you 
do 
differently 
in 
the 
future?

More Related Content

KEY
Jon Crawford: Entrepreneurship on Rails
PDF
Just Enough Web Development: An Introduction!
PDF
DjangoCon09: No! Bad Pony!
PPT
5 truths-new
PDF
How to Get Your Idea Built
PDF
SEO and Accessibility
PDF
The Secret Life of a Flash Freelancer
PPTX
Project Management 101 - Wordcamp TO 05112011
Jon Crawford: Entrepreneurship on Rails
Just Enough Web Development: An Introduction!
DjangoCon09: No! Bad Pony!
5 truths-new
How to Get Your Idea Built
SEO and Accessibility
The Secret Life of a Flash Freelancer
Project Management 101 - Wordcamp TO 05112011

Similar to Understanding bdd and tdd with lego (20)

PDF
Software craftsmanship
PDF
Pownce Lessons Learned
PPTX
Managing Tech Teams
PDF
Starting Your First Job in the Software Industry: Tips and Tricks from Nakov
PDF
Adopting technical practices 2013
PDF
Seven ways to be a happier JavaScript developer - NDC Oslo
PDF
Christian Heilmann - Seven Things to Do to Make You a Happier JavaScript Deve...
PPTX
Do we know our data, as good as we know our tools
PPTX
Bringing Open-Source Practices to Your Day Job
PPTX
With Great Power comes Great Responsibilities
PPTX
Usability Testing: Targeting Mobile Devices
PDF
Why the h# should I use Appium with React Native
PPTX
Designer As Founder: Class One Intro to Lean Startup & Business Model Generation
PDF
What is quality code? From cruft to craft
PDF
Talking about craftsmanship with ensaimadas and katas
PPTX
SharePoint Framework 101 (SPFx)
PDF
Writing a Ruby Gem for beginners
PDF
Five ways to be a happier JavaScript developer
PDF
VRDC 2016 Talk: Kite & Lightning's VR Production Workflow
PDF
2017 Microservices Practitioner Virtual Summit: How to Avoid Creating a GitHu...
Software craftsmanship
Pownce Lessons Learned
Managing Tech Teams
Starting Your First Job in the Software Industry: Tips and Tricks from Nakov
Adopting technical practices 2013
Seven ways to be a happier JavaScript developer - NDC Oslo
Christian Heilmann - Seven Things to Do to Make You a Happier JavaScript Deve...
Do we know our data, as good as we know our tools
Bringing Open-Source Practices to Your Day Job
With Great Power comes Great Responsibilities
Usability Testing: Targeting Mobile Devices
Why the h# should I use Appium with React Native
Designer As Founder: Class One Intro to Lean Startup & Business Model Generation
What is quality code? From cruft to craft
Talking about craftsmanship with ensaimadas and katas
SharePoint Framework 101 (SPFx)
Writing a Ruby Gem for beginners
Five ways to be a happier JavaScript developer
VRDC 2016 Talk: Kite & Lightning's VR Production Workflow
2017 Microservices Practitioner Virtual Summit: How to Avoid Creating a GitHu...
Ad

More from ColdFusionConference (20)

PDF
Api manager preconference
PDF
PDF
Building better SQL Server Databases
PDF
API Economy, Realizing the Business Value of APIs
PDF
Don't just pdf, Smart PDF
PDF
Crafting ColdFusion Applications like an Architect
PDF
Security And Access Control For APIS using CF API Manager
PDF
Monetizing Business Models: ColdFusion and APIS
PDF
Become a Security Rockstar with ColdFusion 2016
PDF
ColdFusion in Transit action
PDF
Developer Insights for Application Upgrade to ColdFusion 2016
PDF
Where is cold fusion headed
PDF
ColdFusion Keynote: Building the Agile Web Since 1995
PDF
Instant ColdFusion with Vagrant
PPT
Restful services with ColdFusion
PDF
Super Fast Application development with Mura CMS
PDF
Build your own secure and real-time dashboard for mobile and web
PDF
Why Everyone else writes bad code
PDF
Securing applications
PDF
Testing automaton
Api manager preconference
Building better SQL Server Databases
API Economy, Realizing the Business Value of APIs
Don't just pdf, Smart PDF
Crafting ColdFusion Applications like an Architect
Security And Access Control For APIS using CF API Manager
Monetizing Business Models: ColdFusion and APIS
Become a Security Rockstar with ColdFusion 2016
ColdFusion in Transit action
Developer Insights for Application Upgrade to ColdFusion 2016
Where is cold fusion headed
ColdFusion Keynote: Building the Agile Web Since 1995
Instant ColdFusion with Vagrant
Restful services with ColdFusion
Super Fast Application development with Mura CMS
Build your own secure and real-time dashboard for mobile and web
Why Everyone else writes bad code
Securing applications
Testing automaton
Ad

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Nekopoi APK 2025 free lastest update
PDF
Digital Strategies for Manufacturing Companies
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
System and Network Administration Chapter 2
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
AI in Product Development-omnex systems
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ai tools demonstartion for schools and inter college
wealthsignaloriginal-com-DS-text-... (1).pdf
Odoo POS Development Services by CandidRoot Solutions
PTS Company Brochure 2025 (1).pdf.......
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Nekopoi APK 2025 free lastest update
Digital Strategies for Manufacturing Companies
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
System and Network Administration Chapter 2
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
AI in Product Development-omnex systems
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Wondershare Filmora 15 Crack With Activation Key [2025
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Understanding bdd and tdd with lego