Carl Meyer, a web developer, recently gave a talk at PyCon 2013, Getting Started with Automated Testing. This is a great primer for developer testing. He uses Python in the interactive examples, but the lessons apply to any language.
Why Automate Tests?
- Make sure your code is working as intended.
- Tests are a great documentation tool to explain the intended behavior for the next person maintaining your code.
- Manual testing takes time, and if you have to run the tests over and over again (due to changes in your code), you will appreciate the investment you took to automate. He gave a great example of a friend who had to debug the 14th page of a survey. Each code tweak meant filling in 13 forms just to get to that 14th page.
- Bug reporting is a lot easier if you can point to an automated test that invokes the bug.
- Great quote: “Writing tests on weekdays is better than debugging code on weekends”
Tips for developers