Agile Testing Best Practices
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Agile Testing Best Practices

on

  • 2,826 views

Have you ever bumped into a wall with your automated tests? Many developers bump into various roadblocks and hurdles when writing test code. Are your test methods starting to fail because the ...

Have you ever bumped into a wall with your automated tests? Many developers bump into various roadblocks and hurdles when writing test code. Are your test methods starting to fail because the code-under-test uses the current date and time? Are your automated integration tests failing because the database they integrate with keeps changing? Do you have an explosion of test methods, with the ratio of test code to code-under-test way too high? Is your effort to refactor and improve code overwhelmed by the time it takes to rewrite all those failing unit tests? This presentation is about clearing away Agile testing obstacles, avoiding common pitfalls, and staying away from dangerous practices.

Statistics

Views

Total Views
2,826
Views on SlideShare
2,826
Embed Views
0

Actions

Likes
1
Downloads
80
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Agile Testing Best Practices Presentation Transcript

  • 1. Agile Testing Best Practices Stephen Ritchie DCAST March Meeting 19-Mar-2013
  • 2. Agenda 1 Motivation 2 Principles 3 Obstacles Excella Consulting -2-
  • 3. Motivation Why Test Software? Excella Consulting
  • 4. Chrysler New Yorker Excella Consulting
  • 5. Motivation Why Write Automated Tests? Excella Consulting
  • 6. Achieve Desired Results • Software costs too much • Users demand quality • Testing takes too long • New features take too long Excella Consulting
  • 7. Microscope: Visibility and Insight Excella Consulting
  • 8. Smoke Detector: Problem Detection Excella Consulting
  • 9. Weather Satellite: Advanced Warning Excella Consulting
  • 10. Automated Tests Make SureSoftware Works As Intended
  • 11. Agenda 1 Motivation 2 Principles 3 Obstacles Excella Consulting - 12 -
  • 12. Agile Test Pyramid: VisionTesters AutomatedEngineers Google “Agile Test Pyramid” http://bit.ly/10Qubsy Excella Consulting
  • 13. Agile Test Pyramid: Reality Ice-Cream Cone Anti-Pattern http://bit.ly/10QpUFG Excella Consulting
  • 14. Agile Test Quadrants Excella Consulting
  • 15. Principles 1. Unit Test Developer Tests “Intention Checking” Excella Consulting
  • 16. Principles 2. Automate • Always running • Cant be bargained with • Cant be reasoned with • Tests dont feel pity or remorse or fear • Absolutely will not stop, ever, until you deliver a quality software product. Excella Consulting
  • 17. Principles 2. Automate • CI Server • Per Commit • Overnight Functional • Smoke Testing • Stability Testing • Performance/Load • Automate Deployments • Project “Dashboard” Excella Consulting
  • 18. Principles 3. Zero Configuration* I can run your tests, You can run mine. * One-time configuration is okay Excella Consulting
  • 19. Principles 4. Fast All tests run time efficiently Excella Consulting
  • 20. Principles 5. Clear Results Pass/Fail Focused Test Isolates Issue Excella Consulting
  • 21. Principles 6. Easy to Maintain Conventional Brief Excella Consulting
  • 22. Principles 7. TimelyTest-Driven Development (TDD) Test As-It’s-Built Test As-It’s-Fixed Excella Consulting
  • 23. Agenda 1 Motivation 2 Principles 3 Obstacles Excella Consulting - 24 -
  • 24. Requirements, Requirements, Requirements Obstacle 1 •Too Abstract •Changing •Over Specification Excella Consulting
  • 25. Specification by ExampleExamples & Feature Files Excella Consulting
  • 26. One Primary Assert To Rule Them All One Primary Assert Excella Consulting
  • 27. Time Crunch Obstacle 2 Time Crunch Excella Consulting
  • 28. Four Ways to Fake Time Fake Time • Virtual Machine • Isolate The System • Inspect The Clock • Dummy IClock Excella Consulting
  • 29. Dummy Real SystemClock Clock IClock Interface System Under Test
  • 30. Database Killed The Integration Test Obstacle 3 Database Integration Excella Consulting
  • 31. Fixture Setup and Data Arrangement Excella Consulting
  • 32. Fixture Setup and Data Arrangement• Schema Migration – RoundhousE – Flyway Db – Liquibase• Data Arrangement – DbUnit & NDbUnit Excella Consulting
  • 33. Now We Have Too Much Test Code Obstacle 4 Explosion of Test Code Excella Consulting
  • 34. Monitor Test Code Growth Rate Control Growth • Monitor The Ratio • Data-Drive Tests • Boundary Analysis Excella Consulting
  • 35. Bad Coupling Obstacle 5 Unhelpful Reuse Unhelpful Repetition Unhelpful Coupling Excella Consulting
  • 36. In Test Code, Do Repeat Yourself ... Do Repeat Yourself Test Code Is Different • Avoid Inheritance Reuse • Use “Context” Helpers • Repetition Is Better Than Coupling Excella Consulting
  • 37. Agenda 1 Motivation 2 Principles 3 Obstacles Excella Consulting - 41 -
  • 38. Of Course It’s Safe … After You Excella Consulting
  • 39. Shameless Self Promotion Time! • “Best Practices” Initiative • Tips and Tricks • Generate Ideas • Quantifying Value • Biases & Aversions • Tools & Technologies • Avoid Making the Same Mistake Once. Excella Consulting
  • 40. Code and Slides• Code: https://github.com/ruthlesshelp• Slides: http://www.slideshare.net/ruthlesshelp Excella Consulting
  • 41. Contact Me • Email: stephen.ritchie@excella.com • Twitter: @ruthlesshelp • Blog: http://ruthlesslyhelpful.net • LinkedIn: http://www.linkedin.com/in/sritchie Excella Consulting