Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Testing the Sad Paths
About Me
• 20 years of developing web apps
• Doing TDD/BDD since 2001
• Working with Ruby for the last 8 years
Teespring
• ~ 100,000 lines of code in the web app
• ~ 5,000 Requests / 800 pages per minute
• ~ 7 million shirts sold in ...
Teespring
• We try to TDD as much as possible
• We do serious code review
• We use a CI Server to test pull requests
• We ...
Some Tools We Use
• Ruby/Rails/(and JS) Stack
• Rspec
• Capybara
• Webmock/VCR
• SimpleCov
What Do We Test?
The Sad Path
The Sad Path
• Happy paths are usually tested and built first
• Sad paths can be overlooked
• Many users will find the sad p...
Your QA team
They often deal with the sad paths while manual testing
Error Handling
• Defensive Coding
• Handling expected problems
• Logging/Tracking error information
• “Exceptional Ruby” c...
Failure Modes
Three Types of Failure
• User does something wrong
• System does something wrong
• Transient - overloaded, slow, unavailab...
Testing for User Errors
Things to Consider
• What constitutes valid vs. invalid input?
• Where can invalid input possibly enter the
system?
• How ...
Logic Errors
Things to Consider
• Almost any part of your system can fail.
• Handling vs. preventing failure
• Nil is a tenacious enemy...
Transient Errors
Things to Consider
• Is it even worth retrying?
• Retrying forever is probably a bad thing.
• How do you communicate to us...
Questions?
Links
• http://rspec.info/
• https://cukes.info/
• https://github.com/jnicklas/capybara
• https://github.com/bblimke/webmo...
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Testing sad-paths
Upcoming SlideShare
Loading in …5
×

Testing sad-paths

Matt van Horn's slides from his talk at the Automated Testing SF meetup in February 2015.

  • Be the first to comment

Testing sad-paths

  1. 1. Testing the Sad Paths
  2. 2. About Me • 20 years of developing web apps • Doing TDD/BDD since 2001 • Working with Ruby for the last 8 years
  3. 3. Teespring • ~ 100,000 lines of code in the web app • ~ 5,000 Requests / 800 pages per minute • ~ 7 million shirts sold in 2014 • Real people making real money
  4. 4. Teespring • We try to TDD as much as possible • We do serious code review • We use a CI Server to test pull requests • We also do manual QA before deploying • (And, one other thing - we’re hiring!)
  5. 5. Some Tools We Use • Ruby/Rails/(and JS) Stack • Rspec • Capybara • Webmock/VCR • SimpleCov
  6. 6. What Do We Test?
  7. 7. The Sad Path
  8. 8. The Sad Path • Happy paths are usually tested and built first • Sad paths can be overlooked • Many users will find the sad path
  9. 9. Your QA team They often deal with the sad paths while manual testing
  10. 10. Error Handling • Defensive Coding • Handling expected problems • Logging/Tracking error information • “Exceptional Ruby” covers this topic really well
  11. 11. Failure Modes
  12. 12. Three Types of Failure • User does something wrong • System does something wrong • Transient - overloaded, slow, unavailable, etc.
  13. 13. Testing for User Errors
  14. 14. Things to Consider • What constitutes valid vs. invalid input? • Where can invalid input possibly enter the system? • How do you deal with invalid input in other parts if the system?
  15. 15. Logic Errors
  16. 16. Things to Consider • Almost any part of your system can fail. • Handling vs. preventing failure • Nil is a tenacious enemy • How will you recover from errors?
  17. 17. Transient Errors
  18. 18. Things to Consider • Is it even worth retrying? • Retrying forever is probably a bad thing. • How do you communicate to users to come back later? • How do you isolate the failure to a small area?
  19. 19. Questions?
  20. 20. Links • http://rspec.info/ • https://cukes.info/ • https://github.com/jnicklas/capybara • https://github.com/bblimke/webmock • https://github.com/vcr/vcr • https://github.com/colszowka/simplecov • http://exceptionalruby.com/

×