SlideShare a Scribd company logo
Test-driven Design/Development
TDD First agile practice to become mainstream Chrysler Comprehensive Compensation system They needed something different BUFP wasn’t working How to deal with change instead of fighting it?
Lean - Dealing with Change Planning Incremental frequent Small features releases
Agile - Dealing with Change Plan driven vs Planning Driven Revise the plan weekly reflect reality make appropriate decisions
Lean Manufacturing View the problem as a Software Delivery System Programmers, testers, designers, managers, BBAA. Input: Feature request Output: Let’s decide...
Lean: “The Goal”- Eliyahu Goldratt Alex run a manufacturing plant soon to be closed He knows a consultant (Jonah)!! He learns a systems approach to manufacturing and its evaluation This new system is counterintuitive: Not seeking 100% machine utilization
Lean Basics: The Goal Increase the throughput Decrease operating expenses Decrease inventory
Lean: Throughput How much potential revenue the system can create Emphasis in deliver real software to real customers. It is only paid if it is used. Running Tested Features per time unit RFT/month
Lean: Operating expenses Computers Electricity Rent Insurance Wages ...
Lean:Inventory Grocery Store What is in the shelve I bet I can sell it on time It is not providing value (value = money)
Inventory in Software? Unused Features: Building a feature nobody is using [no payments] Unreleased features in source control Unnecessary complexity:  A developer adds complexity in anticipation of a future feature
Inventory & Machine Utilization Machine spits out parts at 100% utilization Only 25% ended up ordered 8 hour shift: 200 sold and 600 stacking up on the floor Walk around parts, new warehouse! Operating expenses increased! Don’t use it at 100%
Inventory: Unnecessary Complexity Developer adds complexity in anticipation Developer will have to walk around these parts from now on [we have spoiled customers!!] Developers are slowed down More complexity Probably adding duplication
Inventory: Unnecessary Complexity The more unnecessary complexity The more difficult to change The harder to maintain Marginal costs of features goes up The harder to maintain a system The more expensive the feature
TDD’s goal is to reduce Inventory Keeping the cost of adding a feature as low as we can by keeping the design simple
Lean Basics: The Goal Increase the throughput (RTF/month) Decrease operating expenses, - precedence Decrease inventory Reduce unnecessary complexity Reduce unused features Reduce unreleased features
YAGNI - Decrease Unneeded Complexity  Design only what I need to solve the problem I have now :-( I design what I need now in such a way that is ready for  any  change :-) Example: Personal defense failure
YAGNI - Decrease Unneeded Complexity Design in a way that prevents attacks from any direction Follow few principles to keep the design simple so the cost of implementing any new feature is reasonably low Example: Personal defense Principles
TDD Principles Design is simple if it passes the test minimizes duplication maximizes clarity  is small 1. is assumed and 4. is a by-product
TDD Principle: Reduce Duplication “ I’m doing the same thing in five places, I have to change all five of them [Put rationalized justification] so I copied and pasted in four places, I forgot the fifth one” ⇒ bug
TDD Principle: Fix Bad Names By naming accurately It is easier to understand how the code works we may detect smells (name too weird?)
TDD Principle: Maximize Clarity Fix bad names name variables after what they represent name methods after what they do name classes what they are name interfaces after what the role they play
TDD Principle: Fix Bad Names Smell: too long with connectors like: “and”, “then”, “but”. That block of code  is doing too much work too many responsibilities it duplicates responsibilities with another part of the system
TDD Principles Design is simple if it minimizes duplication maximizes clarity  Claim: IF WE FOLLOW THESE PRINCIPLES WE REDUCE INVENTORY CREATED BY UNNECESSARY COMPLEXITY
TDD: Recfatoring Improving the design of existing code [book] Systematic approach to improve the design without throwing a piece a way while rewritten it.
Refactoring: Systematic Approach Work in very small steps steps are reversible I can stop if I want to Keep the code working at every step I have tests (behavioral spec) that tells me if a structural change breaks behavior
Traditional Design We design something that meets a large number of requirements at once [cascade] Done by architects, handed off to developers Caveat with high level design ideas: high levels ideas right most of the time low level detail wrong most of the time
Evolutionary Design The act of writing the code give us information wether the design works or not, without that information, we can’t design effectively. Write code in a way that allows us to start with the low level detail and use some basic principles to make sure the high level ideal designs ideas work well
Evolutionary Design by TDD Test drives the design. A test articulates a goal so I know when to stop
Evolutionary Design: TDD cycle Write a failing test  Articulates a goal: “I need a little piece of software to does this” Make the test pass: Don’t write any production code if there isn’t a failing test that requires it [no inventory]. Failing test evidence of need
Evolutionary Design: TDD cycle A new intellectual challenge write it simple articulate the goal with less code pass the test with less code remove duplication, make it clearer

More Related Content

PPT
Extreme & pair programming Slides ppt
PPT
XP Explained
PPTX
Extreme programming - a quick and agile overview !
PPTX
Going extreme-with-extreme-programming
PPTX
Xp(Xtreme Programming) presentation
PPT
Pair Programming: overview and concepts
PPT
extreme Programming
PDF
eXtreme programming (XP) - An Overview
Extreme & pair programming Slides ppt
XP Explained
Extreme programming - a quick and agile overview !
Going extreme-with-extreme-programming
Xp(Xtreme Programming) presentation
Pair Programming: overview and concepts
extreme Programming
eXtreme programming (XP) - An Overview

What's hot (20)

PDF
Way to Agile - USTH
ODP
Xtreme Programming
PDF
XP In 10 slides
PPTX
Paul Ellarby - Why do scrum?
PPTX
Extreme Programming (XP) for Dummies
PPT
Extreme programming
PDF
Automation testing in Agile project
PDF
Improve your TDD skills
PPTX
PPT
Extreme Programming Deployed
KEY
Agile xp crash_course_2010_05_21
PPT
Cybercom 15 May 2008
PPT
How engineering practices help business
PPTX
Stop! you're testing too much
PPTX
Test Automation Canvas
PPT
An Introduction to XP and Agile
PPTX
Agile Testing in Enterprise: Way to transform - SQA Days 2014
PPTX
Communicated deadlines = bad quality
PDF
Introduction to Agile
PDF
NYC MeetUp 10.9
Way to Agile - USTH
Xtreme Programming
XP In 10 slides
Paul Ellarby - Why do scrum?
Extreme Programming (XP) for Dummies
Extreme programming
Automation testing in Agile project
Improve your TDD skills
Extreme Programming Deployed
Agile xp crash_course_2010_05_21
Cybercom 15 May 2008
How engineering practices help business
Stop! you're testing too much
Test Automation Canvas
An Introduction to XP and Agile
Agile Testing in Enterprise: Way to transform - SQA Days 2014
Communicated deadlines = bad quality
Introduction to Agile
NYC MeetUp 10.9
Ad

Similar to Test-Driven Design - ¿Porqué? (20)

PPT
Arch factory - Agile Design: Best Practices
PPT
Waterfallacies V1 1
PPT
Best practices for agile design
PPT
Agile Pmi 102108 Final
PDF
Agile Test Driven Development
PPTX
Agile Overview Session
PPTX
Beyond manifestos
PDF
Innovation in the Agile Age
PDF
User driven development
PDF
L5555555555555555555555 Agile Scrum Framework.pdf
PPTX
What is Lean UX?
ODP
Evolutionary Design Solid
PPT
More content in less time
PPTX
Agile Eng Practices Agilesparks
PPTX
{10.0} Test Driven Development.pptx
ODP
Effective TDD - Less is more
PDF
Test driven development
PDF
Agile engineering practices
PDF
Test Driven Development Methodology and Philosophy
PPT
March APLN: Agile development- Measure & Analyze by Garry Rowland
Arch factory - Agile Design: Best Practices
Waterfallacies V1 1
Best practices for agile design
Agile Pmi 102108 Final
Agile Test Driven Development
Agile Overview Session
Beyond manifestos
Innovation in the Agile Age
User driven development
L5555555555555555555555 Agile Scrum Framework.pdf
What is Lean UX?
Evolutionary Design Solid
More content in less time
Agile Eng Practices Agilesparks
{10.0} Test Driven Development.pptx
Effective TDD - Less is more
Test driven development
Agile engineering practices
Test Driven Development Methodology and Philosophy
March APLN: Agile development- Measure & Analyze by Garry Rowland
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm

Test-Driven Design - ¿Porqué?

  • 2. TDD First agile practice to become mainstream Chrysler Comprehensive Compensation system They needed something different BUFP wasn’t working How to deal with change instead of fighting it?
  • 3. Lean - Dealing with Change Planning Incremental frequent Small features releases
  • 4. Agile - Dealing with Change Plan driven vs Planning Driven Revise the plan weekly reflect reality make appropriate decisions
  • 5. Lean Manufacturing View the problem as a Software Delivery System Programmers, testers, designers, managers, BBAA. Input: Feature request Output: Let’s decide...
  • 6. Lean: “The Goal”- Eliyahu Goldratt Alex run a manufacturing plant soon to be closed He knows a consultant (Jonah)!! He learns a systems approach to manufacturing and its evaluation This new system is counterintuitive: Not seeking 100% machine utilization
  • 7. Lean Basics: The Goal Increase the throughput Decrease operating expenses Decrease inventory
  • 8. Lean: Throughput How much potential revenue the system can create Emphasis in deliver real software to real customers. It is only paid if it is used. Running Tested Features per time unit RFT/month
  • 9. Lean: Operating expenses Computers Electricity Rent Insurance Wages ...
  • 10. Lean:Inventory Grocery Store What is in the shelve I bet I can sell it on time It is not providing value (value = money)
  • 11. Inventory in Software? Unused Features: Building a feature nobody is using [no payments] Unreleased features in source control Unnecessary complexity: A developer adds complexity in anticipation of a future feature
  • 12. Inventory & Machine Utilization Machine spits out parts at 100% utilization Only 25% ended up ordered 8 hour shift: 200 sold and 600 stacking up on the floor Walk around parts, new warehouse! Operating expenses increased! Don’t use it at 100%
  • 13. Inventory: Unnecessary Complexity Developer adds complexity in anticipation Developer will have to walk around these parts from now on [we have spoiled customers!!] Developers are slowed down More complexity Probably adding duplication
  • 14. Inventory: Unnecessary Complexity The more unnecessary complexity The more difficult to change The harder to maintain Marginal costs of features goes up The harder to maintain a system The more expensive the feature
  • 15. TDD’s goal is to reduce Inventory Keeping the cost of adding a feature as low as we can by keeping the design simple
  • 16. Lean Basics: The Goal Increase the throughput (RTF/month) Decrease operating expenses, - precedence Decrease inventory Reduce unnecessary complexity Reduce unused features Reduce unreleased features
  • 17. YAGNI - Decrease Unneeded Complexity Design only what I need to solve the problem I have now :-( I design what I need now in such a way that is ready for any change :-) Example: Personal defense failure
  • 18. YAGNI - Decrease Unneeded Complexity Design in a way that prevents attacks from any direction Follow few principles to keep the design simple so the cost of implementing any new feature is reasonably low Example: Personal defense Principles
  • 19. TDD Principles Design is simple if it passes the test minimizes duplication maximizes clarity is small 1. is assumed and 4. is a by-product
  • 20. TDD Principle: Reduce Duplication “ I’m doing the same thing in five places, I have to change all five of them [Put rationalized justification] so I copied and pasted in four places, I forgot the fifth one” ⇒ bug
  • 21. TDD Principle: Fix Bad Names By naming accurately It is easier to understand how the code works we may detect smells (name too weird?)
  • 22. TDD Principle: Maximize Clarity Fix bad names name variables after what they represent name methods after what they do name classes what they are name interfaces after what the role they play
  • 23. TDD Principle: Fix Bad Names Smell: too long with connectors like: “and”, “then”, “but”. That block of code is doing too much work too many responsibilities it duplicates responsibilities with another part of the system
  • 24. TDD Principles Design is simple if it minimizes duplication maximizes clarity Claim: IF WE FOLLOW THESE PRINCIPLES WE REDUCE INVENTORY CREATED BY UNNECESSARY COMPLEXITY
  • 25. TDD: Recfatoring Improving the design of existing code [book] Systematic approach to improve the design without throwing a piece a way while rewritten it.
  • 26. Refactoring: Systematic Approach Work in very small steps steps are reversible I can stop if I want to Keep the code working at every step I have tests (behavioral spec) that tells me if a structural change breaks behavior
  • 27. Traditional Design We design something that meets a large number of requirements at once [cascade] Done by architects, handed off to developers Caveat with high level design ideas: high levels ideas right most of the time low level detail wrong most of the time
  • 28. Evolutionary Design The act of writing the code give us information wether the design works or not, without that information, we can’t design effectively. Write code in a way that allows us to start with the low level detail and use some basic principles to make sure the high level ideal designs ideas work well
  • 29. Evolutionary Design by TDD Test drives the design. A test articulates a goal so I know when to stop
  • 30. Evolutionary Design: TDD cycle Write a failing test Articulates a goal: “I need a little piece of software to does this” Make the test pass: Don’t write any production code if there isn’t a failing test that requires it [no inventory]. Failing test evidence of need
  • 31. Evolutionary Design: TDD cycle A new intellectual challenge write it simple articulate the goal with less code pass the test with less code remove duplication, make it clearer