How to Start Unit Testing
Sometimes it’s a short post that has lots of great info.
- Start by testing you can instantiating the class.
- Test that you can call the function at all.
- Pick the easiest bit of functionality.
- Write an empty function name and assertion first.
- Write the function call as you would like it to appear.
- Refactor the existing tests.
- Pick the most interesting bit of functionality.
- Switch partners.
- Read the code for obvious flaws.
- Rerun the AT