SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
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

Weitere Àhnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie Being Test-Driven: It's not 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
 
Agile Engineering Practices
Agile Engineering PracticesAgile Engineering Practices
Agile Engineering PracticesVernon Stinebaker
 
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
 

Ähnlich wie Being Test-Driven: It's not 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
 

Mehr von 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
 
Agile testing
Agile testingAgile testing
Agile testingRaj 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
 

Mehr von 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
 

KĂŒrzlich hochgeladen

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂșjo
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 

KĂŒrzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 

Being Test-Driven: It's not 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