SlideShare a Scribd company logo
TDD
Test Driven Development
Software Quality
• A definition in Steve McConnell's Code
Complete divides software into two pieces:
internal and external quality
characteristics.
• External quality characteristics are those
parts of a product that face its users,
where internal quality characteristics are
those that do not.
ISO/IEC 9126-1:2001(E)
Internal and External Features
•
•
•
•
•
•

Functionality
Reliability
Usability
Efficiency
Maintainability
Portability
ISO/IEC 9126-1:2001(E)
Quality-in-use features
•
•
•
•

Effectiveness
Productivity
Safety
Customer Satisfaction

• It is the user’s view of the quality of the
software product when it is used in a specific
environment and a specific Context-Of-Use.
TDD in summary
A. First we write a test.
B. Then we write code to make the test
pass.
C. Then we find the best possible design for
what we have - refactoring (Relying on the
existing tests to keep us from breaking things
while we are at it)
TDD goals
•

TDD is a technique for improving the
software’s internal quality

Well-written code
• Good design
• A balanced division of responsibilities
• Without duplication (clones)
• Smooth evolution
• Maintainability
ATDD goals
• Acceptance TDD helps us keep our
product’s external quality on track by
giving it the correct features and
functionality.
• the system should meet what the
customer actually need.
Both sides of quality
************************************

• Then, we need to learn how to build the
thing right - TDD.
• Also, we need to learn how to build the
right thing - ATDD.
TDD and ATDD
Meeting needs with acceptance
TDD
Traditional way of
adding features
• Requirements – doc
• Implementation – sc
• Test design – tc
• Developer Test – rep.
• Acceptance test

Acceptance TDD
• Requirements – doc
• Test design – tc
• Implementation – sc
• Developer Test – rep
• Acceptance test
What is the difference?
• With ATTD we translate a requirement into a set
of executable tests and then do the
implementation against the tests rather than
against the developer’s interpretation of a verbal
requirement.
• Rather than working off of arbitrary requirements
documents, in acceptance TDD we strive for
close collaboration and defining explicit,
unambiguous tests that tell us exactly what it
means when we say a feature is “done.”
Close relationship
• TDD and acceptance TDD often go hand
in hand. On the system level, we run our
development process with acceptance
TDD; and inside the implementation step
of each feature; we employ TDD.
Benefits?
• No more long debugging sessions
– Each test case corresponds to a feature of the
system
– Test cases support refactoring

• More time for other stuff
– Reduce time of debugging sessions
– Reduce time fixing bugs
– Reduce rework due to misunderstandings
regarding requirements
Benefits?
• Feeling confident with my work
– The better your test suite is, the better the
quality of your code and the more confident
you can be about any changes you make. The
more confident you are about the changes
you make, the more changes you dare to
make. The more changes you make, the
better your internal quality becomes, the
easier it is to write tests for your code, and so
on. (a virtuous cycle)
Build it right: TDD
• TDD is a development and design
technique that helps us build up the
system incrementally, knowing that we’re
never far from a working baseline.
• A test is our way of taking that next small
step.
Build it right: TDD
• Test-Code-Refactor
Build it right: TDD
• Test-Code-Refactor

The term refactoring is used to better
communicate that the last step is about
transforming the current design toward a
better design.
First we write a test
• We are writing a test. Also, we are making
design decisions:
– We are designing the API—the interface for
accessing the functionality we’re testing.
– The test case that we design will be the first
“client” of the functionality that we are going
to implement.
– One of the fundamental lessons in designing
an interface is that we only evaluate a design
effectively and objectively when we try to use
it.
Then we write just enough code
• The second step of the TDD cycle is to
write just enough code to make the test
pass.
• You’re satisfying an explicit, unambiguous
requirement expressed by a test.
And then we refactor
• Take a step back, look at our design, and
figure out ways of making it better.
• It is all about keeping your software in
good health—at all times.
• Refactoring is about applying refactorings
on code in a controlled manner
Keeping code healthy with
refactoring
• “a disciplined technique for restructuring
an existing body of code, altering its
internal structure without changing its
external behavior” : Martin Fowler
Refactoring Example
• Replace Inheritance with Delegation
– Motivation: A subclass uses only part of a
superclass interface or does not want to
inherit data
– Summary: Create a field for the superclass,
adjust methods to delegate to the
superclass, and remove the subclassing.
Refactoring Example
Refactoring Example
•

Mechanics
1. Create a field in the subclass that refers to
an instance of the superclass. Initialize it to
this.
2. Change each method defined in the
subclass to use the delegate field.
3. Compile and test after changing each
method.
Refactoring Example
•

Mechanics
4. Remove the subclass declaration and
replace the delegate assignment with an
assignment to a new object.
5. For each superclass method used by a
client, add a simple delegating method.
6. Compile and test.
Refactorings alter internal
structure
• Many of the refactorings are very low-level
– rename method
– Rename variable

• Low-level refactorings are the fundamental
building blocks to achieving larger
refactorings
– Moving the responsibilities around in your
code
– Introducing or removing an inheritance
hierarchy
Refactorings preserve behavior
• whatever transformations you apply to the
existing code, those transformations
should only affect the code’s design and
structure—not its externally visible
behavior or functionality.
– Renaming a method that is part of a class’s
public interface - ???
– how can we be sure that our refactorings
haven’t changed the code’s external
behavior? - ???
The big picture of developing
software in small increments.
The big picture of developing
software in small increments.
Acceptance TDD
• Acceptance tests are indicators of the
completion of a requirement or feature.
• When all acceptance tests for a
requirement or feature are passing, you
know you’re done.
Advantages of ATDD
• Close collaboration
– Seeing concrete, working software
– Building trust and confidence
– Customer in control
– Evolving a shared language

• Tests as a shared language
– Tests as specification
– Specification by example
Tools for test-driven
development
• Unit-testing with xUnit
– Provides supporting code for writing unit tests,
running them, and reporting the test results.

• Test frameworks for acceptance TDD
– Tools for enhancing collaboration in software
development. (Fit and Fitnesse)
– They enable customers, testers, and programmers to
learn what their software should do, and to
automatically compare that to what it actually does
do.
– They compare customers' expectations to actual
results.
FitNesse
• FitNesse is a lightweight, open-source
framework that makes it easy for software
teams to:
– Collaboratively define Acceptance tests -- web
pages containing simple tables of inputs and
expected outputs.
– Run those tests and see the results

• http://fitnesse.org/
Tools for test-driven
development
• Continuous integration and builds
– On the one hand, running the full test suite
often takes too long (several minutes—even
hours) for a developer to wait for the green
bar.
– On the other hand, most of the tests are
unlikely to have been affected by the
developer’s recent changes
Tools for test-driven
development
• Continuous integration and builds
Build servers galore
• Cruise-Control (http://cruisecontrol.sf.net)
• AntHill (http://www.urbancode.com)
• Continuum (
http://maven.apache.org/continuum)
• Bamboo (
http://www.atlassian.com/software/bamboo/
)
Continuous Integration references
• More about the philosophy behind
continuous integration and the associated
tools:
– http://www.martinfowler.com/articles/continuo
usIntegration.html.
– http://www.jamesshore.com.
Tools for test-driven
development
• Code coverage

– In short, code coverage is a measurement of
how thoroughly our automated tests exercise
the production code and its source code
statements, branches, and expressions.
– http://www.javaranch.com/newsletter/200401/Intro
Tools for test-driven
development
• Code coverage
– This can be especially helpful when a team is
just starting to write unit tests or adopting
TDD, because it helps pointing out areas of
the code base that are not getting tested as
thoroughly as other parts of the code.
Tools for test-driven
development
• Code coverage tools for java
– Cenqua Clover (
http://www.cenqua.com/clover)
Cobertura (http://cobertura.sf.net)
EMMA (http://emma.sf.net)

More Related Content

What's hot

Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
Tharinda Liyanage
 
John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013
TEST Huddle
 
Introduction to Software Review
Introduction to Software ReviewIntroduction to Software Review
Introduction to Software ReviewPhilip Johnson
 
Manual Testing Material by Durgasoft
Manual Testing Material by DurgasoftManual Testing Material by Durgasoft
Manual Testing Material by Durgasoft
Durga Prasad
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
didev
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
Gaya1985
 
Software testing
Software testingSoftware testing
Software testing
K Lingaraju
 
Software Engineering Overview
Software Engineering OverviewSoftware Engineering Overview
Software Engineering Overview
Prachi Sasankar
 
Software testing basic concepts
Software testing basic conceptsSoftware testing basic concepts
Software testing basic conceptsHưng Hoàng
 
SW Testing Fundamentals
SW Testing FundamentalsSW Testing Fundamentals
SW Testing Fundamentals
Ismail aboulezz
 
Agile QA process
Agile QA processAgile QA process
Agile QA process
Ashish Agrawal
 
The non intuitive impact of software defects on development efforts time esti...
The non intuitive impact of software defects on development efforts time esti...The non intuitive impact of software defects on development efforts time esti...
The non intuitive impact of software defects on development efforts time esti...
Pragmatic Cohesion Consulting, LLC
 
Interview questions and answers for quality assurance
Interview questions and answers for quality assuranceInterview questions and answers for quality assurance
Interview questions and answers for quality assurance
Garuda Trainings
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
Ajay Danait
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
Chuu Htet Naing
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notes
dkns0906
 
Test Life Cycle - Presentation - Important concepts covered
Test Life Cycle - Presentation - Important concepts coveredTest Life Cycle - Presentation - Important concepts covered
Test Life Cycle - Presentation - Important concepts coveredSunil Kumar Gunasekaran
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussion
ajrhem
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
Dhanasekaran Nagarajan
 

What's hot (20)

Tdd blog
Tdd blogTdd blog
Tdd blog
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
 
John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013John Fodeh Adventures in Test Automation - EuroSTAR 2013
John Fodeh Adventures in Test Automation - EuroSTAR 2013
 
Introduction to Software Review
Introduction to Software ReviewIntroduction to Software Review
Introduction to Software Review
 
Manual Testing Material by Durgasoft
Manual Testing Material by DurgasoftManual Testing Material by Durgasoft
Manual Testing Material by Durgasoft
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
 
Software testing
Software testingSoftware testing
Software testing
 
Software Engineering Overview
Software Engineering OverviewSoftware Engineering Overview
Software Engineering Overview
 
Software testing basic concepts
Software testing basic conceptsSoftware testing basic concepts
Software testing basic concepts
 
SW Testing Fundamentals
SW Testing FundamentalsSW Testing Fundamentals
SW Testing Fundamentals
 
Agile QA process
Agile QA processAgile QA process
Agile QA process
 
The non intuitive impact of software defects on development efforts time esti...
The non intuitive impact of software defects on development efforts time esti...The non intuitive impact of software defects on development efforts time esti...
The non intuitive impact of software defects on development efforts time esti...
 
Interview questions and answers for quality assurance
Interview questions and answers for quality assuranceInterview questions and answers for quality assurance
Interview questions and answers for quality assurance
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notes
 
Test Life Cycle - Presentation - Important concepts covered
Test Life Cycle - Presentation - Important concepts coveredTest Life Cycle - Presentation - Important concepts covered
Test Life Cycle - Presentation - Important concepts covered
 
AJRA Test Strategy Discussion
AJRA Test Strategy DiscussionAJRA Test Strategy Discussion
AJRA Test Strategy Discussion
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
 

Viewers also liked

An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
Blue Elephant Consulting
 
London SDET Meetup (April 2016) - M&S Digital Test Journey
London SDET Meetup (April 2016) - M&S Digital Test JourneyLondon SDET Meetup (April 2016) - M&S Digital Test Journey
London SDET Meetup (April 2016) - M&S Digital Test Journey
Richard Chernanko
 
Software architecture...Yes, on tests!
Software architecture...Yes, on tests!Software architecture...Yes, on tests!
Software architecture...Yes, on tests!
Codemotion
 
Pratap Kumar Nallamothu SDET2
Pratap Kumar Nallamothu SDET2Pratap Kumar Nallamothu SDET2
Pratap Kumar Nallamothu SDET2pratap kumar
 
Testing without Testers
Testing without TestersTesting without Testers
Testing without Testers
Alan Page
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot Framework
Furkan Ertürk
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
agil8 Ltd
 
JavaOne 2016 :: Bringing Robot online with Robo4j Framework
JavaOne 2016 :: Bringing Robot online with Robo4j FrameworkJavaOne 2016 :: Bringing Robot online with Robo4j Framework
JavaOne 2016 :: Bringing Robot online with Robo4j Framework
Miro Wengner
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
Fachrul Choliluddin
 
Rf meetup 16.3.2017 tampere share
Rf meetup 16.3.2017 tampere shareRf meetup 16.3.2017 tampere share
Rf meetup 16.3.2017 tampere share
Mika Tavi
 
Robot framework
Robot frameworkRobot framework
Robot framework
Prayoch Rujira
 
The Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven DevelopmentThe Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven Development
Lemi Orhan Ergin
 
Robot Framework
Robot FrameworkRobot Framework
Robot Framework
Onur Baskirt
 
The automated tests inside Openshift
The automated tests inside OpenshiftThe automated tests inside Openshift
The automated tests inside Openshift
Oleg Popov
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
Pekka Klärck
 
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan PeshovJavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
laurent bristiel
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
laurent bristiel
 
Fit for Work – key questions from employers
 Fit for Work – key questions from employers Fit for Work – key questions from employers
Fit for Work – key questions from employers
Fit for Work
 
ATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot Framework
Agile Testing Alliance
 

Viewers also liked (20)

An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 
London SDET Meetup (April 2016) - M&S Digital Test Journey
London SDET Meetup (April 2016) - M&S Digital Test JourneyLondon SDET Meetup (April 2016) - M&S Digital Test Journey
London SDET Meetup (April 2016) - M&S Digital Test Journey
 
Software architecture...Yes, on tests!
Software architecture...Yes, on tests!Software architecture...Yes, on tests!
Software architecture...Yes, on tests!
 
Pratap Kumar Nallamothu SDET2
Pratap Kumar Nallamothu SDET2Pratap Kumar Nallamothu SDET2
Pratap Kumar Nallamothu SDET2
 
Testing without Testers
Testing without TestersTesting without Testers
Testing without Testers
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot Framework
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
 
JavaOne 2016 :: Bringing Robot online with Robo4j Framework
JavaOne 2016 :: Bringing Robot online with Robo4j FrameworkJavaOne 2016 :: Bringing Robot online with Robo4j Framework
JavaOne 2016 :: Bringing Robot online with Robo4j Framework
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
Rf meetup 16.3.2017 tampere share
Rf meetup 16.3.2017 tampere shareRf meetup 16.3.2017 tampere share
Rf meetup 16.3.2017 tampere share
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
The Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven DevelopmentThe Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven Development
 
Robot Framework
Robot FrameworkRobot Framework
Robot Framework
 
The automated tests inside Openshift
The automated tests inside OpenshiftThe automated tests inside Openshift
The automated tests inside Openshift
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan PeshovJavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
Fit for Work – key questions from employers
 Fit for Work – key questions from employers Fit for Work – key questions from employers
Fit for Work – key questions from employers
 
ATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot Framework
 

Similar to Test Driven Development

{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
AmalEldhose2
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
BSGAfrica
 
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
QA or the Highway
 
Software presentation
Software presentationSoftware presentation
Software presentation
JennaPrengle
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Sergey Aganezov
 
Testing in the new age of DevOps
Testing in the new age of DevOpsTesting in the new age of DevOps
Testing in the new age of DevOps
Moataz Mahmoud
 
Lecture3.se.pptx
Lecture3.se.pptxLecture3.se.pptx
Lecture3.se.pptx
Amna Ch
 
01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.
mailtoahmedhassan
 
11. SE_Quality Assurance.pptx
11. SE_Quality Assurance.pptx11. SE_Quality Assurance.pptx
11. SE_Quality Assurance.pptx
SaqibHabib11
 
DevOps Overview in my own words
DevOps Overview in my own wordsDevOps Overview in my own words
DevOps Overview in my own words
SUBHENDU KARMAKAR
 
Test-Driven-Development.pptx
Test-Driven-Development.pptxTest-Driven-Development.pptx
Test-Driven-Development.pptx
dheeraj438799
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
AgileNetwork
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
Talentica Software
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2
Raj vardhan
 
Test Environment: An Essential Component Of The DevSecOps Framework
Test Environment: An Essential Component Of The DevSecOps FrameworkTest Environment: An Essential Component Of The DevSecOps Framework
Test Environment: An Essential Component Of The DevSecOps Framework
Enov8
 
How to fit Performance Testing in Devops environment.pptx.pdf
How to fit Performance Testing in Devops environment.pptx.pdfHow to fit Performance Testing in Devops environment.pptx.pdf
How to fit Performance Testing in Devops environment.pptx.pdf
Knoldus Inc.
 
An introduction to Software Testing and Test Management
An introduction to Software Testing and Test ManagementAn introduction to Software Testing and Test Management
An introduction to Software Testing and Test Management
Anuraj S.L
 
software testing
 software testing software testing
software testing
Sara shall
 

Similar to Test Driven Development (20)

{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
 
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
 
Software Development
Software DevelopmentSoftware Development
Software Development
 
Software presentation
Software presentationSoftware presentation
Software presentation
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Testing in the new age of DevOps
Testing in the new age of DevOpsTesting in the new age of DevOps
Testing in the new age of DevOps
 
Lecture3.se.pptx
Lecture3.se.pptxLecture3.se.pptx
Lecture3.se.pptx
 
01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.01- Lecture -Introduction to IT Agile Development.
01- Lecture -Introduction to IT Agile Development.
 
11. SE_Quality Assurance.pptx
11. SE_Quality Assurance.pptx11. SE_Quality Assurance.pptx
11. SE_Quality Assurance.pptx
 
DevOps Overview in my own words
DevOps Overview in my own wordsDevOps Overview in my own words
DevOps Overview in my own words
 
Test-Driven-Development.pptx
Test-Driven-Development.pptxTest-Driven-Development.pptx
Test-Driven-Development.pptx
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
 
Bdd with m spec
Bdd with m specBdd with m spec
Bdd with m spec
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2
 
Test Environment: An Essential Component Of The DevSecOps Framework
Test Environment: An Essential Component Of The DevSecOps FrameworkTest Environment: An Essential Component Of The DevSecOps Framework
Test Environment: An Essential Component Of The DevSecOps Framework
 
How to fit Performance Testing in Devops environment.pptx.pdf
How to fit Performance Testing in Devops environment.pptx.pdfHow to fit Performance Testing in Devops environment.pptx.pdf
How to fit Performance Testing in Devops environment.pptx.pdf
 
An introduction to Software Testing and Test Management
An introduction to Software Testing and Test ManagementAn introduction to Software Testing and Test Management
An introduction to Software Testing and Test Management
 
software testing
 software testing software testing
software testing
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Test Driven Development

  • 2. Software Quality • A definition in Steve McConnell's Code Complete divides software into two pieces: internal and external quality characteristics. • External quality characteristics are those parts of a product that face its users, where internal quality characteristics are those that do not.
  • 3. ISO/IEC 9126-1:2001(E) Internal and External Features • • • • • • Functionality Reliability Usability Efficiency Maintainability Portability
  • 4. ISO/IEC 9126-1:2001(E) Quality-in-use features • • • • Effectiveness Productivity Safety Customer Satisfaction • It is the user’s view of the quality of the software product when it is used in a specific environment and a specific Context-Of-Use.
  • 5. TDD in summary A. First we write a test. B. Then we write code to make the test pass. C. Then we find the best possible design for what we have - refactoring (Relying on the existing tests to keep us from breaking things while we are at it)
  • 6. TDD goals • TDD is a technique for improving the software’s internal quality Well-written code • Good design • A balanced division of responsibilities • Without duplication (clones) • Smooth evolution • Maintainability
  • 7. ATDD goals • Acceptance TDD helps us keep our product’s external quality on track by giving it the correct features and functionality. • the system should meet what the customer actually need.
  • 8. Both sides of quality ************************************ • Then, we need to learn how to build the thing right - TDD. • Also, we need to learn how to build the right thing - ATDD.
  • 10. Meeting needs with acceptance TDD Traditional way of adding features • Requirements – doc • Implementation – sc • Test design – tc • Developer Test – rep. • Acceptance test Acceptance TDD • Requirements – doc • Test design – tc • Implementation – sc • Developer Test – rep • Acceptance test
  • 11. What is the difference? • With ATTD we translate a requirement into a set of executable tests and then do the implementation against the tests rather than against the developer’s interpretation of a verbal requirement. • Rather than working off of arbitrary requirements documents, in acceptance TDD we strive for close collaboration and defining explicit, unambiguous tests that tell us exactly what it means when we say a feature is “done.”
  • 12. Close relationship • TDD and acceptance TDD often go hand in hand. On the system level, we run our development process with acceptance TDD; and inside the implementation step of each feature; we employ TDD.
  • 13. Benefits? • No more long debugging sessions – Each test case corresponds to a feature of the system – Test cases support refactoring • More time for other stuff – Reduce time of debugging sessions – Reduce time fixing bugs – Reduce rework due to misunderstandings regarding requirements
  • 14. Benefits? • Feeling confident with my work – The better your test suite is, the better the quality of your code and the more confident you can be about any changes you make. The more confident you are about the changes you make, the more changes you dare to make. The more changes you make, the better your internal quality becomes, the easier it is to write tests for your code, and so on. (a virtuous cycle)
  • 15. Build it right: TDD • TDD is a development and design technique that helps us build up the system incrementally, knowing that we’re never far from a working baseline. • A test is our way of taking that next small step.
  • 16. Build it right: TDD • Test-Code-Refactor
  • 17. Build it right: TDD • Test-Code-Refactor The term refactoring is used to better communicate that the last step is about transforming the current design toward a better design.
  • 18. First we write a test • We are writing a test. Also, we are making design decisions: – We are designing the API—the interface for accessing the functionality we’re testing. – The test case that we design will be the first “client” of the functionality that we are going to implement. – One of the fundamental lessons in designing an interface is that we only evaluate a design effectively and objectively when we try to use it.
  • 19. Then we write just enough code • The second step of the TDD cycle is to write just enough code to make the test pass. • You’re satisfying an explicit, unambiguous requirement expressed by a test.
  • 20. And then we refactor • Take a step back, look at our design, and figure out ways of making it better. • It is all about keeping your software in good health—at all times. • Refactoring is about applying refactorings on code in a controlled manner
  • 21. Keeping code healthy with refactoring • “a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior” : Martin Fowler
  • 22. Refactoring Example • Replace Inheritance with Delegation – Motivation: A subclass uses only part of a superclass interface or does not want to inherit data – Summary: Create a field for the superclass, adjust methods to delegate to the superclass, and remove the subclassing.
  • 24. Refactoring Example • Mechanics 1. Create a field in the subclass that refers to an instance of the superclass. Initialize it to this. 2. Change each method defined in the subclass to use the delegate field. 3. Compile and test after changing each method.
  • 25. Refactoring Example • Mechanics 4. Remove the subclass declaration and replace the delegate assignment with an assignment to a new object. 5. For each superclass method used by a client, add a simple delegating method. 6. Compile and test.
  • 26. Refactorings alter internal structure • Many of the refactorings are very low-level – rename method – Rename variable • Low-level refactorings are the fundamental building blocks to achieving larger refactorings – Moving the responsibilities around in your code – Introducing or removing an inheritance hierarchy
  • 27. Refactorings preserve behavior • whatever transformations you apply to the existing code, those transformations should only affect the code’s design and structure—not its externally visible behavior or functionality. – Renaming a method that is part of a class’s public interface - ??? – how can we be sure that our refactorings haven’t changed the code’s external behavior? - ???
  • 28. The big picture of developing software in small increments.
  • 29. The big picture of developing software in small increments.
  • 30. Acceptance TDD • Acceptance tests are indicators of the completion of a requirement or feature. • When all acceptance tests for a requirement or feature are passing, you know you’re done.
  • 31. Advantages of ATDD • Close collaboration – Seeing concrete, working software – Building trust and confidence – Customer in control – Evolving a shared language • Tests as a shared language – Tests as specification – Specification by example
  • 32. Tools for test-driven development • Unit-testing with xUnit – Provides supporting code for writing unit tests, running them, and reporting the test results. • Test frameworks for acceptance TDD – Tools for enhancing collaboration in software development. (Fit and Fitnesse) – They enable customers, testers, and programmers to learn what their software should do, and to automatically compare that to what it actually does do. – They compare customers' expectations to actual results.
  • 33. FitNesse • FitNesse is a lightweight, open-source framework that makes it easy for software teams to: – Collaboratively define Acceptance tests -- web pages containing simple tables of inputs and expected outputs. – Run those tests and see the results • http://fitnesse.org/
  • 34. Tools for test-driven development • Continuous integration and builds – On the one hand, running the full test suite often takes too long (several minutes—even hours) for a developer to wait for the green bar. – On the other hand, most of the tests are unlikely to have been affected by the developer’s recent changes
  • 35. Tools for test-driven development • Continuous integration and builds
  • 36. Build servers galore • Cruise-Control (http://cruisecontrol.sf.net) • AntHill (http://www.urbancode.com) • Continuum ( http://maven.apache.org/continuum) • Bamboo ( http://www.atlassian.com/software/bamboo/ )
  • 37. Continuous Integration references • More about the philosophy behind continuous integration and the associated tools: – http://www.martinfowler.com/articles/continuo usIntegration.html. – http://www.jamesshore.com.
  • 38. Tools for test-driven development • Code coverage – In short, code coverage is a measurement of how thoroughly our automated tests exercise the production code and its source code statements, branches, and expressions. – http://www.javaranch.com/newsletter/200401/Intro
  • 39. Tools for test-driven development • Code coverage – This can be especially helpful when a team is just starting to write unit tests or adopting TDD, because it helps pointing out areas of the code base that are not getting tested as thoroughly as other parts of the code.
  • 40. Tools for test-driven development • Code coverage tools for java – Cenqua Clover ( http://www.cenqua.com/clover) Cobertura (http://cobertura.sf.net) EMMA (http://emma.sf.net)