Become a Pragmatic Programmers means we have to find our bugs as soon as possible before the others, so we don’t have to endure the shame of others finding our bugs later.
Test Early. Test Often. Test Automatically.
“Code a little, test a little”. Make sure that if the bug is found, fixed it as soon as possible, it’s cheaper to fix it now than fix it later when everything get complicated
Coding Ain’t Done ‘Til All the Tests Run
There are three main aspects of what should we test and how we do it.
What to Test
Unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use
Integration testing is the major subsystems that make up the project work and play well with each other.
Validation and verification: Make sure every probability of user input is covered in validation and verification and discover how t will behave when it’s on the real production environment. How the memory usage and disk usage when it runs by the user.
Performance testing: When a product goes to production, we will meet the performance issues. Maybe the program is not fast enough, maybe the memory usage is too big for a user with a low spec of a computer. Performance testing will help us to make sure that
How to Test
Regression testing: we compare the output of the current test with previous values.
When to Test
When there’s any production code ready to deploy, it needs to be tested.
Most of the test should be done automatically.