SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 
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
 

Mais procurados (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
 
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
 
User research + agile = RITE+Krug
User research + agile = RITE+KrugUser research + agile = RITE+Krug
User research + agile = RITE+Krug
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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
 

Mais 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
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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