SlideShare a Scribd company logo
1 of 40
Download to read offline
Agile Testing:
              Solving the Agilist’s
                    Dilemma

                     Star East
                    6 May 2009


11 May 2009           © Rob Myers 2009   1
Rob Myers

  Rob.Myers@agileInstitute.com
•
  Teaching Agile courses since 2002
•
  XP/Agile coach since 1999
•
  Using TDD to build software since
•
  1998
• Professional software development
  since 1986
• Blog:
  PowersOfTwo.agileInstitute.com

11 May 2009    © Rob Myers 2009       2
The Agilist’s Dilemma




11 May 2009          © Rob Myers 2009   3
Debt



  • Quality Debt
        • Defects
  • Design Debt
        • Software design
          resists change
  • Testing Debt
        • Manual testing


11 May 2009           © Rob Myers 2009   4
DILBERT: © Scott Adams/Dist. by United Feature Syndicate, Inc.




11 May 2009                          © Rob Myers 2009                          5
Why Wait?


Code                                                         Test
                               Months




              Code                                    Test
                               Weeks




                     Code                      Test
                               Days




                        Code            Test


11 May 2009                 © Rob Myers 2009                   6
Instead…




                                           Code
              Write Test   Run Test
                             Test                 Run Test   Run Test




11 May 2009                   © Rob Myers 2009                    7
Combine Advantages
                                   Manual



                                            Writing
                        Manual
                                             Test
                        Testing
                                            Cases

                                                        First
              Later

                        Record
                           &                      TDD
                        Playback

                                 Automated
11 May 2009                    © Rob Myers 2009                 8
“Move Mount Fuji”




11 May 2009        © Rob Myers 2009   9
Two Great Flavors


            ATDD                                TDD
    Written by testers,               • Written by developers.
•
    generally.
    For the team.
•                                     • For developers.
    Run frequently by
•                                     • Run frequently by
    testers and                         testers and
    developers.                         developers.
    New tests fail until the
•                                     • All tests pass 100%
    story is done. Old                  during integration.
    tests should all pass.
                   “Peanut Butter Cup” by Laura Godi

11 May 2009                 © Rob Myers 2009                  10
Benefits of ATDD

• Communication:
     • Clarifies the meaning of the story.
     • Story scope/boundaries: “Is it a
       defect?”
     • Progress: “We’re done!”
• Concise detection of defects.
• Less time troubleshooting and re-
  testing.
• Relieves the Agilist’s Dilemma.
11 May 2009          © Rob Myers 2009        11
Team Activities by Iteration

                Past        Present          Future




                         ATDD/TDD

                       Analysis/Estimation

                       Exploratory Testing




11 May 2009              © Rob Myers 2009             12
If Only…

• …We could automate the tests
  without making them brittle…

• …We could write tests without having
  to see the working product…

• …We could do so without having to
  write in a programming language…

11 May 2009    © Rob Myers 2009       13
Inconceivable!

                        “You keep using that
                        word. I do not think it
                        means what you think it
                                means…”
                          -- Inigo Montoya
                           The Princess Bride
                                     (1987)



11 May 2009       © Rob Myers 2009              14
Fit:
        Framework for Integrated Tests




          Invented by Ward Cunningham

11 May 2009         © Rob Myers 2009     15
Interface-Centric Tools




    Slow.
•
    Difficult to set up.
•
    Numerous failures from one defect.
•
    Failures do not identify the defect.
•
11 May 2009           © Rob Myers 2009     16
Business-Value-Centric Tool




11 May 2009         © Rob Myers 2009    17
Fit is Unique

• We can test any “layer,” thus
  expanding our creative reach.
• We usually avoid the UI layer.
• Fit is simple. It does very little, and
  you can do so much with it.




11 May 2009      © Rob Myers 2009           18
The First Martian Hotel




11 May 2009           © Rob Myers 2009   19
The “Column” Fixture

• For functions and calculations.
• Can be used to “Arrange” the test.




11 May 2009          © Rob Myers 2009   20
Fit Output




11 May 2009     © Rob Myers 2009        21
                                   _s
What Fit does to Your Tests

                   Your Fit test (HTML, Excel)   Fit report (HTML)




                               Fit




                           Fit Fixture
                           (Test Code)



                        System Under Test


11 May 2009                © Rob Myers 2009                    22
The “Row” Fixture

    For asserting state. (No input.)
•
    For lists.
•
    Shows missing rows as failures.
•
    Shows extra rows as failures.
•
    Declarative.
•




11 May 2009        © Rob Myers 2009    23
The “Action” Fixture

• For a sequence of events.
• For simple scripting.
• Imperative.




11 May 2009         © Rob Myers 2009   24
Error Conditions




11 May 2009        © Rob Myers 2009   25
Tests Can Have Many Tables




11 May 2009             © Rob Myers 2009   26
A Team Using Fit for ATDD

1. Testers and other teammates enter
   tests into Fit pages.
2. Developers develop Fit fixtures for the
   tables.
3. The team collaborates on the shape of
   the tables and Fit fixtures until they
   express what needs to be
   accomplished.
4. They run the tests and watch them fail
   cleanly (RED, not YELLOW).
5. Developers develop until tests pass.

11 May 2009            © Rob Myers 2009   27
Fit Tools, and More Fit Tools




   http://fit.c2.com/wiki.cgi?FitTools




11 May 2009         © Rob Myers 2009     28
Sample Test Organization:
                 Regression Focus

                       All Tests




         Really Slow                       Acceptance
           Tests                             Tests



                                   Prior            Current
                                 Iterations        Iteration




                       Iteration 1         Iteration 2

11 May 2009             © Rob Myers 2009                       29
setup.html Files
                           setup.htm
                           All Tests



                                                 setup.htm
         Really Slow                            Acceptance
           Tests                                  Tests



                                         Prior            Current
                                       Iterations        Iteration


                                                 setup.htm
                           Iteration 1          Iteration 2
                                                 aTest.htm
11 May 2009                  © Rob Myers 2009                        30
FITLIBRARY
              And Other Improvements


11 May 2009          © Rob Myers 2009   31
The “Set Up” Fixture




11 May 2009         © Rob Myers 2009   32
The “Do” Fixture




11 May 2009        © Rob Myers 2009   33
Same Test, Additional Activities




11 May 2009       © Rob Myers 2009       34
Improving Upon RowFixture

• ArrayFixture: For ordered lists
  (without having to create a position()
  column).

• SubsetFixture: Ignores surplus
  items.




11 May 2009            © Rob Myers 2009   35
Does TDD Work?

 “The results of the case studies indicate
 that the pre-release defect density of the
 four products decreased between 40% and
 90% relative to similar projects that did
 not use the TDD practice. Subjectively, the
 teams experienced a 15–35% increase in
 initial development time after adopting
 TDD.”
     http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf,
           Nagappan et al, © Springer Science + Business Media, LLC 2008



11 May 2009                    © Rob Myers 2009                            36
11 May 2009   © Rob Myers 2009   37
BIBLIOGRAPHY


11 May 2009      © Rob Myers 2009   38
Fit for Developing Software
                    – Rick Mugridge


Prentice Hall
  July 9, 2005

ISBN-10:
  0321269349

ISBN-13:
  978-0321269348


11 May 2009             © Rob Myers 2009    39
The Art of Agile Development
              – James Shore & Shane Warden


O'Reilly Media, Inc.
  October 26, 2007

ISBN-10:
  0596527675

ISBN-13:
  978-0596527679


11 May 2009              © Rob Myers 2009    40

More Related Content

Similar to Agile Testing: Solving the Agilist\'s Dilemma

Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentationrailsconf
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksRowan Hick
 
Groovy Testing Aug2009
Groovy Testing Aug2009Groovy Testing Aug2009
Groovy Testing Aug2009guest4a266c
 
Atlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyAtlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyMike Cannon-Brookes
 
Test-Driven Development Overview
Test-Driven Development OverviewTest-Driven Development Overview
Test-Driven Development OverviewRob Myers
 
Fabio Sergio: Design Thinking for the Future
Fabio Sergio: Design Thinking for the FutureFabio Sergio: Design Thinking for the Future
Fabio Sergio: Design Thinking for the Futurefrog
 
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndrome
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndromeSwiss Testing Day 2013 - How to avoid the testing swiss cheese syndrome
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndromemarc.rambert
 
Testing as Communication, Real-World Techniques
Testing as Communication, Real-World TechniquesTesting as Communication, Real-World Techniques
Testing as Communication, Real-World TechniquesActsAsCon
 
Creating Practical Security Test-Cases for Web Applications
Creating Practical Security Test-Cases for Web ApplicationsCreating Practical Security Test-Cases for Web Applications
Creating Practical Security Test-Cases for Web ApplicationsRafal Los
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile Worldjbandi
 
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer TestingPivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer Testingguestc8adce
 

Similar to Agile Testing: Solving the Agilist\'s Dilemma (12)

Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentation
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of Frameworks
 
Groovy Testing Aug2009
Groovy Testing Aug2009Groovy Testing Aug2009
Groovy Testing Aug2009
 
Atlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software CompanyAtlassian - A Different Kind Of Software Company
Atlassian - A Different Kind Of Software Company
 
Test-Driven Development Overview
Test-Driven Development OverviewTest-Driven Development Overview
Test-Driven Development Overview
 
Fabio Sergio: Design Thinking for the Future
Fabio Sergio: Design Thinking for the FutureFabio Sergio: Design Thinking for the Future
Fabio Sergio: Design Thinking for the Future
 
Javascript Library
Javascript LibraryJavascript Library
Javascript Library
 
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndrome
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndromeSwiss Testing Day 2013 - How to avoid the testing swiss cheese syndrome
Swiss Testing Day 2013 - How to avoid the testing swiss cheese syndrome
 
Testing as Communication, Real-World Techniques
Testing as Communication, Real-World TechniquesTesting as Communication, Real-World Techniques
Testing as Communication, Real-World Techniques
 
Creating Practical Security Test-Cases for Web Applications
Creating Practical Security Test-Cases for Web ApplicationsCreating Practical Security Test-Cases for Web Applications
Creating Practical Security Test-Cases for Web Applications
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile World
 
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer TestingPivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
 

More from Rob Myers

The Business Value of Agile Engineering Practices
The Business Value of Agile Engineering PracticesThe Business Value of Agile Engineering Practices
The Business Value of Agile Engineering PracticesRob Myers
 
Unit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScriptUnit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScriptRob Myers
 
Mock Objects from Concept to Code
Mock Objects from Concept to CodeMock Objects from Concept to Code
Mock Objects from Concept to CodeRob Myers
 
Technical Debt
Technical DebtTechnical Debt
Technical DebtRob Myers
 
Successful Teams are TDD Teams
Successful Teams are TDD TeamsSuccessful Teams are TDD Teams
Successful Teams are TDD TeamsRob Myers
 
TDD? Sure, but What About My Legacy Code?
TDD? Sure, but What About My Legacy Code?TDD? Sure, but What About My Legacy Code?
TDD? Sure, but What About My Legacy Code?Rob Myers
 
Metrics In An Agile World
Metrics In An Agile WorldMetrics In An Agile World
Metrics In An Agile WorldRob Myers
 
The Value of Refactoring on an Agile Team
The Value of Refactoring on an Agile TeamThe Value of Refactoring on an Agile Team
The Value of Refactoring on an Agile TeamRob Myers
 

More from Rob Myers (8)

The Business Value of Agile Engineering Practices
The Business Value of Agile Engineering PracticesThe Business Value of Agile Engineering Practices
The Business Value of Agile Engineering Practices
 
Unit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScriptUnit-Testing Your Legacy JavaScript
Unit-Testing Your Legacy JavaScript
 
Mock Objects from Concept to Code
Mock Objects from Concept to CodeMock Objects from Concept to Code
Mock Objects from Concept to Code
 
Technical Debt
Technical DebtTechnical Debt
Technical Debt
 
Successful Teams are TDD Teams
Successful Teams are TDD TeamsSuccessful Teams are TDD Teams
Successful Teams are TDD Teams
 
TDD? Sure, but What About My Legacy Code?
TDD? Sure, but What About My Legacy Code?TDD? Sure, but What About My Legacy Code?
TDD? Sure, but What About My Legacy Code?
 
Metrics In An Agile World
Metrics In An Agile WorldMetrics In An Agile World
Metrics In An Agile World
 
The Value of Refactoring on an Agile Team
The Value of Refactoring on an Agile TeamThe Value of Refactoring on an Agile Team
The Value of Refactoring on an Agile Team
 

Agile Testing: Solving the Agilist\'s Dilemma

  • 1. Agile Testing: Solving the Agilist’s Dilemma Star East 6 May 2009 11 May 2009 © Rob Myers 2009 1
  • 2. Rob Myers Rob.Myers@agileInstitute.com • Teaching Agile courses since 2002 • XP/Agile coach since 1999 • Using TDD to build software since • 1998 • Professional software development since 1986 • Blog: PowersOfTwo.agileInstitute.com 11 May 2009 © Rob Myers 2009 2
  • 3. The Agilist’s Dilemma 11 May 2009 © Rob Myers 2009 3
  • 4. Debt • Quality Debt • Defects • Design Debt • Software design resists change • Testing Debt • Manual testing 11 May 2009 © Rob Myers 2009 4
  • 5. DILBERT: © Scott Adams/Dist. by United Feature Syndicate, Inc. 11 May 2009 © Rob Myers 2009 5
  • 6. Why Wait? Code Test Months Code Test Weeks Code Test Days Code Test 11 May 2009 © Rob Myers 2009 6
  • 7. Instead… Code Write Test Run Test Test Run Test Run Test 11 May 2009 © Rob Myers 2009 7
  • 8. Combine Advantages Manual Writing Manual Test Testing Cases First Later Record & TDD Playback Automated 11 May 2009 © Rob Myers 2009 8
  • 9. “Move Mount Fuji” 11 May 2009 © Rob Myers 2009 9
  • 10. Two Great Flavors ATDD TDD Written by testers, • Written by developers. • generally. For the team. • • For developers. Run frequently by • • Run frequently by testers and testers and developers. developers. New tests fail until the • • All tests pass 100% story is done. Old during integration. tests should all pass. “Peanut Butter Cup” by Laura Godi 11 May 2009 © Rob Myers 2009 10
  • 11. Benefits of ATDD • Communication: • Clarifies the meaning of the story. • Story scope/boundaries: “Is it a defect?” • Progress: “We’re done!” • Concise detection of defects. • Less time troubleshooting and re- testing. • Relieves the Agilist’s Dilemma. 11 May 2009 © Rob Myers 2009 11
  • 12. Team Activities by Iteration Past Present Future ATDD/TDD Analysis/Estimation Exploratory Testing 11 May 2009 © Rob Myers 2009 12
  • 13. If Only… • …We could automate the tests without making them brittle… • …We could write tests without having to see the working product… • …We could do so without having to write in a programming language… 11 May 2009 © Rob Myers 2009 13
  • 14. Inconceivable! “You keep using that word. I do not think it means what you think it means…” -- Inigo Montoya The Princess Bride (1987) 11 May 2009 © Rob Myers 2009 14
  • 15. Fit: Framework for Integrated Tests Invented by Ward Cunningham 11 May 2009 © Rob Myers 2009 15
  • 16. Interface-Centric Tools Slow. • Difficult to set up. • Numerous failures from one defect. • Failures do not identify the defect. • 11 May 2009 © Rob Myers 2009 16
  • 17. Business-Value-Centric Tool 11 May 2009 © Rob Myers 2009 17
  • 18. Fit is Unique • We can test any “layer,” thus expanding our creative reach. • We usually avoid the UI layer. • Fit is simple. It does very little, and you can do so much with it. 11 May 2009 © Rob Myers 2009 18
  • 19. The First Martian Hotel 11 May 2009 © Rob Myers 2009 19
  • 20. The “Column” Fixture • For functions and calculations. • Can be used to “Arrange” the test. 11 May 2009 © Rob Myers 2009 20
  • 21. Fit Output 11 May 2009 © Rob Myers 2009 21 _s
  • 22. What Fit does to Your Tests Your Fit test (HTML, Excel) Fit report (HTML) Fit Fit Fixture (Test Code) System Under Test 11 May 2009 © Rob Myers 2009 22
  • 23. The “Row” Fixture For asserting state. (No input.) • For lists. • Shows missing rows as failures. • Shows extra rows as failures. • Declarative. • 11 May 2009 © Rob Myers 2009 23
  • 24. The “Action” Fixture • For a sequence of events. • For simple scripting. • Imperative. 11 May 2009 © Rob Myers 2009 24
  • 25. Error Conditions 11 May 2009 © Rob Myers 2009 25
  • 26. Tests Can Have Many Tables 11 May 2009 © Rob Myers 2009 26
  • 27. A Team Using Fit for ATDD 1. Testers and other teammates enter tests into Fit pages. 2. Developers develop Fit fixtures for the tables. 3. The team collaborates on the shape of the tables and Fit fixtures until they express what needs to be accomplished. 4. They run the tests and watch them fail cleanly (RED, not YELLOW). 5. Developers develop until tests pass. 11 May 2009 © Rob Myers 2009 27
  • 28. Fit Tools, and More Fit Tools http://fit.c2.com/wiki.cgi?FitTools 11 May 2009 © Rob Myers 2009 28
  • 29. Sample Test Organization: Regression Focus All Tests Really Slow Acceptance Tests Tests Prior Current Iterations Iteration Iteration 1 Iteration 2 11 May 2009 © Rob Myers 2009 29
  • 30. setup.html Files setup.htm All Tests setup.htm Really Slow Acceptance Tests Tests Prior Current Iterations Iteration setup.htm Iteration 1 Iteration 2 aTest.htm 11 May 2009 © Rob Myers 2009 30
  • 31. FITLIBRARY And Other Improvements 11 May 2009 © Rob Myers 2009 31
  • 32. The “Set Up” Fixture 11 May 2009 © Rob Myers 2009 32
  • 33. The “Do” Fixture 11 May 2009 © Rob Myers 2009 33
  • 34. Same Test, Additional Activities 11 May 2009 © Rob Myers 2009 34
  • 35. Improving Upon RowFixture • ArrayFixture: For ordered lists (without having to create a position() column). • SubsetFixture: Ignores surplus items. 11 May 2009 © Rob Myers 2009 35
  • 36. Does TDD Work? “The results of the case studies indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects that did not use the TDD practice. Subjectively, the teams experienced a 15–35% increase in initial development time after adopting TDD.” http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf, Nagappan et al, © Springer Science + Business Media, LLC 2008 11 May 2009 © Rob Myers 2009 36
  • 37. 11 May 2009 © Rob Myers 2009 37
  • 38. BIBLIOGRAPHY 11 May 2009 © Rob Myers 2009 38
  • 39. Fit for Developing Software – Rick Mugridge Prentice Hall July 9, 2005 ISBN-10: 0321269349 ISBN-13: 978-0321269348 11 May 2009 © Rob Myers 2009 39
  • 40. The Art of Agile Development – James Shore & Shane Warden O'Reilly Media, Inc. October 26, 2007 ISBN-10: 0596527675 ISBN-13: 978-0596527679 11 May 2009 © Rob Myers 2009 40