SlideShare une entreprise Scribd logo
1  sur  41
1
Building in Quality:
The Beauty of Behavior Driven
Development (BDD)
Larry Apke - Agile Coach
2
Deming on Quality
“Quality comes not from inspection, but from
improvement of the production process. “
3
Deming on Quality
“We cannot rely on mass inspection to improve
quality… As Harold S. Dodge said many years
ago, 'You cannot inspect quality into a product.'
The quality is there or it isn't by the time it's
inspected. “
4
Red
GreenRefactor
TDD
• Write a unit test
• Validate that the test fails
• Write just the minimum code necessary
• Validate that the test passes successfully
• Refactor the code
BDD Begins with Test Driven Development (TDD)
5
Why Do TDD?
• “Ilities” – Maintainability, Flexibility,
Extensibility
• High Percentage of Test Code
Coverage
• Streamlined Codebase
• Cleaner Interfaces
• Easier Refactoring of Code
• Tests Provide Some Code
Documentation
• Bottom Line - Higher Quality
6
An Expert Speaks on TDD
“It is a myth that we can get systems “right the
first time.” Instead, we should implement only
today’s stories, then refactor and expand the
system to implement new stories tomorrow.
This is the essence of iterative and incremental
agility. Test-driven development, refactoring,
and the clean code they produce make this
work at the code level.”
7
An Expert Speaks on TDD
“If the discipline of requirements specification
has taught us anything, it is that well-specified
requirements are as formal as code and can act
as executable tests of that code!”
8
An Expert Speaks on TDD
“So if you want to go fast, if you want to get
done quickly, if you want your code to be easy
to write, make it easy to read.”
9
An Expert Speaks on TDD
“Indeed, the ratio of time spent reading versus
writing is well over 10 to 1. We are constantly
reading old code as part of the effort to write
new code. ...[Therefore,] making it easy to read
makes it easier to write.”
10
An Expert Speaks on Being a Professional Developer
“Perhaps you thought that “getting it working”
was the first order of business for a professional
developer…The functionality that you create
today has a good chance of changing in the next
release, but the readability of your code will
have a profound effect on all the changes that
will ever be made.”
11
An Expert Speaks on Being a Professional Developer
“Programmers who satisfy themselves with
merely working code are behaving
unprofessionally. “
12
An Expert Speaks on Being a Professional Developer
“Writing clean code is what you must do in
order to call yourself a professional. There is no
reasonable excuse for doing anything less than
your best.”
13
Other Aspects of Being a Professional Developer
In addition to Test Driven Development and
writing testable, readable code, there are a
number of other things that go into making one
a professional programmer.
Your code must be secure
Your code must be performant
Your code must be deployable
Your code must integrate
In other words, code quality must be injected
into the code by the professional programmer.
Quality cannot be inspected into the code ex
post facto (after the fact).
14
So, Why Doesn’t Everyone Do TDD?
• Most developers have not learned TDD and there is a learning curve
• TDD is extremely disciplined
• There is a perception that development is slower
• It is difficult to introduce with legacy code
• Developers often need to mock objects and learn mocking
“I kept coming across the same confusion and misunderstandings.
Programmers wanted to know where to start, what to test and what not
to test, how much to test in one go, what to call their tests, and how to
understand why a test fails.” - Dan North - Introduction to BDD
15
Along Comes BDD (Behavior Driven Development)
“My response is behaviour-driven development
(BDD). It has evolved out of established agile
practices and is designed to make them more
accessible and effective for teams new to agile
software delivery. Over time, BDD has grown to
encompass the wider picture of agile analysis
and automated acceptance testing.”
Created a “ubiquitous language for the analysis
process itself!”
Over time they found that the conversations
between business and development where
richer.
16
Why Do BDD?
TDD builds it right, BDD builds the right thing.
While there is no silver bullet to software
development, BDD (when coupled with
continuous integration) comes as close as
anything I have found.
My blog - “10 Reasons Why BDD Changes
Everything” was published on 3/6/2012 and
still is the most visited page on my website.
17
Ten Reasons Why BDD Changes Everything
• Communication between business and development is extremely focused
as a result of common language.
• Business needs tie directly to the code that is written.
• Developers know what test cases they should write to accommodate TDD.
• All the underlying benefits of TDD become more easily realized.
• Code is easier to maintain.
• Code is self documenting.
• Stories are easier to “groom” – breakdown, task and plan.
• Teams can be more agile.
• Developers can be trained / on-boarded easier.
• There is more visibility into team progress and status.
18
BDD – Real World Stories
Expressing Acceptance Criteria as
BDD scenarios breaks the bottle
neck in story writing for a small
financial services company in
Scottsdale, Arizona.
19
BDD – Real World Stories
BDD provides support necessary
to successfully deliver MVP into
production in record time for
financial services company in San
Antonio, Texas.
20
Adopting BDD – Three Simple Steps
Step One
Write our story acceptance criteria using BDD
scenarios
Step Two
Leverage these BDD scenarios to write our
automated tests first in true TDD fashion
Step Three
Leverage a BDD Tool like Cucumber to map
human-readable BDD scenarios to the
automated tests
21
Step One – Write Acceptance Criteria in BDD Style
Step One is accomplished by the three amigos -
Product Owner, Developer(s) and Quality
Assurance Person(s).
Step One is accomplished during Story Refinement
which is where we go into detail for the stories that
we believe we will take during the next iteration.
This is the first step in transitioning to BDD and the
one that brings the most benefit. It was a pleasant
surprise to Dan North and crew, something that
they did not plan. Better communication equals
better quality.
22
Step One – Write Acceptance Criteria in BDD Style
The Story
Customer Withdraws Cash
As a customer,
I want to withdraw cash from an ATM,
So that I don’t have to wait in line at the
bank.
23
Step One – Write Acceptance Criteria in BDD Style
The Story
Customer Withdraws Cash
Scenario 1 - Account is In Credit
Given the account is in credit
And the card is valid
And the dispenser contains cash
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
24
Step One – Write Acceptance Criteria in BDD Style
The Story
Customer Withdraws Cash
Scenario 2 - Account is overdrawn past the
overdraft limit
Given the account is overdrawn
And the card is valid
When the customer requests cash
Then ensure a rejection message is displayed
And ensure cash is not dispensed
And ensure the card is returned
25
Step Two – Use BDD Scenarios to Write Tests
In step two we leverage BDD to write our tests
and begin the process of TDD. BDD scenarios
can be written directly into tests using
comments.
26
Step Two – Use BDD Scenarios to Write Tests
public class AccountIsInCredit extends TestCase {
@Setup
//Scenario 1 - Account is In Credit
// Given the account is in credit
// And the card is valid
// And the dispenser contains cash
//Write code here to mock out account and add credit, mock out card and
set as valid, etc.
27
Step Two – Use BDD Scenarios to Write Tests
//When the customer requests cash
Call CustomerRequestsCash (Amount) //call method on class and pass values
@Test
//Then ensure the account is debited
// And ensure cash is dispensed
// And ensure the card is returned
Assert.AssertEquals(ExpectedAccountBalance, Account.Balance);
Assert.AssertEquals(CashDispensed, True);
Assert.AssertEquals(CardReturned, True);
}
28
Step Three – Use a BDD Tool
• BDD Tool will take human-readable
scenarios and use regular expressions to
map the human readable scenarios to Unit
Tests.
• BDD Tools will create a unit test and shell
automatically (referred to as a step
definition file) that helps in the creation of
test.
• When the BDD Tool runs the tests, the
output shows which tests passed and failed
against the human-readable scenarios.
• There are BDD Tools for all major languages.
I recommend Cucumber for Java and Ruby.
29
Step Three – Use a BDD Tool
Scenario: Valid Log On
Given user navigates to logon page
When they enter valid user name and password
Then login should be successful
30
Step Three – Use a BDD Tool
@Given("^user navigates to logonpage$")
pending # express the regexp above with the code you wish you had
end
@When("^they enter valid Username as "([^"]*)" and Password as
"([^"]*)"$")
pending # express the regexp above with the code you wish you had
end
@Then("^login should be successful$")
pending # express the regexp above with the code you wish you had
end
31
Step Three – Use a BDD Tool
@Given("^user navigates to logonpage$")
public void goToLogonPage() {
driver = new FirefoxDriver();
driver.navigate().to(“logonpage.htm");
} end
@When("^they enter valid Username as "([^"]*)" and Password as "([^"]*)"$")
public void ValidUserNameAndPassword(String arg1, String arg2) {
driver.findElement(By.id("email")).sendKeys(arg1);
driver.findElement(By.id("pass")).sendKeys(arg2);
driver.findElement(By.id(“submit")).click();
}
end
32
Step Three – Use a BDD Tool
#encoding: utf-8
Feature: Logging On
Scenario: Valid Log On # /logom:8
Given user navigates to logon page # /step_defs/logon.rb:3
When they enter valid user name and password # /step_defs/logon.rb:7
Then login should be successful # /step_defs/logon.rb:14
1 scenario (1 passed)
3 steps (3 passed)
0m0.005s
33
Step Three – Use a BDD Tool
34
Bonus Step – Manage Your BDD Test Suite
35
Helpful Links
Dan North - Introduction to BDD
The Cucumber Book: Behaviour-Driven Development for Testers and
Developers
BDD in Action: Behavior-driven development for the whole software lifecycle
Specification by Example: How Successful Teams Deliver the Right Software
Cucumber Tool
Serenity Tool
Clean Code: A Handbook of Software Craftsmanship
36
Questions
37
Subu Sankara
subu@synerzip.com
510.579.9673
38
Your trusted outsourcing partner for
Agile software product development.
Synerzip
• Accelerate the delivery of your product roadmap
• Address technology skill gaps
• Save at least 50% with offshore software development
• Augment your team with optional on-site professionals
39
Synerzip Clients
40©SYNERZIP2017Corporate Overview 40
Connect with Synerzip
@Synerzip
linkedin.com/company/synerzip
facebook.com/Synerzip
41
LIVE EVENTS in August
AGILE2017 Conference Top 10

Contenu connexe

Tendances

Code quality as a built-in process
Code quality as a built-in processCode quality as a built-in process
Code quality as a built-in processElad Maimon
 
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
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Ajay Danait
 
Evolution of Software Engineering in NCTR Projects
Evolution of Software Engineering in NCTR  Projects   Evolution of Software Engineering in NCTR  Projects
Evolution of Software Engineering in NCTR Projects Mohammed Abbas
 
Managing Software Debt - Quality Debt Focus for QASIG Seattle
Managing Software Debt - Quality Debt Focus for QASIG SeattleManaging Software Debt - Quality Debt Focus for QASIG Seattle
Managing Software Debt - Quality Debt Focus for QASIG SeattleChris Sterling
 
BDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityBDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityJohn Ferguson Smart Limited
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Big Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresBig Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresGonzalo Rodríguez
 
Teaching Kids Programming
Teaching Kids ProgrammingTeaching Kids Programming
Teaching Kids ProgrammingLynn Langit
 
Caring about Code Quality
Caring about Code QualityCaring about Code Quality
Caring about Code QualitySaltmarch Media
 
Technical Debt and Requirements
Technical Debt and RequirementsTechnical Debt and Requirements
Technical Debt and RequirementsNeil Ernst
 
Pair Programming, TDD and other impractical things
Pair Programming, TDD and other impractical thingsPair Programming, TDD and other impractical things
Pair Programming, TDD and other impractical thingsMarcello Duarte
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineRemus Langu
 
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Agile Testing Alliance
 

Tendances (19)

Code quality as a built-in process
Code quality as a built-in processCode quality as a built-in process
Code quality as a built-in process
 
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
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
Evolution of Software Engineering in NCTR Projects
Evolution of Software Engineering in NCTR  Projects   Evolution of Software Engineering in NCTR  Projects
Evolution of Software Engineering in NCTR Projects
 
Managing Software Debt - Quality Debt Focus for QASIG Seattle
Managing Software Debt - Quality Debt Focus for QASIG SeattleManaging Software Debt - Quality Debt Focus for QASIG Seattle
Managing Software Debt - Quality Debt Focus for QASIG Seattle
 
BDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and SerenityBDD in Action - Automated Web Testing with WebDriver and Serenity
BDD in Action - Automated Web Testing with WebDriver and Serenity
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Scrum + bdd + ddd
Scrum + bdd + dddScrum + bdd + ddd
Scrum + bdd + ddd
 
Big Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresBig Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance Nightmares
 
Teaching Kids Programming
Teaching Kids ProgrammingTeaching Kids Programming
Teaching Kids Programming
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 
BBOM-AgilePT-2010
BBOM-AgilePT-2010BBOM-AgilePT-2010
BBOM-AgilePT-2010
 
Caring about Code Quality
Caring about Code QualityCaring about Code Quality
Caring about Code Quality
 
Technical Debt and Requirements
Technical Debt and RequirementsTechnical Debt and Requirements
Technical Debt and Requirements
 
ATDD in practice
ATDD in practiceATDD in practice
ATDD in practice
 
Pair Programming, TDD and other impractical things
Pair Programming, TDD and other impractical thingsPair Programming, TDD and other impractical things
Pair Programming, TDD and other impractical things
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & Jasmine
 
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
 

Similaire à Building In Quality: The Beauty Of Behavior Driven Development (BDD)

Intro to TDD & BDD
Intro to TDD & BDDIntro to TDD & BDD
Intro to TDD & BDDdevObjective
 
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous IntegrationITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous IntegrationOrtus Solutions, Corp
 
Myths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven DevelopmentMyths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven DevelopmentPankaj Nakhat
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentAdam Englander
 
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo RiolWebinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo RiolatSistemas
 
Expo qa from user stories to automated acceptance tests with bdd
Expo qa   from user stories to automated acceptance tests with bddExpo qa   from user stories to automated acceptance tests with bdd
Expo qa from user stories to automated acceptance tests with bddEduardo Riol
 
Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011Fabio Armani
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentQASymphony
 
Being Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingBeing Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingRaj Indugula
 
Don't let your tests slow you down
Don't let your tests slow you downDon't let your tests slow you down
Don't let your tests slow you downDaniel Irvine
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is ImportaintSana Nasar
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia eventXebia India
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDaysJKT
 
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
 
Test driven development
Test driven developmentTest driven development
Test driven developmentSunil Prasad
 
German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...Bastian Seehaus
 

Similaire à Building In Quality: The Beauty Of Behavior Driven Development (BDD) (20)

Intro to TDD & BDD
Intro to TDD & BDDIntro to TDD & BDD
Intro to TDD & BDD
 
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous IntegrationITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Myths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven DevelopmentMyths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven Development
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo RiolWebinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
 
Expo qa from user stories to automated acceptance tests with bdd
Expo qa   from user stories to automated acceptance tests with bddExpo qa   from user stories to automated acceptance tests with bdd
Expo qa from user stories to automated acceptance tests with bdd
 
Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven Development
 
Being Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testingBeing Test-Driven: It's not really about testing
Being Test-Driven: It's not really about testing
 
Don't let your tests slow you down
Don't let your tests slow you downDon't let your tests slow you down
Don't let your tests slow you down
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta Igites
 
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
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...German Testing Day 2015 - How behavior-driven development fuses developers an...
German Testing Day 2015 - How behavior-driven development fuses developers an...
 

Plus de Synerzip

HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...
HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...
HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...Synerzip
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing ProcessSynerzip
 
Test Driven Development – What Works And What Doesn’t
Test Driven Development – What Works And What Doesn’t Test Driven Development – What Works And What Doesn’t
Test Driven Development – What Works And What Doesn’t Synerzip
 
Distributed/Dual-Shore Agile Software Development – Is It Effective?
Distributed/Dual-Shore Agile Software Development – Is It Effective?Distributed/Dual-Shore Agile Software Development – Is It Effective?
Distributed/Dual-Shore Agile Software Development – Is It Effective?Synerzip
 
Using Agile Approach with Fixed Budget Projects
Using Agile Approach with Fixed Budget ProjectsUsing Agile Approach with Fixed Budget Projects
Using Agile Approach with Fixed Budget ProjectsSynerzip
 
QA Role in Agile Teams
QA Role in Agile Teams QA Role in Agile Teams
QA Role in Agile Teams Synerzip
 
Agile For Mobile App Development
Agile For Mobile App Development Agile For Mobile App Development
Agile For Mobile App Development Synerzip
 
Using Agile in Non-Ideal Situations
Using Agile in Non-Ideal SituationsUsing Agile in Non-Ideal Situations
Using Agile in Non-Ideal SituationsSynerzip
 
Accelerating Agile Transformations - Ravi Verma
Accelerating Agile Transformations - Ravi VermaAccelerating Agile Transformations - Ravi Verma
Accelerating Agile Transformations - Ravi VermaSynerzip
 
Agile Product Management Basics
Agile Product Management BasicsAgile Product Management Basics
Agile Product Management BasicsSynerzip
 
Product Portfolio Kanban - by Erik Huddleston
Product Portfolio Kanban - by Erik HuddlestonProduct Portfolio Kanban - by Erik Huddleston
Product Portfolio Kanban - by Erik HuddlestonSynerzip
 
Modern Software Practices - by Damon Poole
Modern Software Practices - by Damon PooleModern Software Practices - by Damon Poole
Modern Software Practices - by Damon PooleSynerzip
 
Context Driven Agile Leadership
Context Driven Agile LeadershipContext Driven Agile Leadership
Context Driven Agile LeadershipSynerzip
 
Adopting TDD - by Don McGreal
Adopting TDD - by Don McGrealAdopting TDD - by Don McGreal
Adopting TDD - by Don McGrealSynerzip
 
Pragmatics of Agility - by Venkat Subramaniam
Pragmatics of Agility - by Venkat SubramaniamPragmatics of Agility - by Venkat Subramaniam
Pragmatics of Agility - by Venkat SubramaniamSynerzip
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App DevelopmentSynerzip
 
Agile2011 Conference – Key Take Aways
Agile2011 Conference – Key Take AwaysAgile2011 Conference – Key Take Aways
Agile2011 Conference – Key Take AwaysSynerzip
 
Performance Evaluation in Agile
Performance Evaluation in AgilePerformance Evaluation in Agile
Performance Evaluation in AgileSynerzip
 
Scrum And Kanban (for better agile teams)
Scrum And Kanban (for better agile teams)Scrum And Kanban (for better agile teams)
Scrum And Kanban (for better agile teams)Synerzip
 
Managing Technical Debt - by Michael Hall
Managing Technical Debt - by Michael HallManaging Technical Debt - by Michael Hall
Managing Technical Debt - by Michael HallSynerzip
 

Plus de Synerzip (20)

HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...
HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...
HOW VOCERA LEVERAGES SYNERZIP FOR ENHANCEMENT OF VOCERA PLATFORM & ITS USER E...
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
 
Test Driven Development – What Works And What Doesn’t
Test Driven Development – What Works And What Doesn’t Test Driven Development – What Works And What Doesn’t
Test Driven Development – What Works And What Doesn’t
 
Distributed/Dual-Shore Agile Software Development – Is It Effective?
Distributed/Dual-Shore Agile Software Development – Is It Effective?Distributed/Dual-Shore Agile Software Development – Is It Effective?
Distributed/Dual-Shore Agile Software Development – Is It Effective?
 
Using Agile Approach with Fixed Budget Projects
Using Agile Approach with Fixed Budget ProjectsUsing Agile Approach with Fixed Budget Projects
Using Agile Approach with Fixed Budget Projects
 
QA Role in Agile Teams
QA Role in Agile Teams QA Role in Agile Teams
QA Role in Agile Teams
 
Agile For Mobile App Development
Agile For Mobile App Development Agile For Mobile App Development
Agile For Mobile App Development
 
Using Agile in Non-Ideal Situations
Using Agile in Non-Ideal SituationsUsing Agile in Non-Ideal Situations
Using Agile in Non-Ideal Situations
 
Accelerating Agile Transformations - Ravi Verma
Accelerating Agile Transformations - Ravi VermaAccelerating Agile Transformations - Ravi Verma
Accelerating Agile Transformations - Ravi Verma
 
Agile Product Management Basics
Agile Product Management BasicsAgile Product Management Basics
Agile Product Management Basics
 
Product Portfolio Kanban - by Erik Huddleston
Product Portfolio Kanban - by Erik HuddlestonProduct Portfolio Kanban - by Erik Huddleston
Product Portfolio Kanban - by Erik Huddleston
 
Modern Software Practices - by Damon Poole
Modern Software Practices - by Damon PooleModern Software Practices - by Damon Poole
Modern Software Practices - by Damon Poole
 
Context Driven Agile Leadership
Context Driven Agile LeadershipContext Driven Agile Leadership
Context Driven Agile Leadership
 
Adopting TDD - by Don McGreal
Adopting TDD - by Don McGrealAdopting TDD - by Don McGreal
Adopting TDD - by Don McGreal
 
Pragmatics of Agility - by Venkat Subramaniam
Pragmatics of Agility - by Venkat SubramaniamPragmatics of Agility - by Venkat Subramaniam
Pragmatics of Agility - by Venkat Subramaniam
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 
Agile2011 Conference – Key Take Aways
Agile2011 Conference – Key Take AwaysAgile2011 Conference – Key Take Aways
Agile2011 Conference – Key Take Aways
 
Performance Evaluation in Agile
Performance Evaluation in AgilePerformance Evaluation in Agile
Performance Evaluation in Agile
 
Scrum And Kanban (for better agile teams)
Scrum And Kanban (for better agile teams)Scrum And Kanban (for better agile teams)
Scrum And Kanban (for better agile teams)
 
Managing Technical Debt - by Michael Hall
Managing Technical Debt - by Michael HallManaging Technical Debt - by Michael Hall
Managing Technical Debt - by Michael Hall
 

Dernier

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Dernier (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Building In Quality: The Beauty Of Behavior Driven Development (BDD)

  • 1. 1 Building in Quality: The Beauty of Behavior Driven Development (BDD) Larry Apke - Agile Coach
  • 2. 2 Deming on Quality “Quality comes not from inspection, but from improvement of the production process. “
  • 3. 3 Deming on Quality “We cannot rely on mass inspection to improve quality… As Harold S. Dodge said many years ago, 'You cannot inspect quality into a product.' The quality is there or it isn't by the time it's inspected. “
  • 4. 4 Red GreenRefactor TDD • Write a unit test • Validate that the test fails • Write just the minimum code necessary • Validate that the test passes successfully • Refactor the code BDD Begins with Test Driven Development (TDD)
  • 5. 5 Why Do TDD? • “Ilities” – Maintainability, Flexibility, Extensibility • High Percentage of Test Code Coverage • Streamlined Codebase • Cleaner Interfaces • Easier Refactoring of Code • Tests Provide Some Code Documentation • Bottom Line - Higher Quality
  • 6. 6 An Expert Speaks on TDD “It is a myth that we can get systems “right the first time.” Instead, we should implement only today’s stories, then refactor and expand the system to implement new stories tomorrow. This is the essence of iterative and incremental agility. Test-driven development, refactoring, and the clean code they produce make this work at the code level.”
  • 7. 7 An Expert Speaks on TDD “If the discipline of requirements specification has taught us anything, it is that well-specified requirements are as formal as code and can act as executable tests of that code!”
  • 8. 8 An Expert Speaks on TDD “So if you want to go fast, if you want to get done quickly, if you want your code to be easy to write, make it easy to read.”
  • 9. 9 An Expert Speaks on TDD “Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. ...[Therefore,] making it easy to read makes it easier to write.”
  • 10. 10 An Expert Speaks on Being a Professional Developer “Perhaps you thought that “getting it working” was the first order of business for a professional developer…The functionality that you create today has a good chance of changing in the next release, but the readability of your code will have a profound effect on all the changes that will ever be made.”
  • 11. 11 An Expert Speaks on Being a Professional Developer “Programmers who satisfy themselves with merely working code are behaving unprofessionally. “
  • 12. 12 An Expert Speaks on Being a Professional Developer “Writing clean code is what you must do in order to call yourself a professional. There is no reasonable excuse for doing anything less than your best.”
  • 13. 13 Other Aspects of Being a Professional Developer In addition to Test Driven Development and writing testable, readable code, there are a number of other things that go into making one a professional programmer. Your code must be secure Your code must be performant Your code must be deployable Your code must integrate In other words, code quality must be injected into the code by the professional programmer. Quality cannot be inspected into the code ex post facto (after the fact).
  • 14. 14 So, Why Doesn’t Everyone Do TDD? • Most developers have not learned TDD and there is a learning curve • TDD is extremely disciplined • There is a perception that development is slower • It is difficult to introduce with legacy code • Developers often need to mock objects and learn mocking “I kept coming across the same confusion and misunderstandings. Programmers wanted to know where to start, what to test and what not to test, how much to test in one go, what to call their tests, and how to understand why a test fails.” - Dan North - Introduction to BDD
  • 15. 15 Along Comes BDD (Behavior Driven Development) “My response is behaviour-driven development (BDD). It has evolved out of established agile practices and is designed to make them more accessible and effective for teams new to agile software delivery. Over time, BDD has grown to encompass the wider picture of agile analysis and automated acceptance testing.” Created a “ubiquitous language for the analysis process itself!” Over time they found that the conversations between business and development where richer.
  • 16. 16 Why Do BDD? TDD builds it right, BDD builds the right thing. While there is no silver bullet to software development, BDD (when coupled with continuous integration) comes as close as anything I have found. My blog - “10 Reasons Why BDD Changes Everything” was published on 3/6/2012 and still is the most visited page on my website.
  • 17. 17 Ten Reasons Why BDD Changes Everything • Communication between business and development is extremely focused as a result of common language. • Business needs tie directly to the code that is written. • Developers know what test cases they should write to accommodate TDD. • All the underlying benefits of TDD become more easily realized. • Code is easier to maintain. • Code is self documenting. • Stories are easier to “groom” – breakdown, task and plan. • Teams can be more agile. • Developers can be trained / on-boarded easier. • There is more visibility into team progress and status.
  • 18. 18 BDD – Real World Stories Expressing Acceptance Criteria as BDD scenarios breaks the bottle neck in story writing for a small financial services company in Scottsdale, Arizona.
  • 19. 19 BDD – Real World Stories BDD provides support necessary to successfully deliver MVP into production in record time for financial services company in San Antonio, Texas.
  • 20. 20 Adopting BDD – Three Simple Steps Step One Write our story acceptance criteria using BDD scenarios Step Two Leverage these BDD scenarios to write our automated tests first in true TDD fashion Step Three Leverage a BDD Tool like Cucumber to map human-readable BDD scenarios to the automated tests
  • 21. 21 Step One – Write Acceptance Criteria in BDD Style Step One is accomplished by the three amigos - Product Owner, Developer(s) and Quality Assurance Person(s). Step One is accomplished during Story Refinement which is where we go into detail for the stories that we believe we will take during the next iteration. This is the first step in transitioning to BDD and the one that brings the most benefit. It was a pleasant surprise to Dan North and crew, something that they did not plan. Better communication equals better quality.
  • 22. 22 Step One – Write Acceptance Criteria in BDD Style The Story Customer Withdraws Cash As a customer, I want to withdraw cash from an ATM, So that I don’t have to wait in line at the bank.
  • 23. 23 Step One – Write Acceptance Criteria in BDD Style The Story Customer Withdraws Cash Scenario 1 - Account is In Credit Given the account is in credit And the card is valid And the dispenser contains cash When the customer requests cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned
  • 24. 24 Step One – Write Acceptance Criteria in BDD Style The Story Customer Withdraws Cash Scenario 2 - Account is overdrawn past the overdraft limit Given the account is overdrawn And the card is valid When the customer requests cash Then ensure a rejection message is displayed And ensure cash is not dispensed And ensure the card is returned
  • 25. 25 Step Two – Use BDD Scenarios to Write Tests In step two we leverage BDD to write our tests and begin the process of TDD. BDD scenarios can be written directly into tests using comments.
  • 26. 26 Step Two – Use BDD Scenarios to Write Tests public class AccountIsInCredit extends TestCase { @Setup //Scenario 1 - Account is In Credit // Given the account is in credit // And the card is valid // And the dispenser contains cash //Write code here to mock out account and add credit, mock out card and set as valid, etc.
  • 27. 27 Step Two – Use BDD Scenarios to Write Tests //When the customer requests cash Call CustomerRequestsCash (Amount) //call method on class and pass values @Test //Then ensure the account is debited // And ensure cash is dispensed // And ensure the card is returned Assert.AssertEquals(ExpectedAccountBalance, Account.Balance); Assert.AssertEquals(CashDispensed, True); Assert.AssertEquals(CardReturned, True); }
  • 28. 28 Step Three – Use a BDD Tool • BDD Tool will take human-readable scenarios and use regular expressions to map the human readable scenarios to Unit Tests. • BDD Tools will create a unit test and shell automatically (referred to as a step definition file) that helps in the creation of test. • When the BDD Tool runs the tests, the output shows which tests passed and failed against the human-readable scenarios. • There are BDD Tools for all major languages. I recommend Cucumber for Java and Ruby.
  • 29. 29 Step Three – Use a BDD Tool Scenario: Valid Log On Given user navigates to logon page When they enter valid user name and password Then login should be successful
  • 30. 30 Step Three – Use a BDD Tool @Given("^user navigates to logonpage$") pending # express the regexp above with the code you wish you had end @When("^they enter valid Username as "([^"]*)" and Password as "([^"]*)"$") pending # express the regexp above with the code you wish you had end @Then("^login should be successful$") pending # express the regexp above with the code you wish you had end
  • 31. 31 Step Three – Use a BDD Tool @Given("^user navigates to logonpage$") public void goToLogonPage() { driver = new FirefoxDriver(); driver.navigate().to(“logonpage.htm"); } end @When("^they enter valid Username as "([^"]*)" and Password as "([^"]*)"$") public void ValidUserNameAndPassword(String arg1, String arg2) { driver.findElement(By.id("email")).sendKeys(arg1); driver.findElement(By.id("pass")).sendKeys(arg2); driver.findElement(By.id(“submit")).click(); } end
  • 32. 32 Step Three – Use a BDD Tool #encoding: utf-8 Feature: Logging On Scenario: Valid Log On # /logom:8 Given user navigates to logon page # /step_defs/logon.rb:3 When they enter valid user name and password # /step_defs/logon.rb:7 Then login should be successful # /step_defs/logon.rb:14 1 scenario (1 passed) 3 steps (3 passed) 0m0.005s
  • 33. 33 Step Three – Use a BDD Tool
  • 34. 34 Bonus Step – Manage Your BDD Test Suite
  • 35. 35 Helpful Links Dan North - Introduction to BDD The Cucumber Book: Behaviour-Driven Development for Testers and Developers BDD in Action: Behavior-driven development for the whole software lifecycle Specification by Example: How Successful Teams Deliver the Right Software Cucumber Tool Serenity Tool Clean Code: A Handbook of Software Craftsmanship
  • 38. 38 Your trusted outsourcing partner for Agile software product development. Synerzip • Accelerate the delivery of your product roadmap • Address technology skill gaps • Save at least 50% with offshore software development • Augment your team with optional on-site professionals
  • 40. 40©SYNERZIP2017Corporate Overview 40 Connect with Synerzip @Synerzip linkedin.com/company/synerzip facebook.com/Synerzip
  • 41. 41 LIVE EVENTS in August AGILE2017 Conference Top 10

Notes de l'éditeur

  1. Tell the story about how I became associated with BDD because it is a good example of the efficacy of retrospectives. – BDD Questions – When do we do the BDD scenarios as acceptance criteria?
  2. Most of what we refer to as QA in software development is usually inspection after the fact. In the case of Waterfall, far after the fact. Behavior Driven Development (BDD) provides us with the ability to inject quality into our product instead of merely inspecting after the fact. It moves testing to the beginning of the process instead of the end, creating a higher quality product that can be built quickly.
  3. Robert “Uncle Bob” Martin is a software development professional since 1970, co-author of the original Agile Manifesto, author of numerous books on code quality including Clean Code: A handbook of Agile Software Craftsmanship.
  4. BDD and TDD provide us with the executable tests of the code we write.
  5. Being able to read code is more important than writing it. Being able to write readable code is critical to success and speed.
  6. From POC to customers hands in less than 90 days. When it was over, they went on “barnstorming” sessions to teach BDD throughout the organization, touting their success. One quote I remember from their training was that there were times they were inclined to write code first without using BDD and TDD because they thought it would be faster. It was this code that had the most problems and took longer to bring to the quality they wanted.
  7. Notice that the scenario is basically a test case. It has prerequisite Given – where am I and what am I doing, it has a change to the system – When and then it has the systems reaction to the behavior change – Then.
  8. The Givens will be mostly the realm of QA because it takes a QA mindset. The Thens are the realm of the Product Owner – as a business how do you want the system to react when this change occurs.
  9. This particular technique was suggested from the San Antonio financial services team I worked with.
  10. There is also SpecFlow for .Net, Lettuce for Python, Spock for Groovy, Jbehave for Java.