SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
TEST DRIVEN
  DESIGN
 AGILE NCR - APRIL 25, 2011
        Jonas Auken




                              1
Introduction
• Name: Jonas Auken
• Role: Agile Evangelist
• Primary goal: Excellent quality software
• Secondary goal: Happy developers
• Means: Agile practices everywhere

                                             2
Important questions
• How do you know if you're code is
  working?
  When you have tested it!
• When do you want feedback from your
  code?
  Now!
• When would you like to refactor?
  Anytime!


                                        3
Agenda
• Test driven development
• The “Find my Ride” example
• Immediate feedback
• Comfortable refactoring
• Towards a better design
• Discussion: How do we get started?
                                       4
@Test public void canInspirePeopleToDoTDD() {
  agileNCR.arrangeConference(2011);
  People people = agileNCR.invitePeople();
  Presenter presenter = new Presenter(“Jonas Auken”);
  presenter.prepareSlides();
  presenter.createExampleCode();
  while (!done) {
     try {
        done = presenter.performPresentation(people);
     } catch (QuestionRaisedException e) {
        presenter.answerQuestion();
     }
  }
  assertEquals(0.75, people.getRateInspiredToDoTDD);
}



                                                        5
Test driven development
•   Why?
     •     Feedback loop
     •     Change alarm
     •     Help in bug finding
     •     A better design
     •     Adding functionality by the slice
•   How and when?
     •     Write the test first
     •     Mock all external objects
     •     Only test worker objects, not value objects




                                                         6
Good design
• “Pretty much what you’d have expected”
• No superfluous code
• Easy to understand - easy to maintain
• Small classes, small methods
• Separation of concern - do one thing only
• Single layer of abstraction
                                              7
Test driven design
• The natural next step
• Avoid big design up front (BDUF)
• Design by refactoring
   • Design what you need
   • Mock the rest
   • Small steps or large steps
                                     8
“Find my Ride”

• A larger example
• Web application
• A few complex issues
• Java6, JSF 2, Tomcat server, mock database

                                               9
This is not real
• No users telling us what they want
• No component and backend design
• No planning
• So, this is not really agile - it’s just an
   example of TDD



                                                10
Immediate feedback

• The red-green cycle
• Test, code and refactor
• Feedback in every cycle
• Short cycle or long cycle

                              11
Comfortable refactoring

• Refactoring in every cycle
• Avoid the “big refactoring in the sky”
• Refactor when the test is green


                                           12
Towards a better design
• Walking skeleton
• One slice of functionality
• Hardest thing first
• Knowledge is gathered
• Choices can be deferred
• Better estimates and better design
                                       13
How do we get started?
• Inspiration?
• Discussion?
• Questions?
• Remarks?
• Personal experiences?

                          14
Books & Links
•   Growing Object-Oriented Software Guided by Tests - Steve Freeman & Nat Pryce
•   Test Driven Development: By Example - Kent Beck
•   Extreme Programming Explained: Embrace Change - Kent Beck
•   Clean Code - Robert C Martin
•   Refactoring: Improving the Design of Existing Code - Martin Fowler
•   10 Ways to Improve Your Code - http://www.slideshare.net/guestebde/10-ways-to-improve-
    your-code-neal-ford - Neal Ford
•   SLAP - http://www.markhneedham.com/blog/2009/06/12/coding-single-level-of-
    abstraction-principle - Mark Needham
•   Do One Thing - http://blog.objectmentor.com/articles/2009/09/11/one-thing-extract-till-
    you-drop - Robert C Martin
•   Test Driven Development - http://en.wikipedia.org/wiki/Test-driven_development -
    Wikipedia
•   Tech & Talk - www.auken.net - Jonas Auken




                                                                                              15

Contenu connexe

Tendances

Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...Derek Allard
 
Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Duncan Nisbet
 
Better Software Through User Research
Better Software Through User ResearchBetter Software Through User Research
Better Software Through User ResearchAlexandra Leisse
 
Agile forthelongrun lesfurets
Agile forthelongrun lesfuretsAgile forthelongrun lesfurets
Agile forthelongrun lesfuretsDimitri Baeli
 
Android Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and PatternsAndroid Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and Patternsgdgut
 
Great Agile in a UX World
Great Agile in a UX WorldGreat Agile in a UX World
Great Agile in a UX WorldAnthony Viviano
 
Change the Language, Change the Rules
Change the Language, Change the RulesChange the Language, Change the Rules
Change the Language, Change the RulesTom Hoyland
 
Cause Effect Relativity & Diversity
Cause Effect Relativity & DiversityCause Effect Relativity & Diversity
Cause Effect Relativity & DiversityPierluigi Pugliese
 
Building better agile processes
Building better agile processesBuilding better agile processes
Building better agile processesGil Zilberfeld
 
DevOps - Successful Patterns
DevOps - Successful PatternsDevOps - Successful Patterns
DevOps - Successful PatternsCreationline,inc.
 
UX Research in the Agile Cycle
UX Research in the Agile CycleUX Research in the Agile Cycle
UX Research in the Agile Cycleuxpin
 
Remote Project Manager's Arsenal
Remote Project Manager's ArsenalRemote Project Manager's Arsenal
Remote Project Manager's ArsenalPatti Chan
 
Open your mind for OpenSource
Open your mind for OpenSourceOpen your mind for OpenSource
Open your mind for OpenSourceCOMAQA.BY
 
Becoming a SharePoint Chef: A Non-Culinary Calling
Becoming a SharePoint Chef: A Non-Culinary CallingBecoming a SharePoint Chef: A Non-Culinary Calling
Becoming a SharePoint Chef: A Non-Culinary CallingPhil Greer
 
nycdevops: "Breaking Down the Prod/Dev Wall"
nycdevops: "Breaking Down the Prod/Dev Wall"nycdevops: "Breaking Down the Prod/Dev Wall"
nycdevops: "Breaking Down the Prod/Dev Wall"Andrew Phillips
 
Embracing the Inevitable: Experience Design in an Agile World
Embracing the Inevitable: Experience Design in an Agile WorldEmbracing the Inevitable: Experience Design in an Agile World
Embracing the Inevitable: Experience Design in an Agile WorldTWG
 
Farhan Thawar - Managing an Agile Team
Farhan Thawar - Managing an Agile TeamFarhan Thawar - Managing an Agile Team
Farhan Thawar - Managing an Agile Team#DevTO
 

Tendances (20)

Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
 
Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016Be More Salmon - Agile Manchester 2016
Be More Salmon - Agile Manchester 2016
 
Better Software Through User Research
Better Software Through User ResearchBetter Software Through User Research
Better Software Through User Research
 
Agile forthelongrun lesfurets
Agile forthelongrun lesfuretsAgile forthelongrun lesfurets
Agile forthelongrun lesfurets
 
Android Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and PatternsAndroid Developer Skills, Techniques, and Patterns
Android Developer Skills, Techniques, and Patterns
 
Scrum for high performance teams
Scrum for high performance teams Scrum for high performance teams
Scrum for high performance teams
 
Scaling aug 2014 6.key
Scaling aug 2014 6.keyScaling aug 2014 6.key
Scaling aug 2014 6.key
 
Great Agile in a UX World
Great Agile in a UX WorldGreat Agile in a UX World
Great Agile in a UX World
 
Change the Language, Change the Rules
Change the Language, Change the RulesChange the Language, Change the Rules
Change the Language, Change the Rules
 
Cause Effect Relativity & Diversity
Cause Effect Relativity & DiversityCause Effect Relativity & Diversity
Cause Effect Relativity & Diversity
 
Building better agile processes
Building better agile processesBuilding better agile processes
Building better agile processes
 
DevOps - Successful Patterns
DevOps - Successful PatternsDevOps - Successful Patterns
DevOps - Successful Patterns
 
UX Research in the Agile Cycle
UX Research in the Agile CycleUX Research in the Agile Cycle
UX Research in the Agile Cycle
 
Agile and UX
Agile and UXAgile and UX
Agile and UX
 
Remote Project Manager's Arsenal
Remote Project Manager's ArsenalRemote Project Manager's Arsenal
Remote Project Manager's Arsenal
 
Open your mind for OpenSource
Open your mind for OpenSourceOpen your mind for OpenSource
Open your mind for OpenSource
 
Becoming a SharePoint Chef: A Non-Culinary Calling
Becoming a SharePoint Chef: A Non-Culinary CallingBecoming a SharePoint Chef: A Non-Culinary Calling
Becoming a SharePoint Chef: A Non-Culinary Calling
 
nycdevops: "Breaking Down the Prod/Dev Wall"
nycdevops: "Breaking Down the Prod/Dev Wall"nycdevops: "Breaking Down the Prod/Dev Wall"
nycdevops: "Breaking Down the Prod/Dev Wall"
 
Embracing the Inevitable: Experience Design in an Agile World
Embracing the Inevitable: Experience Design in an Agile WorldEmbracing the Inevitable: Experience Design in an Agile World
Embracing the Inevitable: Experience Design in an Agile World
 
Farhan Thawar - Managing an Agile Team
Farhan Thawar - Managing an Agile TeamFarhan Thawar - Managing an Agile Team
Farhan Thawar - Managing an Agile Team
 

Similaire à Test Driven Design by Jonas Auken

Supersize me: Making Drupal go large
Supersize me: Making Drupal go largeSupersize me: Making Drupal go large
Supersize me: Making Drupal go largeTom Phethean
 
Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael CollinsDevopsdays
 
Improve performance of developer - Khodak
Improve performance of developer  - KhodakImprove performance of developer  - Khodak
Improve performance of developer - KhodakIgor Bronovskyy
 
Thucydides - a brief review
Thucydides - a brief reviewThucydides - a brief review
Thucydides - a brief reviewCristian COȚOI
 
OpenStack Doc Overview for Boot Camp
OpenStack Doc Overview for Boot CampOpenStack Doc Overview for Boot Camp
OpenStack Doc Overview for Boot CampAnne Gentle
 
Becoming A Technical Project Manager - Capital Camp
Becoming A Technical Project Manager - Capital CampBecoming A Technical Project Manager - Capital Camp
Becoming A Technical Project Manager - Capital CampScott Massey
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 
Practical Methods for Adopting DevOps - Michael Stahnke
Practical Methods for Adopting DevOps - Michael StahnkePractical Methods for Adopting DevOps - Michael Stahnke
Practical Methods for Adopting DevOps - Michael StahnkePuppet
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesIgor Moochnick
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering PrinciplesXu Jiang
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
Learn Learning + Prototype Testing
Learn Learning + Prototype TestingLearn Learning + Prototype Testing
Learn Learning + Prototype TestingDave Hora
 
Design Studio Methodology: A quick why and how
Design Studio Methodology: A quick why and howDesign Studio Methodology: A quick why and how
Design Studio Methodology: A quick why and howDaniel Naumann
 
Sdec11.agile ina day
Sdec11.agile ina daySdec11.agile ina day
Sdec11.agile ina daysdeconf
 
12 Things Every Programmer Should Know
12 Things Every Programmer Should Know12 Things Every Programmer Should Know
12 Things Every Programmer Should KnowSamnang Chhun
 

Similaire à Test Driven Design by Jonas Auken (20)

Supersize me: Making Drupal go large
Supersize me: Making Drupal go largeSupersize me: Making Drupal go large
Supersize me: Making Drupal go large
 
Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael Collins
 
Improve performance of developer - Khodak
Improve performance of developer  - KhodakImprove performance of developer  - Khodak
Improve performance of developer - Khodak
 
Thucydides - a brief review
Thucydides - a brief reviewThucydides - a brief review
Thucydides - a brief review
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
OpenStack Doc Overview for Boot Camp
OpenStack Doc Overview for Boot CampOpenStack Doc Overview for Boot Camp
OpenStack Doc Overview for Boot Camp
 
Becoming A Technical Project Manager - Capital Camp
Becoming A Technical Project Manager - Capital CampBecoming A Technical Project Manager - Capital Camp
Becoming A Technical Project Manager - Capital Camp
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Practical Methods for Adopting DevOps - Michael Stahnke
Practical Methods for Adopting DevOps - Michael StahnkePractical Methods for Adopting DevOps - Michael Stahnke
Practical Methods for Adopting DevOps - Michael Stahnke
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering Principles
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
Requirements the Last Bottleneck
Requirements the Last BottleneckRequirements the Last Bottleneck
Requirements the Last Bottleneck
 
Learn Learning + Prototype Testing
Learn Learning + Prototype TestingLearn Learning + Prototype Testing
Learn Learning + Prototype Testing
 
Agile Methodology
Agile MethodologyAgile Methodology
Agile Methodology
 
Agile
AgileAgile
Agile
 
Design Studio Methodology: A quick why and how
Design Studio Methodology: A quick why and howDesign Studio Methodology: A quick why and how
Design Studio Methodology: A quick why and how
 
Sdec11.agile ina day
Sdec11.agile ina daySdec11.agile ina day
Sdec11.agile ina day
 
12 Things Every Programmer Should Know
12 Things Every Programmer Should Know12 Things Every Programmer Should Know
12 Things Every Programmer Should Know
 

Plus de agilencr

When Scrum is not enough! A Case Study by Ruchika Goyal
When Scrum is not enough! A Case Study by Ruchika GoyalWhen Scrum is not enough! A Case Study by Ruchika Goyal
When Scrum is not enough! A Case Study by Ruchika Goyalagilencr
 
Working towards true Scrum Mastery by Sanjiv Augustine
Working towards true Scrum Mastery by Sanjiv AugustineWorking towards true Scrum Mastery by Sanjiv Augustine
Working towards true Scrum Mastery by Sanjiv Augustineagilencr
 
Agility in HR : The Xebia Story by Bharti and Sabeen
Agility in HR : The Xebia Story by Bharti and SabeenAgility in HR : The Xebia Story by Bharti and Sabeen
Agility in HR : The Xebia Story by Bharti and Sabeenagilencr
 
Scrum and Lean : Multiply the Powers by Om Band
Scrum and Lean : Multiply the Powers by Om BandScrum and Lean : Multiply the Powers by Om Band
Scrum and Lean : Multiply the Powers by Om Bandagilencr
 
Should Distributed Agile have a Third culture? by Line Mark Rugholt
Should Distributed Agile have a Third culture? by Line Mark RugholtShould Distributed Agile have a Third culture? by Line Mark Rugholt
Should Distributed Agile have a Third culture? by Line Mark Rugholtagilencr
 
What is Agility? by Shaik Mohammed
What is Agility? by Shaik MohammedWhat is Agility? by Shaik Mohammed
What is Agility? by Shaik Mohammedagilencr
 
Anti-patterns in Distributed Agile by Preethi Madhu
Anti-patterns in Distributed Agile by Preethi MadhuAnti-patterns in Distributed Agile by Preethi Madhu
Anti-patterns in Distributed Agile by Preethi Madhuagilencr
 
Top metrics for Agile by Priyank
Top metrics for Agile by PriyankTop metrics for Agile by Priyank
Top metrics for Agile by Priyankagilencr
 
Agile NCR 2011
Agile NCR 2011Agile NCR 2011
Agile NCR 2011agilencr
 

Plus de agilencr (9)

When Scrum is not enough! A Case Study by Ruchika Goyal
When Scrum is not enough! A Case Study by Ruchika GoyalWhen Scrum is not enough! A Case Study by Ruchika Goyal
When Scrum is not enough! A Case Study by Ruchika Goyal
 
Working towards true Scrum Mastery by Sanjiv Augustine
Working towards true Scrum Mastery by Sanjiv AugustineWorking towards true Scrum Mastery by Sanjiv Augustine
Working towards true Scrum Mastery by Sanjiv Augustine
 
Agility in HR : The Xebia Story by Bharti and Sabeen
Agility in HR : The Xebia Story by Bharti and SabeenAgility in HR : The Xebia Story by Bharti and Sabeen
Agility in HR : The Xebia Story by Bharti and Sabeen
 
Scrum and Lean : Multiply the Powers by Om Band
Scrum and Lean : Multiply the Powers by Om BandScrum and Lean : Multiply the Powers by Om Band
Scrum and Lean : Multiply the Powers by Om Band
 
Should Distributed Agile have a Third culture? by Line Mark Rugholt
Should Distributed Agile have a Third culture? by Line Mark RugholtShould Distributed Agile have a Third culture? by Line Mark Rugholt
Should Distributed Agile have a Third culture? by Line Mark Rugholt
 
What is Agility? by Shaik Mohammed
What is Agility? by Shaik MohammedWhat is Agility? by Shaik Mohammed
What is Agility? by Shaik Mohammed
 
Anti-patterns in Distributed Agile by Preethi Madhu
Anti-patterns in Distributed Agile by Preethi MadhuAnti-patterns in Distributed Agile by Preethi Madhu
Anti-patterns in Distributed Agile by Preethi Madhu
 
Top metrics for Agile by Priyank
Top metrics for Agile by PriyankTop metrics for Agile by Priyank
Top metrics for Agile by Priyank
 
Agile NCR 2011
Agile NCR 2011Agile NCR 2011
Agile NCR 2011
 

Dernier

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Dernier (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

Test Driven Design by Jonas Auken

  • 1. TEST DRIVEN DESIGN AGILE NCR - APRIL 25, 2011 Jonas Auken 1
  • 2. Introduction • Name: Jonas Auken • Role: Agile Evangelist • Primary goal: Excellent quality software • Secondary goal: Happy developers • Means: Agile practices everywhere 2
  • 3. Important questions • How do you know if you're code is working? When you have tested it! • When do you want feedback from your code? Now! • When would you like to refactor? Anytime! 3
  • 4. Agenda • Test driven development • The “Find my Ride” example • Immediate feedback • Comfortable refactoring • Towards a better design • Discussion: How do we get started? 4
  • 5. @Test public void canInspirePeopleToDoTDD() { agileNCR.arrangeConference(2011); People people = agileNCR.invitePeople(); Presenter presenter = new Presenter(“Jonas Auken”); presenter.prepareSlides(); presenter.createExampleCode(); while (!done) { try { done = presenter.performPresentation(people); } catch (QuestionRaisedException e) { presenter.answerQuestion(); } } assertEquals(0.75, people.getRateInspiredToDoTDD); } 5
  • 6. Test driven development • Why? • Feedback loop • Change alarm • Help in bug finding • A better design • Adding functionality by the slice • How and when? • Write the test first • Mock all external objects • Only test worker objects, not value objects 6
  • 7. Good design • “Pretty much what you’d have expected” • No superfluous code • Easy to understand - easy to maintain • Small classes, small methods • Separation of concern - do one thing only • Single layer of abstraction 7
  • 8. Test driven design • The natural next step • Avoid big design up front (BDUF) • Design by refactoring • Design what you need • Mock the rest • Small steps or large steps 8
  • 9. “Find my Ride” • A larger example • Web application • A few complex issues • Java6, JSF 2, Tomcat server, mock database 9
  • 10. This is not real • No users telling us what they want • No component and backend design • No planning • So, this is not really agile - it’s just an example of TDD 10
  • 11. Immediate feedback • The red-green cycle • Test, code and refactor • Feedback in every cycle • Short cycle or long cycle 11
  • 12. Comfortable refactoring • Refactoring in every cycle • Avoid the “big refactoring in the sky” • Refactor when the test is green 12
  • 13. Towards a better design • Walking skeleton • One slice of functionality • Hardest thing first • Knowledge is gathered • Choices can be deferred • Better estimates and better design 13
  • 14. How do we get started? • Inspiration? • Discussion? • Questions? • Remarks? • Personal experiences? 14
  • 15. Books & Links • Growing Object-Oriented Software Guided by Tests - Steve Freeman & Nat Pryce • Test Driven Development: By Example - Kent Beck • Extreme Programming Explained: Embrace Change - Kent Beck • Clean Code - Robert C Martin • Refactoring: Improving the Design of Existing Code - Martin Fowler • 10 Ways to Improve Your Code - http://www.slideshare.net/guestebde/10-ways-to-improve- your-code-neal-ford - Neal Ford • SLAP - http://www.markhneedham.com/blog/2009/06/12/coding-single-level-of- abstraction-principle - Mark Needham • Do One Thing - http://blog.objectmentor.com/articles/2009/09/11/one-thing-extract-till- you-drop - Robert C Martin • Test Driven Development - http://en.wikipedia.org/wiki/Test-driven_development - Wikipedia • Tech & Talk - www.auken.net - Jonas Auken 15