-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The C++ Programmer's Mindset
By :
The next step is to write some tests for everything that we have implemented here. Of course, we should be doing this as we go along (and this was the case as we developed the code for this book), but we need to dedicate time to this separately to properly explain the tests that we construct.
As always, the tests have exposed various defects in the implementation that have allowed us to arrive at the solution that we have presented. Most of these are small, such as using the incorrect variables, and others are more significant (such as the logic in the bisection loop). Tests are important for making sure your code works correctly (or, at least, as expected) and that future changes do not break it.
Throughout this challenge, we’ve placed tests in files prefixed by test_ followed by the name of the component (see the Chapter-11 folder in the GitHub repository: https://github.com/PacktPublishing/The-CPP-Programmers-Mindset for examples). This...