Chapter 90. Applicable and Achievable Static Analysis
Heidy Khlaaf
SA (static analysis) is a method of analyzing software properties without executing code and varies in its rigor, encompassing analyses from syntactic checks (e.g., linters) to formal verification techniques. SA can either be manual or automatic, requiring mathematical proofs for the former or automated inspection by static analyzers for the latter.
Generally, static analysis can be categorized by three broad categories, ranked in increasing order of rigor, as follows:
Code compliance and metrics analysis
Integrity analysis
FV (formal verification)
Code compliance checks source code against some set of defined syntactic rules that are deemed to be good practice. Tools that support code compliance often include metric analysis aimed at assessing code complexity, which includes measures such as:
Cyclomatic complexity (the number of decision points in a module)
Path complexity (the number of possible paths through a code module)
Code compliance checkers can build confidence in the quality of the code through identifying poorly constructed code, syntactic nonconformance, or complex control flow that may lead to defects. This can reduce, rather than eliminate, the probability that the code at hand exhibits unexpected behavior.
Generally, static analysis techniques best suited for verifying and validating ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access