In the previous sections, we learned about the root cause analysis process and how to use GDB to debug a defect. This section will discuss how to analyze a program with and without executing it. The former is called dynamic analysis, while the latter is called static analysis.
Understanding static and dynamic analysis
Static analysis
Static analysis evaluates the quality of a computer program without executing it. Although this can usually be done by examining source code via automatic tools and code reviews/inspections, we will only focus on automatic tools in this section.
The automatic static code analysis tools are designed to analyze a set of code against one or multiple sets of coding rules or guidelines. Normally, people...