Sooner or later you have to call an end to the madness. What generally happens is that people write as much test software as they can in the time left over at the end of the project. The test software is inadequate, so the product gets shipped with some bugs in it. Maybe you don't believe you have to write more test software than product software. I wanted to include complete test programs for all the source code in this book, but there's just not enough room for it all.
Testing is a big job.
You have to plan money, people, and most of all, TIME for it. If you write three lines of test code for every line of product code, it will take you three times as long to write the test code. Don't expect to write and debug all your test code in the last month before the critical design review. Even if you could, it wouldn't do you much good. You have to code and test early in the development cycle while there is still time to take corrective action.