Unit Testing
From Missoula Bar Camp
- The business logic is what needs the best testing – and unit tests are the right tool to handle this.
- The core of unit testing is assertions
- "I assert that adding an answer will result in one more answer being associated with this topic"
- First you have a failing test, and then you do the simplest possible thing to make it pass, then refactor as necessary
- Developers could/should adopt a flow in which they run their unit tests as they change things, and then prior to building your package run your selenium tests.
- Best if you can make use of transactions in the database – so you blow it away afterwards