SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Being Test-Driven
It’s not really about testing
Raj Indugula George Lively
Raj.Indugula@lithespeed.com George.lively@lithespeed.com
Twitter: @lithespeed
2
What is the point of
test-driven
development?
• Driving Common Understanding
with Behavior Driven Development
• Driving Better Design with Test-
Driven Development
• Tying it all together
• Q&A
Outline
“The speed of
development is the
speed of getting an
idea from one brain to
another”
– Alistair Cockburn
3
BDD IS BUILDING
THE RIGHT THING
Behavior-Driven Development (BDD)
Behavior Driven Development (BDD)
5
Collaboration and
conversation to
discover essential
requirements and
identify uncertainty
Using rules & examples
Expressed in a common
language to build a
shared understanding
To deliver software that
matters
Behavior Driven Development (BDD)
6
Collaboration and
conversation to
discover essential
requirements and
identify uncertainty
Using rules &
examples
Expressed in a
common language to
build a shared
understanding
To deliver software that
matters
HAVE
CONVERSATIONS
BEFORE
WRITING CODE
BDD IS THE ART
OF USING RULES
& EXAMPLES IN
CONVERSATIONS
TO ILLUSTRATE
BEHAVIOR
8
9
Different Viewpoints,
Shared Understanding
9
Business, Developer, Tester
Shared understanding
All agree it is ready to be
implemented
THREE AMIGOS
9
Example Mapping, Matt Wynne
Depositor can
withdraw cash
Limited by
amount on
deposit
Subject to daily
and transaction
limits
Scenario with
sufficient
funds
Limited by daily
limit of $500
What is the
transaction
limit?
Cash is dispensed in
$10 increments with
$20 bills favored
Scenario with
insufficient
funds
Fully stocked scenario
when withdrawal of
$50 results in 2 $20
bills and 1 $10 bill
When out of $20s,
withdrawal of $50
results in 5 $10 bills
Acceptance
Scenarios
Acceptance
Criteria
10
CAPTURE THE
CONVERSATIONS TO DRIVE
DEVELOPMENT
11
Feature: ATM withdrawals
Our ATM allows depositors to withdraw their funds in cash
Rules:
Withdrawals are limited by amount on deposit
Withdrawals are subject to daily and transaction withdrawal limits
Cash is dispensed in $10 increments with $20 bills favored
Scenario: Sufficient funds allows successful withdrawal
Given a depositor has $2000 on deposit
When the depositor requests $200
Then the ATM dispenses $200
And the depositor’s balance is reduced to $1800
…
DocumentationHuman readable Structured and
keyword-based
Allows automation
Gherkin
12
AUTOMATE SPECIFICATIONS
AS NEEDED
Test
Framewor
k
Integratio
n
Gherkin
Scenarios
Specification
expressed in
common
language
Step
Definitions
“Glue” code
that ties
specification to
System under
Test
Cucumber,
SpecFlow, etc.
13
HAVING
CONVERSATIONS
>>
CAPTURING
CONVERSATIONS
>>
AUTOMATING
CONVERSATIONS
Liz Keogh
Test-Driven Development (TDD)
TDD IS BUILDING
THE THING RIGHT
Reimagine our thinking…
15
How we typically
write tests…
1. Think about
implementation
2. Write code (fields &
methods)
3. Write some test
cases to verify
behavior
Instead, what if we…
1. Write a test to capture
expected behavior?
2. Think about
implementation to meet
expectation?
3. Write code to make the
failing test pass?
Build functionality
incrementally one test at a
time…
Test-Driven Development (TDD)
16
Write a
new test
Test Fails
Write Code
Test
Passes
Clean up
code,
make sure
tests pass
start here
Style of programming
in which three
activities are tightly
interwoven: coding,
testing (in the form
of writing unit tests)
and design (in the
form of refactoring)
Developer
heartbeat
Red – Green - Refactor
Business Benefits
Requirements
verification
Regression
catching
Quicker
release cycle
Reduced
Waste
Developer Benefits
Better design
choices
Prevents gold-
plating
Confidence /
Supports
change
Momentum
Extreme Programming (XP)
- Kent Beck 19
Feedback &
Simplicity
But there’s no free lunch…
20
Here are some ways that TDD can lead to WORSE design:
• In search of speed, developers will lean too heavily on mocks, locking in
place their production code and making refactoring more difficult
• Developers will build elaborate dependency injection tools and
structures, making their design highly complex and unmaintainable.
REMEMBER: the emphasis should be on SIMPLE DESIGN, and not just for
your application code but also for your test code.
Source: https://www.jamesshore.com/Blog/How-Does-TDD-Affect-
Design.html
Source Adaptation: BDD in Action
Business Goals Features
Rules &
Examples
Executable
specifications
Low-level
specifications
Application
Code
User
stories
Only build features
that align with
business goals
Features and stories
clarified with rules
and examples
Guide development &
testing. Can be read by
whole team
Features broken
down into smaller
user stories. Help
plan how we
deliver a feature
Unit tests aimed
mostly at
developers
Automatable with BDD
tools like Cucumber,
Specflow
Unit testing tools like
JUnit, NUnit
21
Principle Activities Summarized
Source Adaptation: Raj Indugula & George Dinwiddie
Scenario: Invalid example
Given I am a new user
When I select "Abc1*$!-**" as a
password
Then I can access my account
Scenario: Cash dispensed when
machine has no $20 bills
Given the ATM is out of $20 bills
When a depositor withdraws $50
Then the ATM dispenses 5 $10 bills
22
From Test-last to Test-driven
conversations
Building the right thing
Building the thing right
23
Being test-driven isn’t really
about testing. It’s about
specification and design
driven through tests

Contenu connexe

Tendances

Getting Comfortable with BDD
Getting Comfortable with BDDGetting Comfortable with BDD
Getting Comfortable with BDDAlex Sharp
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingLemi Orhan Ergin
 
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 201810 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018Lemi Orhan Ergin
 
Offshore Agile Maintenance
Offshore Agile MaintenanceOffshore Agile Maintenance
Offshore Agile MaintenanceNaresh Jain
 
How to design a 'Good' Embedded Software?
How to design a 'Good' Embedded Software?How to design a 'Good' Embedded Software?
How to design a 'Good' Embedded Software?apurvaprabhakar
 
Flavours of agile software engineering
Flavours of agile software engineeringFlavours of agile software engineering
Flavours of agile software engineeringZeeshan Masood S
 
BDD on Java Concordion and Selenium
BDD on Java Concordion and SeleniumBDD on Java Concordion and Selenium
BDD on Java Concordion and Seleniumspringbyexample
 
Prototyping in a Scrum environment
Prototyping in a Scrum environmentPrototyping in a Scrum environment
Prototyping in a Scrum environmentSid Dane
 
Agile Prototyping for Software Development Projects
Agile Prototyping for Software Development ProjectsAgile Prototyping for Software Development Projects
Agile Prototyping for Software Development ProjectsInvolved IT
 
Learning Code Review & Commit Message with Google
Learning Code Review & Commit Message with GoogleLearning Code Review & Commit Message with Google
Learning Code Review & Commit Message with GoogleChang Ru Yang
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides pptMr SMAK
 
BDD & Beyond: The Past, Present, & Future of Test Automation
BDD & Beyond: The Past, Present, & Future of Test AutomationBDD & Beyond: The Past, Present, & Future of Test Automation
BDD & Beyond: The Past, Present, & Future of Test AutomationFord Prior
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)Rohit Bisht
 
Introduction to bdd
Introduction to bddIntroduction to bdd
Introduction to bddSeb Rose
 
Why you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyWhy you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyMatts Devriendt
 
Software craftmanship coaching
Software craftmanship coachingSoftware craftmanship coaching
Software craftmanship coachingPedro Santos
 
What Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeWhat Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeRobert Stackhouse
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is ImportaintSana Nasar
 
Experience Agile Programming - Kiev
Experience Agile Programming - KievExperience Agile Programming - Kiev
Experience Agile Programming - KievJohannes Brodwall
 

Tendances (20)

Getting Comfortable with BDD
Getting Comfortable with BDDGetting Comfortable with BDD
Getting Comfortable with BDD
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair Programming
 
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 201810 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
 
Offshore Agile Maintenance
Offshore Agile MaintenanceOffshore Agile Maintenance
Offshore Agile Maintenance
 
How to design a 'Good' Embedded Software?
How to design a 'Good' Embedded Software?How to design a 'Good' Embedded Software?
How to design a 'Good' Embedded Software?
 
Flavours of agile software engineering
Flavours of agile software engineeringFlavours of agile software engineering
Flavours of agile software engineering
 
BDD on Java Concordion and Selenium
BDD on Java Concordion and SeleniumBDD on Java Concordion and Selenium
BDD on Java Concordion and Selenium
 
Prototyping in a Scrum environment
Prototyping in a Scrum environmentPrototyping in a Scrum environment
Prototyping in a Scrum environment
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
 
Agile Prototyping for Software Development Projects
Agile Prototyping for Software Development ProjectsAgile Prototyping for Software Development Projects
Agile Prototyping for Software Development Projects
 
Learning Code Review & Commit Message with Google
Learning Code Review & Commit Message with GoogleLearning Code Review & Commit Message with Google
Learning Code Review & Commit Message with Google
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides ppt
 
BDD & Beyond: The Past, Present, & Future of Test Automation
BDD & Beyond: The Past, Present, & Future of Test AutomationBDD & Beyond: The Past, Present, & Future of Test Automation
BDD & Beyond: The Past, Present, & Future of Test Automation
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
Introduction to bdd
Introduction to bddIntroduction to bdd
Introduction to bdd
 
Why you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyWhy you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software company
 
Software craftmanship coaching
Software craftmanship coachingSoftware craftmanship coaching
Software craftmanship coaching
 
What Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeWhat Software Quality Assurance Means to Me
What Software Quality Assurance Means to Me
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
Experience Agile Programming - Kiev
Experience Agile Programming - KievExperience Agile Programming - Kiev
Experience Agile Programming - Kiev
 

Similaire à Being Test-Driven Development Isn't Really About Testing

Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가Jaehoon Oh
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanQA or the Highway
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Synerzip
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingUtkarsh Khare
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012Justin Gordon
 
Agile Practices - eXtreme Programming
Agile Practices - eXtreme ProgrammingAgile Practices - eXtreme Programming
Agile Practices - eXtreme ProgrammingAniruddha Chakrabarti
 
Paul Ellarby - Why do scrum?
Paul Ellarby - Why do scrum?Paul Ellarby - Why do scrum?
Paul Ellarby - Why do scrum?Paul Ellarby
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovSvetlin Nakov
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionHoa Le
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDaysJKT
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Test driven development vs Behavior driven development
Test driven development vs Behavior driven developmentTest driven development vs Behavior driven development
Test driven development vs Behavior driven developmentGallop Solutions
 
Test driven development
Test driven developmentTest driven development
Test driven developmentSunil Prasad
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Perfecto Mobile
 
Test driven development and react js application go hand in hand
Test driven development and react js application go hand in handTest driven development and react js application go hand in hand
Test driven development and react js application go hand in handKaty Slemon
 

Similaire à Being Test-Driven Development Isn't Really About Testing (20)

Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가Tdd 왜 배우기 어려운가
Tdd 왜 배우기 어려운가
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
 
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Agile Practices - eXtreme Programming
Agile Practices - eXtreme ProgrammingAgile Practices - eXtreme Programming
Agile Practices - eXtreme Programming
 
Paul Ellarby - Why do scrum?
Paul Ellarby - Why do scrum?Paul Ellarby - Why do scrum?
Paul Ellarby - Why do scrum?
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta Igites
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Test driven development vs Behavior driven development
Test driven development vs Behavior driven developmentTest driven development vs Behavior driven development
Test driven development vs Behavior driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Agile testing
Agile testingAgile testing
Agile testing
 
Agile Engineering Practices
Agile Engineering PracticesAgile Engineering Practices
Agile Engineering Practices
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Test driven development and react js application go hand in hand
Test driven development and react js application go hand in handTest driven development and react js application go hand in hand
Test driven development and react js application go hand in hand
 

Plus de Raj Indugula

To Deliver, Discover We Must - A value-driven approach to agile planning
To Deliver, Discover We Must - A value-driven approach to agile planningTo Deliver, Discover We Must - A value-driven approach to agile planning
To Deliver, Discover We Must - A value-driven approach to agile planningRaj Indugula
 
Yo! What’s The Scenario?
Yo! What’s The Scenario?Yo! What’s The Scenario?
Yo! What’s The Scenario?Raj Indugula
 
Be Ready, Be Done: The Art of Slicing Stories
Be Ready, Be Done: The Art of Slicing StoriesBe Ready, Be Done: The Art of Slicing Stories
Be Ready, Be Done: The Art of Slicing StoriesRaj Indugula
 
What's Measured Improves: Metrics that matter
What's Measured Improves: Metrics that matterWhat's Measured Improves: Metrics that matter
What's Measured Improves: Metrics that matterRaj Indugula
 
Dare to Explore: Discover ET!
Dare to Explore: Discover ET!Dare to Explore: Discover ET!
Dare to Explore: Discover ET!Raj Indugula
 
Leanstartuptoolsforproductowners
LeanstartuptoolsforproductownersLeanstartuptoolsforproductowners
LeanstartuptoolsforproductownersRaj Indugula
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentRaj Indugula
 

Plus de Raj Indugula (8)

To Deliver, Discover We Must - A value-driven approach to agile planning
To Deliver, Discover We Must - A value-driven approach to agile planningTo Deliver, Discover We Must - A value-driven approach to agile planning
To Deliver, Discover We Must - A value-driven approach to agile planning
 
Yo! What’s The Scenario?
Yo! What’s The Scenario?Yo! What’s The Scenario?
Yo! What’s The Scenario?
 
Be Ready, Be Done: The Art of Slicing Stories
Be Ready, Be Done: The Art of Slicing StoriesBe Ready, Be Done: The Art of Slicing Stories
Be Ready, Be Done: The Art of Slicing Stories
 
What's Measured Improves: Metrics that matter
What's Measured Improves: Metrics that matterWhat's Measured Improves: Metrics that matter
What's Measured Improves: Metrics that matter
 
Dare to Explore: Discover ET!
Dare to Explore: Discover ET!Dare to Explore: Discover ET!
Dare to Explore: Discover ET!
 
Leanstartuptoolsforproductowners
LeanstartuptoolsforproductownersLeanstartuptoolsforproductowners
Leanstartuptoolsforproductowners
 
Agile testing
Agile testingAgile testing
Agile testing
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Being Test-Driven Development Isn't Really About Testing

  • 1. Being Test-Driven It’s not really about testing Raj Indugula George Lively Raj.Indugula@lithespeed.com George.lively@lithespeed.com Twitter: @lithespeed
  • 2. 2 What is the point of test-driven development?
  • 3. • Driving Common Understanding with Behavior Driven Development • Driving Better Design with Test- Driven Development • Tying it all together • Q&A Outline “The speed of development is the speed of getting an idea from one brain to another” – Alistair Cockburn 3
  • 4. BDD IS BUILDING THE RIGHT THING Behavior-Driven Development (BDD)
  • 5. Behavior Driven Development (BDD) 5 Collaboration and conversation to discover essential requirements and identify uncertainty Using rules & examples Expressed in a common language to build a shared understanding To deliver software that matters
  • 6. Behavior Driven Development (BDD) 6 Collaboration and conversation to discover essential requirements and identify uncertainty Using rules & examples Expressed in a common language to build a shared understanding To deliver software that matters
  • 8. BDD IS THE ART OF USING RULES & EXAMPLES IN CONVERSATIONS TO ILLUSTRATE BEHAVIOR 8
  • 9. 9 Different Viewpoints, Shared Understanding 9 Business, Developer, Tester Shared understanding All agree it is ready to be implemented THREE AMIGOS 9 Example Mapping, Matt Wynne Depositor can withdraw cash Limited by amount on deposit Subject to daily and transaction limits Scenario with sufficient funds Limited by daily limit of $500 What is the transaction limit? Cash is dispensed in $10 increments with $20 bills favored Scenario with insufficient funds Fully stocked scenario when withdrawal of $50 results in 2 $20 bills and 1 $10 bill When out of $20s, withdrawal of $50 results in 5 $10 bills Acceptance Scenarios Acceptance Criteria
  • 10. 10 CAPTURE THE CONVERSATIONS TO DRIVE DEVELOPMENT
  • 11. 11 Feature: ATM withdrawals Our ATM allows depositors to withdraw their funds in cash Rules: Withdrawals are limited by amount on deposit Withdrawals are subject to daily and transaction withdrawal limits Cash is dispensed in $10 increments with $20 bills favored Scenario: Sufficient funds allows successful withdrawal Given a depositor has $2000 on deposit When the depositor requests $200 Then the ATM dispenses $200 And the depositor’s balance is reduced to $1800 … DocumentationHuman readable Structured and keyword-based Allows automation Gherkin
  • 12. 12 AUTOMATE SPECIFICATIONS AS NEEDED Test Framewor k Integratio n Gherkin Scenarios Specification expressed in common language Step Definitions “Glue” code that ties specification to System under Test Cucumber, SpecFlow, etc.
  • 14. Test-Driven Development (TDD) TDD IS BUILDING THE THING RIGHT
  • 15. Reimagine our thinking… 15 How we typically write tests… 1. Think about implementation 2. Write code (fields & methods) 3. Write some test cases to verify behavior Instead, what if we… 1. Write a test to capture expected behavior? 2. Think about implementation to meet expectation? 3. Write code to make the failing test pass? Build functionality incrementally one test at a time…
  • 16. Test-Driven Development (TDD) 16 Write a new test Test Fails Write Code Test Passes Clean up code, make sure tests pass start here Style of programming in which three activities are tightly interwoven: coding, testing (in the form of writing unit tests) and design (in the form of refactoring) Developer heartbeat Red – Green - Refactor
  • 18. Developer Benefits Better design choices Prevents gold- plating Confidence / Supports change Momentum
  • 19. Extreme Programming (XP) - Kent Beck 19 Feedback & Simplicity
  • 20. But there’s no free lunch… 20 Here are some ways that TDD can lead to WORSE design: • In search of speed, developers will lean too heavily on mocks, locking in place their production code and making refactoring more difficult • Developers will build elaborate dependency injection tools and structures, making their design highly complex and unmaintainable. REMEMBER: the emphasis should be on SIMPLE DESIGN, and not just for your application code but also for your test code. Source: https://www.jamesshore.com/Blog/How-Does-TDD-Affect- Design.html
  • 21. Source Adaptation: BDD in Action Business Goals Features Rules & Examples Executable specifications Low-level specifications Application Code User stories Only build features that align with business goals Features and stories clarified with rules and examples Guide development & testing. Can be read by whole team Features broken down into smaller user stories. Help plan how we deliver a feature Unit tests aimed mostly at developers Automatable with BDD tools like Cucumber, Specflow Unit testing tools like JUnit, NUnit 21 Principle Activities Summarized
  • 22. Source Adaptation: Raj Indugula & George Dinwiddie Scenario: Invalid example Given I am a new user When I select "Abc1*$!-**" as a password Then I can access my account Scenario: Cash dispensed when machine has no $20 bills Given the ATM is out of $20 bills When a depositor withdraws $50 Then the ATM dispenses 5 $10 bills 22 From Test-last to Test-driven conversations Building the right thing Building the thing right
  • 23. 23 Being test-driven isn’t really about testing. It’s about specification and design driven through tests