SlideShare a Scribd company logo
1 of 30
Download to read offline
© 2013 iZenBridge | CONFIDENTIAL
Introduction
to
Test Driven
Development
(TDD)
© 2013 iZenBridge | CONFIDENTIAL
Introductions!
1.Your Name
2.Current company & Role
3.Experience with Agile and TDD
© 2013 iZenBridge | CONFIDENTIAL
Agile Software Development
© 2013 iZenBridge | CONFIDENTIAL
Traditional Design – Code – Test
Design Code Test
Test Code
Design /
Refactor
© 2013 iZenBridge | CONFIDENTIAL
Why Not Testing at the End?
• Hard to improve quality of
existing code –
Complacency and Recency
• Feedback opportunity is
lost
• The future state of the
project is difficult to gauge
• Testing is more likely to be
cut
© 2013 iZenBridge | CONFIDENTIAL
Stress and Testing
Project
Stress
Less
Testing
Just get it done, will ya?
© 2013 iZenBridge | CONFIDENTIAL
Test Automation Pyramid
UI
Service
Unit
UI
Service
Unit
AgileTraditional
© 2013 iZenBridge | CONFIDENTIAL
Test First Development
ATDD and TDD
© 2013 iZenBridge | CONFIDENTIAL
ATDD vs TDD
Source: Test Driven: Practical TDD and Acceptance TDD for Java Developers
© 2013 iZenBridge | CONFIDENTIAL
Why TDD?
The Benefits of TDD:
• Limits WIP – a key Lean principle
• Ensures testing at lower granularity level – the smallest
testable unit of code
• Ensures no untested code goes to production
• Helps high degree of conformity between code and the
real business requirements
• Helps keep unused code out of the system (unwritten)
• Makes codebase more maintainable – via regression
testing
© 2013 iZenBridge | CONFIDENTIAL
The TDD Cycle
 Red
 Green
 Clean
Test
Code
Refactor
© 2013 iZenBridge | CONFIDENTIAL
Three Laws/ Rules of TDD
You will not write any production
code until you have written a failing
unit test.
First Law
© 2013 iZenBridge | CONFIDENTIAL
Three laws of TDD
You will not write more of a unit
test than is sufficient to fail, and
not compiling is failing
Second Law
© 2013 iZenBridge | CONFIDENTIAL
Three laws of TDD
You will not write more production
code that is sufficient to pass the
currently failing test.
Third Law
© 2013 iZenBridge | CONFIDENTIAL
Misconceptions About TDD
• Writing code first, then tests is
same as TDD
• TDD isn’t useful for designing
architecture
• Takes too much time
• Too complex to learn and
implement
• TDD is only good for small
projects
© 2013 iZenBridge | CONFIDENTIAL
© 2013 iZenBridge | CONFIDENTIAL
Let’s Build Something Now!
© 2013 iZenBridge | CONFIDENTIAL
String Calculator – TDD Exercise
Define Scope:
• Supported operators?
• Acceptable characters?
• Whitespace?
• Max length of expression – number of operations?
• Max length of each number?
• Fractions?
• Parenthesis?
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
Time to start Failing!
• Reminders:
• Test, Code, Refactor – REPEAT until Done!
• Add feature layers one by one, in small manageable
increments
• Setup
• Eclipse for Java Development
• JDK
• Team formation
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
1. Two literal addition
A + B
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
2. Multiple literal addition
A + B + C
A + B + C + D
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
3. Combination of addition and
subtraction
A + B – C
or
A – B + C
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
4. Simple multiplication
A * B
A * B * C
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
5. Simple division
A / B
A / B / C
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
6. Combination of multiplication
and division
A * B / C
A / B * C
Does order matter?
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
7. Combination of all four
A + B – C * D / E
Order does matter here!
© 2013 iZenBridge | CONFIDENTIAL
String Calculator (continued)
8. Invalid expressions
• Banned chars - alpha, parenthesis, special chars
• Space between a number
• Two operators clubbed together
• First number negative
• Invalid decimal number
© 2013 iZenBridge | CONFIDENTIAL
What Next?
Certified Scrum Developer (CSD)
A 3-day course certified by Scrum Alliance that focuses on
specialized Agile engineering skills:
 Test Driven Development (TDD)
 ATDD, BDD – Selenium/ Cucumber
 Continuous Integration – Jenkins
 Agile Design and Architecture
 Refactoring
 Collaboration
© 2013 iZenBridge | CONFIDENTIAL
References
 Test Driven Development: By Example - Kent Beck
 Succeeding with Agile - Mike Cohn
 Test Driven: Practical TDD and Acceptance TDD for Java
Developers - Lasse Koskela
© 2013 iZenBridge | CONFIDENTIAL
Stay Connected
YouTube
www.youtube.com/izenbridge
LinkedIn Group
PMI-ACP: Agile Certification Made Easy
Saket.Bansal@iZenBridge.com
SunjayKumar@gmail.com
www.iZenBridge.com
forum.iZenBridge.com

More Related Content

What's hot

Realize the opportunity - with DevOps
Realize the opportunity - with DevOpsRealize the opportunity - with DevOps
Realize the opportunity - with DevOps
Jeff Findlay
 

What's hot (20)

Webinar On Collect Requirement - iZenBridge
Webinar On Collect Requirement - iZenBridgeWebinar On Collect Requirement - iZenBridge
Webinar On Collect Requirement - iZenBridge
 
Agile Beyond Rituals | Presented at Agile Noida
Agile Beyond Rituals | Presented at Agile Noida Agile Beyond Rituals | Presented at Agile Noida
Agile Beyond Rituals | Presented at Agile Noida
 
Plan Risk Responses : PMP : Project Risk Management
Plan Risk Responses : PMP : Project Risk ManagementPlan Risk Responses : PMP : Project Risk Management
Plan Risk Responses : PMP : Project Risk Management
 
Webinar On Scaled Agile Framework (SAFe) | iZenBridge
Webinar On Scaled Agile Framework (SAFe) | iZenBridgeWebinar On Scaled Agile Framework (SAFe) | iZenBridge
Webinar On Scaled Agile Framework (SAFe) | iZenBridge
 
Андрій Просов "Fixed Price Agile Projects: Challenges for Project Manager" Kh...
Андрій Просов "Fixed Price Agile Projects: Challenges for Project Manager" Kh...Андрій Просов "Fixed Price Agile Projects: Challenges for Project Manager" Kh...
Андрій Просов "Fixed Price Agile Projects: Challenges for Project Manager" Kh...
 
About Gandhavalla Informatics Pvt Ltd.
About Gandhavalla Informatics Pvt Ltd.About Gandhavalla Informatics Pvt Ltd.
About Gandhavalla Informatics Pvt Ltd.
 
Is a Business Analyst required on an agile team?
Is a Business Analyst required on an agile team?Is a Business Analyst required on an agile team?
Is a Business Analyst required on an agile team?
 
Kaizen - A journey of discovery | memoQfest 2014 | Budapest, Hungary
Kaizen - A journey of discovery | memoQfest 2014 | Budapest, HungaryKaizen - A journey of discovery | memoQfest 2014 | Budapest, Hungary
Kaizen - A journey of discovery | memoQfest 2014 | Budapest, Hungary
 
Top 5 Considerations for DevOps Success in 2018
Top 5 Considerations for DevOps Success in 2018Top 5 Considerations for DevOps Success in 2018
Top 5 Considerations for DevOps Success in 2018
 
Realize the opportunity - with DevOps
Realize the opportunity - with DevOpsRealize the opportunity - with DevOps
Realize the opportunity - with DevOps
 
Myths of Product Development
Myths of Product DevelopmentMyths of Product Development
Myths of Product Development
 
Pair programming pair testing working together with the developers by Simon ...
Pair programming  pair testing working together with the developers by Simon ...Pair programming  pair testing working together with the developers by Simon ...
Pair programming pair testing working together with the developers by Simon ...
 
A-TDD workshop Testnet
A-TDD workshop Testnet A-TDD workshop Testnet
A-TDD workshop Testnet
 
Project To Product: How we transitioned to product-aligned value streams
Project To Product: How we transitioned to product-aligned value streamsProject To Product: How we transitioned to product-aligned value streams
Project To Product: How we transitioned to product-aligned value streams
 
The secret life of an Agile Business Analyst - Sydney Agile Meetup group - 13...
The secret life of an Agile Business Analyst - Sydney Agile Meetup group - 13...The secret life of an Agile Business Analyst - Sydney Agile Meetup group - 13...
The secret life of an Agile Business Analyst - Sydney Agile Meetup group - 13...
 
AgileLIVE: Scaling Agile Faster, Easier, Smarter with SAFe and VersionOne - P...
AgileLIVE: Scaling Agile Faster, Easier, Smarter with SAFe and VersionOne - P...AgileLIVE: Scaling Agile Faster, Easier, Smarter with SAFe and VersionOne - P...
AgileLIVE: Scaling Agile Faster, Easier, Smarter with SAFe and VersionOne - P...
 
Definition of done training
Definition of done trainingDefinition of done training
Definition of done training
 
Kari Kakkonen - Knowit Agile Quality Service
Kari Kakkonen - Knowit Agile Quality ServiceKari Kakkonen - Knowit Agile Quality Service
Kari Kakkonen - Knowit Agile Quality Service
 
Myron Kokhanovskyi: Team Performance Metrics - what are the KPIs of a high pe...
Myron Kokhanovskyi: Team Performance Metrics - what are the KPIs of a high pe...Myron Kokhanovskyi: Team Performance Metrics - what are the KPIs of a high pe...
Myron Kokhanovskyi: Team Performance Metrics - what are the KPIs of a high pe...
 
Agile & KPIs :: Conferencia Agile Spain 2014
Agile & KPIs :: Conferencia Agile Spain 2014Agile & KPIs :: Conferencia Agile Spain 2014
Agile & KPIs :: Conferencia Agile Spain 2014
 

Viewers also liked

Introduction to PMI-ACP
Introduction to PMI-ACPIntroduction to PMI-ACP
Introduction to PMI-ACP
Edureka!
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
Naresh Jain
 

Viewers also liked (15)

Procurement Contract Types | PMP | iZenBridge - Webinar
Procurement Contract Types | PMP | iZenBridge - Webinar Procurement Contract Types | PMP | iZenBridge - Webinar
Procurement Contract Types | PMP | iZenBridge - Webinar
 
Coaching Leadership
Coaching LeadershipCoaching Leadership
Coaching Leadership
 
The Agile Way with PMI-ACP
The Agile Way with PMI-ACPThe Agile Way with PMI-ACP
The Agile Way with PMI-ACP
 
Introduction to PMI-ACP
Introduction to PMI-ACPIntroduction to PMI-ACP
Introduction to PMI-ACP
 
Total quality management
Total quality managementTotal quality management
Total quality management
 
PMP : Webinar on Quality Planning
PMP : Webinar  on Quality PlanningPMP : Webinar  on Quality Planning
PMP : Webinar on Quality Planning
 
Agile Metric | Velocity | PMI ACP | IZenBridge
Agile Metric | Velocity | PMI ACP | IZenBridgeAgile Metric | Velocity | PMI ACP | IZenBridge
Agile Metric | Velocity | PMI ACP | IZenBridge
 
Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed Shreef
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Applying Lean Sigma Into Validation
Applying Lean Sigma Into ValidationApplying Lean Sigma Into Validation
Applying Lean Sigma Into Validation
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
 
PDM - Precedence Diagram Method
PDM - Precedence Diagram MethodPDM - Precedence Diagram Method
PDM - Precedence Diagram Method
 

Similar to Workshop on Test Driven Development (TDD) Noida

Test driven development
Test driven developmentTest driven development
Test driven development
Harry Potter
 
Test driven development
Test driven developmentTest driven development
Test driven development
Luis Goldster
 
Test driven development
Test driven developmentTest driven development
Test driven development
Tony Nguyen
 
Test driven development
Test driven developmentTest driven development
Test driven development
Young Alista
 
Test driven development
Test driven developmentTest driven development
Test driven development
James Wong
 
Test driven development
Test driven developmentTest driven development
Test driven development
Fraboni Ec
 

Similar to Workshop on Test Driven Development (TDD) Noida (20)

Automated agile testing using Cucumber
Automated agile testing using CucumberAutomated agile testing using Cucumber
Automated agile testing using Cucumber
 
Refactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay KumarRefactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay Kumar
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
Test Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetupTest Driven Development presentation delhi meetup
Test Driven Development presentation delhi meetup
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDD
 
Inside Behavior Driven Development
Inside Behavior Driven DevelopmentInside Behavior Driven Development
Inside Behavior Driven Development
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CD
 
Real World TDD
Real World TDDReal World TDD
Real World TDD
 
Obstacle Driven Development
Obstacle Driven DevelopmentObstacle Driven Development
Obstacle Driven Development
 
How adding a further tool can be a good thing
How adding a further tool can be a good thingHow adding a further tool can be a good thing
How adding a further tool can be a good thing
 
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
 
Agile Fundamentals
Agile FundamentalsAgile Fundamentals
Agile Fundamentals
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 

More from Saket Bansal

Technical Debt | PMI - ACP Webinar Series | iZenBridge
Technical Debt | PMI - ACP Webinar Series | iZenBridge Technical Debt | PMI - ACP Webinar Series | iZenBridge
Technical Debt | PMI - ACP Webinar Series | iZenBridge
Saket Bansal
 

More from Saket Bansal (15)

Improving Collaboration by Awareness of Mind Games
Improving Collaboration by Awareness of  Mind GamesImproving Collaboration by Awareness of  Mind Games
Improving Collaboration by Awareness of Mind Games
 
Emotional Intelligence: From Theory to Practice
Emotional Intelligence: From Theory to PracticeEmotional Intelligence: From Theory to Practice
Emotional Intelligence: From Theory to Practice
 
Webinar on Agile and PMBOK® Guide Sixth Edition
Webinar on Agile and PMBOK® Guide Sixth EditionWebinar on Agile and PMBOK® Guide Sixth Edition
Webinar on Agile and PMBOK® Guide Sixth Edition
 
Webinar on Leader As Coach
Webinar on Leader As Coach Webinar on Leader As Coach
Webinar on Leader As Coach
 
Risk Analysis : PMP- Project Risk Management
Risk Analysis : PMP- Project Risk ManagementRisk Analysis : PMP- Project Risk Management
Risk Analysis : PMP- Project Risk Management
 
iZenBridge's PMP® Math Series: Project Selection : PV , NPV, IRR, BCR and Pay...
iZenBridge's PMP® Math Series: Project Selection : PV , NPV, IRR, BCR and Pay...iZenBridge's PMP® Math Series: Project Selection : PV , NPV, IRR, BCR and Pay...
iZenBridge's PMP® Math Series: Project Selection : PV , NPV, IRR, BCR and Pay...
 
Technical Debt | PMI - ACP Webinar Series | iZenBridge
Technical Debt | PMI - ACP Webinar Series | iZenBridge Technical Debt | PMI - ACP Webinar Series | iZenBridge
Technical Debt | PMI - ACP Webinar Series | iZenBridge
 
PMI ACP | Agile Classroom Training Program | iZenBridge Consultancy Private L...
PMI ACP | Agile Classroom Training Program | iZenBridge Consultancy Private L...PMI ACP | Agile Classroom Training Program | iZenBridge Consultancy Private L...
PMI ACP | Agile Classroom Training Program | iZenBridge Consultancy Private L...
 
Webinar On Product Backlog
Webinar On Product BacklogWebinar On Product Backlog
Webinar On Product Backlog
 
Scrum Webinar : Sprints - The Exploration Cycle
Scrum Webinar : Sprints - The Exploration CycleScrum Webinar : Sprints - The Exploration Cycle
Scrum Webinar : Sprints - The Exploration Cycle
 
Webinar : Scrum Roles
Webinar :  Scrum RolesWebinar :  Scrum Roles
Webinar : Scrum Roles
 
Why Agile | Agile Values and Principles
Why Agile | Agile Values and PrinciplesWhy Agile | Agile Values and Principles
Why Agile | Agile Values and Principles
 
Writing User Stories : Agile Way of Capturing Requirements
Writing User Stories : Agile Way of Capturing Requirements Writing User Stories : Agile Way of Capturing Requirements
Writing User Stories : Agile Way of Capturing Requirements
 
Scrum Roles : Scrum Master | Product Owner |Team
Scrum Roles : Scrum Master | Product Owner |TeamScrum Roles : Scrum Master | Product Owner |Team
Scrum Roles : Scrum Master | Product Owner |Team
 
PMI-ACP Lesson 2 : Scrum
PMI-ACP Lesson 2 : ScrumPMI-ACP Lesson 2 : Scrum
PMI-ACP Lesson 2 : Scrum
 

Recently uploaded

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

Workshop on Test Driven Development (TDD) Noida

  • 1. © 2013 iZenBridge | CONFIDENTIAL Introduction to Test Driven Development (TDD)
  • 2. © 2013 iZenBridge | CONFIDENTIAL Introductions! 1.Your Name 2.Current company & Role 3.Experience with Agile and TDD
  • 3. © 2013 iZenBridge | CONFIDENTIAL Agile Software Development
  • 4. © 2013 iZenBridge | CONFIDENTIAL Traditional Design – Code – Test Design Code Test Test Code Design / Refactor
  • 5. © 2013 iZenBridge | CONFIDENTIAL Why Not Testing at the End? • Hard to improve quality of existing code – Complacency and Recency • Feedback opportunity is lost • The future state of the project is difficult to gauge • Testing is more likely to be cut
  • 6. © 2013 iZenBridge | CONFIDENTIAL Stress and Testing Project Stress Less Testing Just get it done, will ya?
  • 7. © 2013 iZenBridge | CONFIDENTIAL Test Automation Pyramid UI Service Unit UI Service Unit AgileTraditional
  • 8. © 2013 iZenBridge | CONFIDENTIAL Test First Development ATDD and TDD
  • 9. © 2013 iZenBridge | CONFIDENTIAL ATDD vs TDD Source: Test Driven: Practical TDD and Acceptance TDD for Java Developers
  • 10. © 2013 iZenBridge | CONFIDENTIAL Why TDD? The Benefits of TDD: • Limits WIP – a key Lean principle • Ensures testing at lower granularity level – the smallest testable unit of code • Ensures no untested code goes to production • Helps high degree of conformity between code and the real business requirements • Helps keep unused code out of the system (unwritten) • Makes codebase more maintainable – via regression testing
  • 11. © 2013 iZenBridge | CONFIDENTIAL The TDD Cycle  Red  Green  Clean Test Code Refactor
  • 12. © 2013 iZenBridge | CONFIDENTIAL Three Laws/ Rules of TDD You will not write any production code until you have written a failing unit test. First Law
  • 13. © 2013 iZenBridge | CONFIDENTIAL Three laws of TDD You will not write more of a unit test than is sufficient to fail, and not compiling is failing Second Law
  • 14. © 2013 iZenBridge | CONFIDENTIAL Three laws of TDD You will not write more production code that is sufficient to pass the currently failing test. Third Law
  • 15. © 2013 iZenBridge | CONFIDENTIAL Misconceptions About TDD • Writing code first, then tests is same as TDD • TDD isn’t useful for designing architecture • Takes too much time • Too complex to learn and implement • TDD is only good for small projects
  • 16. © 2013 iZenBridge | CONFIDENTIAL
  • 17. © 2013 iZenBridge | CONFIDENTIAL Let’s Build Something Now!
  • 18. © 2013 iZenBridge | CONFIDENTIAL String Calculator – TDD Exercise Define Scope: • Supported operators? • Acceptable characters? • Whitespace? • Max length of expression – number of operations? • Max length of each number? • Fractions? • Parenthesis?
  • 19. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) Time to start Failing! • Reminders: • Test, Code, Refactor – REPEAT until Done! • Add feature layers one by one, in small manageable increments • Setup • Eclipse for Java Development • JDK • Team formation
  • 20. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 1. Two literal addition A + B
  • 21. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 2. Multiple literal addition A + B + C A + B + C + D
  • 22. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 3. Combination of addition and subtraction A + B – C or A – B + C
  • 23. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 4. Simple multiplication A * B A * B * C
  • 24. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 5. Simple division A / B A / B / C
  • 25. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 6. Combination of multiplication and division A * B / C A / B * C Does order matter?
  • 26. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 7. Combination of all four A + B – C * D / E Order does matter here!
  • 27. © 2013 iZenBridge | CONFIDENTIAL String Calculator (continued) 8. Invalid expressions • Banned chars - alpha, parenthesis, special chars • Space between a number • Two operators clubbed together • First number negative • Invalid decimal number
  • 28. © 2013 iZenBridge | CONFIDENTIAL What Next? Certified Scrum Developer (CSD) A 3-day course certified by Scrum Alliance that focuses on specialized Agile engineering skills:  Test Driven Development (TDD)  ATDD, BDD – Selenium/ Cucumber  Continuous Integration – Jenkins  Agile Design and Architecture  Refactoring  Collaboration
  • 29. © 2013 iZenBridge | CONFIDENTIAL References  Test Driven Development: By Example - Kent Beck  Succeeding with Agile - Mike Cohn  Test Driven: Practical TDD and Acceptance TDD for Java Developers - Lasse Koskela
  • 30. © 2013 iZenBridge | CONFIDENTIAL Stay Connected YouTube www.youtube.com/izenbridge LinkedIn Group PMI-ACP: Agile Certification Made Easy Saket.Bansal@iZenBridge.com SunjayKumar@gmail.com www.iZenBridge.com forum.iZenBridge.com