SlideShare una empresa de Scribd logo
1 de 38
Improving Design through
Test Driven Development (TDD)
     Sam Brown @SamuelBrownIV
     Mike McGarr @jmichaelmcgarr

    DC Agile Engineering Conference
               #DCAEC12
About Us
            Sam Brown                      Mike McGarr
•   11 years software engineer     • 11 years software engineer
•   DevOps Evangelist at Excella   • Directory of DevOps for
•   Certified Scrum Master           Blackboard Learn
•   Puppet Certified               • Founder of the DC
    Professional                     Continuous Integration,
                                     Delivery and Deployment
                                     Meetup
Types of Tests
Unit Tests

Fast
Independent
Repeatable
Self-Verifying
Timely
Test Driven Development
                                                                     Golden Rule of
                                                                     TDD:
                                                                     Never write
                                                                     production code
                                                                     without a failing
                                                                     test




 http://reddevnews.com/articles/2007/11/01/testdriven-development-tdd.aspx
TDD improves quality and
                                   design




http://www.manning.com/koskela2/
Coupling
Cohesion
Object Oriented Design Principles
  Single responsibility principle (SRP)

  Open/close principle (OCP)

  Liskov substitution principle (LSP)

  Interface segregation principle (ISP)

  Dependency inversion principle (DSP)
Bowling Game
• Ten Frames per game
• 2 rolls per frame
   • Unless a strike is rolled
• Properly calculate Spares
• Properly calculate Strikes
                                 http://playcasper.com/venues/show/17
Design
Decision
Design
Decision
Notice the duplication
  in the tests. Let’s
     refactor this.
More duplication
Design
                  Problem – roll()
                  calculates score




Let’s Refactor!
We need a concept of
      frames.
Ugly Code
Design Decisions
• Design client interface

• Refactor
     • Change design without changing behavior


• Defer to last responsible moment
     • Avoids “Big Upfront Design”
New Requirements!
Requested Changes
The Bowling game is becoming service oriented!

• New Requirement:
  – Post rolls in real-time
Collaborator
Test Doubles

•   Dummy
•   Stubs
•   Fake
•   Mocks
•   Spy
NullPointerException!
 We need a default
  implementation.
Contact Us
Sam Brown
samuel.brown@excella.com                 Cute Baby Arrival
@SamuelBrownIV                             12/20/2012
https://github.com/samueltbrown



                             •    J. Michael McGarr
                             •    jmcgarr@gmail.com
                             •    @jmichaelmcgarr
                             •    http://earlyandoften.wordpress.com
                             •    DC CI Meetup - http://bit.ly/YRnrwx

Más contenido relacionado

Destacado

Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Fatkul Amri
 
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 ShreefAhmed Shreef
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuninglovingprince58
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoElad Elrom
 
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturitySD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturityBrian Dawson
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
Learning to Sense and Respond - the Fujitsu Service Case
Learning to Sense and Respond - the Fujitsu Service CaseLearning to Sense and Respond - the Fujitsu Service Case
Learning to Sense and Respond - the Fujitsu Service CaseLean Enterprise Academy
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksRuslan Meshenberg
 
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation Gene Kim
 
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-CodeSD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-CodeBrian Dawson
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
 
Splitting the Check on Compliance and Security
Splitting the Check on Compliance and SecuritySplitting the Check on Compliance and Security
Splitting the Check on Compliance and SecurityJason Chan
 
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the InternetAmazon Web Services
 
NLP pipeline in machine translation
NLP pipeline in machine translationNLP pipeline in machine translation
NLP pipeline in machine translationMarcis Pinnis
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Jeremy Edberg
 
Past, Present & Future of Recommender Systems: An Industry Perspective
Past, Present & Future of Recommender Systems: An Industry PerspectivePast, Present & Future of Recommender Systems: An Industry Perspective
Past, Present & Future of Recommender Systems: An Industry PerspectiveJustin Basilico
 

Destacado (19)

Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)
 
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
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturitySD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Learning to Sense and Respond - the Fujitsu Service Case
Learning to Sense and Respond - the Fujitsu Service CaseLearning to Sense and Respond - the Fujitsu Service Case
Learning to Sense and Respond - the Fujitsu Service Case
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talks
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation
DOES15 - Sherry Chang - Intel’s Journey to Large Scale DevOps Transformation
 
NetflixOSS Meetup
NetflixOSS MeetupNetflixOSS Meetup
NetflixOSS Meetup
 
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-CodeSD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 
Splitting the Check on Compliance and Security
Splitting the Check on Compliance and SecuritySplitting the Check on Compliance and Security
Splitting the Check on Compliance and Security
 
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
(DVO203) The Life of a Netflix Engineer Using 37% of the Internet
 
NLP pipeline in machine translation
NLP pipeline in machine translationNLP pipeline in machine translation
NLP pipeline in machine translation
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)
 
Past, Present & Future of Recommender Systems: An Industry Perspective
Past, Present & Future of Recommender Systems: An Industry PerspectivePast, Present & Future of Recommender Systems: An Industry Perspective
Past, Present & Future of Recommender Systems: An Industry Perspective
 

Más de Excella

DCSUG - What's Really Going On? Observer Worksheet
DCSUG - What's Really Going On? Observer WorksheetDCSUG - What's Really Going On? Observer Worksheet
DCSUG - What's Really Going On? Observer WorksheetExcella
 
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa Adkins
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa AdkinsDCSUG - We Are The Leaders We Have Been Waiting For by Lyssa Adkins
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa AdkinsExcella
 
DCSUG - Servant Leadership Handout
DCSUG - Servant Leadership HandoutDCSUG - Servant Leadership Handout
DCSUG - Servant Leadership HandoutExcella
 
DCSUG - Servant Leadership
DCSUG - Servant LeadershipDCSUG - Servant Leadership
DCSUG - Servant LeadershipExcella
 
DCSUG - Applying Analysis in an Agile World
DCSUG - Applying Analysis in an Agile WorldDCSUG - Applying Analysis in an Agile World
DCSUG - Applying Analysis in an Agile WorldExcella
 
DCSUG - The Art and Practice of the Agile Leader
DCSUG - The Art and Practice of the Agile LeaderDCSUG - The Art and Practice of the Agile Leader
DCSUG - The Art and Practice of the Agile LeaderExcella
 
DCSUG - Finding Lean in Agile
DCSUG - Finding Lean in AgileDCSUG - Finding Lean in Agile
DCSUG - Finding Lean in AgileExcella
 
DCSUG - Impact Mapping
DCSUG - Impact MappingDCSUG - Impact Mapping
DCSUG - Impact MappingExcella
 
DCSUG - Happiness: A Key Component of Agile
DCSUG - Happiness: A Key Component of AgileDCSUG - Happiness: A Key Component of Agile
DCSUG - Happiness: A Key Component of AgileExcella
 
The Awkward Teenager of Testing
The Awkward Teenager of TestingThe Awkward Teenager of Testing
The Awkward Teenager of TestingExcella
 
Let's Sharpen Your Agile Ax, It's Story Splitting Time
Let's Sharpen Your Agile Ax, It's Story Splitting TimeLet's Sharpen Your Agile Ax, It's Story Splitting Time
Let's Sharpen Your Agile Ax, It's Story Splitting TimeExcella
 
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016Excella
 
The 7 Secrets of Highly Effective Retrospectives (DCSUG)
The 7 Secrets of Highly Effective Retrospectives (DCSUG)The 7 Secrets of Highly Effective Retrospectives (DCSUG)
The 7 Secrets of Highly Effective Retrospectives (DCSUG)Excella
 
Get Your Productivity Game On!!
Get Your Productivity Game On!!Get Your Productivity Game On!!
Get Your Productivity Game On!!Excella
 
How to Structure Multi Team Organizations
How to Structure Multi Team OrganizationsHow to Structure Multi Team Organizations
How to Structure Multi Team OrganizationsExcella
 
Tactics to Kickstart Your Journey Toward DevOps
Tactics to Kickstart Your Journey Toward DevOpsTactics to Kickstart Your Journey Toward DevOps
Tactics to Kickstart Your Journey Toward DevOpsExcella
 
Intro to Mocking - DjangoCon 2015
Intro to Mocking - DjangoCon 2015Intro to Mocking - DjangoCon 2015
Intro to Mocking - DjangoCon 2015Excella
 
Tactics to Kickstart Your Journey Toward Continuous Delivery
Tactics to Kickstart Your Journey Toward Continuous DeliveryTactics to Kickstart Your Journey Toward Continuous Delivery
Tactics to Kickstart Your Journey Toward Continuous DeliveryExcella
 
Using ansible vault to protect your secrets
Using ansible vault to protect your secretsUsing ansible vault to protect your secrets
Using ansible vault to protect your secretsExcella
 
Using Lean Thinking to Increase the Value of Agile
Using Lean Thinking to Increase the Value of AgileUsing Lean Thinking to Increase the Value of Agile
Using Lean Thinking to Increase the Value of AgileExcella
 

Más de Excella (20)

DCSUG - What's Really Going On? Observer Worksheet
DCSUG - What's Really Going On? Observer WorksheetDCSUG - What's Really Going On? Observer Worksheet
DCSUG - What's Really Going On? Observer Worksheet
 
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa Adkins
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa AdkinsDCSUG - We Are The Leaders We Have Been Waiting For by Lyssa Adkins
DCSUG - We Are The Leaders We Have Been Waiting For by Lyssa Adkins
 
DCSUG - Servant Leadership Handout
DCSUG - Servant Leadership HandoutDCSUG - Servant Leadership Handout
DCSUG - Servant Leadership Handout
 
DCSUG - Servant Leadership
DCSUG - Servant LeadershipDCSUG - Servant Leadership
DCSUG - Servant Leadership
 
DCSUG - Applying Analysis in an Agile World
DCSUG - Applying Analysis in an Agile WorldDCSUG - Applying Analysis in an Agile World
DCSUG - Applying Analysis in an Agile World
 
DCSUG - The Art and Practice of the Agile Leader
DCSUG - The Art and Practice of the Agile LeaderDCSUG - The Art and Practice of the Agile Leader
DCSUG - The Art and Practice of the Agile Leader
 
DCSUG - Finding Lean in Agile
DCSUG - Finding Lean in AgileDCSUG - Finding Lean in Agile
DCSUG - Finding Lean in Agile
 
DCSUG - Impact Mapping
DCSUG - Impact MappingDCSUG - Impact Mapping
DCSUG - Impact Mapping
 
DCSUG - Happiness: A Key Component of Agile
DCSUG - Happiness: A Key Component of AgileDCSUG - Happiness: A Key Component of Agile
DCSUG - Happiness: A Key Component of Agile
 
The Awkward Teenager of Testing
The Awkward Teenager of TestingThe Awkward Teenager of Testing
The Awkward Teenager of Testing
 
Let's Sharpen Your Agile Ax, It's Story Splitting Time
Let's Sharpen Your Agile Ax, It's Story Splitting TimeLet's Sharpen Your Agile Ax, It's Story Splitting Time
Let's Sharpen Your Agile Ax, It's Story Splitting Time
 
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016
Managing for Happiness by Jurgen Appelo at DCSUG on 8/9/2016
 
The 7 Secrets of Highly Effective Retrospectives (DCSUG)
The 7 Secrets of Highly Effective Retrospectives (DCSUG)The 7 Secrets of Highly Effective Retrospectives (DCSUG)
The 7 Secrets of Highly Effective Retrospectives (DCSUG)
 
Get Your Productivity Game On!!
Get Your Productivity Game On!!Get Your Productivity Game On!!
Get Your Productivity Game On!!
 
How to Structure Multi Team Organizations
How to Structure Multi Team OrganizationsHow to Structure Multi Team Organizations
How to Structure Multi Team Organizations
 
Tactics to Kickstart Your Journey Toward DevOps
Tactics to Kickstart Your Journey Toward DevOpsTactics to Kickstart Your Journey Toward DevOps
Tactics to Kickstart Your Journey Toward DevOps
 
Intro to Mocking - DjangoCon 2015
Intro to Mocking - DjangoCon 2015Intro to Mocking - DjangoCon 2015
Intro to Mocking - DjangoCon 2015
 
Tactics to Kickstart Your Journey Toward Continuous Delivery
Tactics to Kickstart Your Journey Toward Continuous DeliveryTactics to Kickstart Your Journey Toward Continuous Delivery
Tactics to Kickstart Your Journey Toward Continuous Delivery
 
Using ansible vault to protect your secrets
Using ansible vault to protect your secretsUsing ansible vault to protect your secrets
Using ansible vault to protect your secrets
 
Using Lean Thinking to Increase the Value of Agile
Using Lean Thinking to Increase the Value of AgileUsing Lean Thinking to Increase the Value of Agile
Using Lean Thinking to Increase the Value of Agile
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Improving Design Through Test Driven Development (TDD)

Notas del editor

  1. Mike
  2. (Mike)Fast – runs in less than 1/10 secondIndependent– test one thing only (single assert)Repeatable – reliably repeatable (no external dependencies)Self-Verifying – red or green…no human interpretationTimely – test written before production code
  3. (Sam)Red-Green-RefactorRefactoring – changing code without changing behaviorGolden Rule of TDD: Never write production code without a failing test
  4. (Sam)Unit testing alone helps focus on qualityQuality only unit testing has limitsTDD allows developers to also improve design, increasing the value of testsLasseKoskela calls this the law of two plateausTransition to Advantage:Commonly understood advantage: QualityLess known: Improving DesignAdditional Voice Track: As we approach 100% coverage, effort to achieve small increases in coverage are greater than the value returned
  5. (Mike)Metrics of maintainability:Coupled Elements – A change in one forces a change in another (want loose coupling)Inheritance vs. Interface
  6. (Sam)Coherence – a measure of whether an element’s responsibility form a meaningful unit.Do one thing only-Animation to show first class, then divided out- What the heck is ‘coherence’???
  7. SRP – do one thing only (coherence)OCP – objects should be open for extension/closed for modificationLSP – objects should be replaceable by sub-types (design by contract)ISP – many client specific interfaces are better than one multi-purpose oneDSP – depend on abstractions and not concrete classes (dependency inversion)
  8. Calculate score for bowlsUnderstand sparesUnderstand strikes
  9. Test to ensure JUnit is working
  10. First design decision
  11. Only going to talk about Stubs and MocksDummy – objects that are passed but never usedStubs – pre-canned answers to method callsFake – scaled down version of production (InMemoryDB)Mocks – set expectationsSpy – records information passed to it
  12. Introduce a new test
  13. 1. ImportMockito (discuss what it is)2. Declare interface and use Mockito to mock3. Define dependency injection of RollNotificationService4. Then,…roll5. Verify that the mock RollNotificationService’s publish method was called once
  14. We create the new interfaceTest still failsIf we look at the unit test, the Game object needs to be updated
  15. We now update the Game with dependencySOLID – Dependency InversionTest still failsOur interface needs a new publish method
  16. We add method to interfaceTest still failsWe’ve resolved all compilation errorsThe roll() method never calls publish!The error we get is different…not an assertion
  17. Add the call to the serviceTest fails! (Huh?!)All other tests fail due to NullPointerException(Emphasize how powerful this fast feedback is on regressions)
  18. Created a new default implementation(would likely not do this in production…let me know if we should change to another type or demand)