In the previous post, we've looked at what to test. Now it's time to see how to test. There are several different aspects:
- summary of Ruthless Testing, from The Pragmatic Programmer: from Journeyman to Master
- Regression Testing - Here, we test the result of current test with its previous results. This ensures that the bugs we fixed today didn't break the things that were working yesterday.
- Test data - There are two types of test data: real world data and synthetic data. Both are important, because each of these tests different aspects and behaviour of the system.
- Exercising GUI Systems - Testing GUI required special testing tools. Some of them record the events and play whenever required, while some others are based on a script. Writing code that is decoupled from GUI helps us to write better tests, because we can test the backend without interacting with the GUI.
- Testing the Tests - How do we test the tests? The easiest way is to introduce bugs intentionally in the tests and see if they complain.
- Testing Thoroughly - How do we know if we have tested our code thoroughtly? The answer is we don't, and we never will. But we can use coverage analysis tools to keep track of it.