There are two basic ways of verifying that code is functioning:
- Inspection: Looking at the code to find errors
- Testing: Running the code with multiple inputs and verifying the correct functionality
In this chapter, we will learn about both the strategies and the tools Qt brings to the table to help with them. We will also talk a little about the importance of code coverage for any verification or testing effort.
Some may break this into two parts for each category I listed—Inspection and Analysis and Testing and Demonstration. Personally, I feel that just confuses things. You can either inspect the code, including analyzing the logic/calculations, or you can test the code, which is really just a demonstration that it works.
We will start with code analysis because Qt makes it so easy to do some of the work.