Static analysis examines source code without running it. It spots bugs, coding rule violations and security flaws as the code is written, while a defect is still cheap to fix. Here is what it detects, what it does not do, what the standards say about it, and how to go about it when you have several tools and several teams.
A test runs the program and observes what it does. Static analysis reads the code instead: it rebuilds its structure, follows the possible values of variables and the execution paths, then reports likely defects and departures from coding rules. It needs neither the target hardware nor test cases. It can therefore run on every change, in the developer's environment as well as in the continuous integration pipeline.
The compiler already performs a form of static analysis: its compiler warnings are the first level of verification, and the most underrated one. Dedicated tools go much further.
| Category | Examples |
|---|---|
| Run-time errors | Null pointer dereference, division by zero, array or integer overflow, variable read before it is initialized. |
| Logic and resource defects | Memory leaks, unclosed files, dead code, conditions that are always true, poorly protected concurrent access. |
| Coding rules | MISRA C and MISRA C++, AUTOSAR C++14, CERT C, CERT Java (SEI CERT Oracle Coding Standard for Java), the Philips C# coding standard maintained by TIOBE, in-house company rules. |
| Security | Injections, unchecked external data, dangerous functions, weaknesses listed in the CWE. |
| Maintainability | Cyclomatic complexity, duplication, excessive dependencies between modules. |
| Compiler warnings | The ones the compiler already issues, but that nobody follows up on. |
They check compliance with a coding standard: MISRA, CERT, naming conventions. They are the fastest and the easiest to adopt.
They follow data flow and control flow to find likely run-time errors. They are very useful, but they do not find everything and they raise false alarms.
Tools based on it, such as Coverity, prove the absence of certain classes of run-time errors. They are more demanding to deploy, and valuable for critical software.
They focus on vulnerabilities, for example Checkmarx or Fortify.
They assess the complexity, duplication and structure of the code.
No tool covers everything. Most teams combine several, often depending on languages and projects, and that is where the trouble starts: scattered results, different formats, no big picture.
No tool can decide every property of a program. There will always be unreported defects and unjustified alarms. The point is to tune them, not to ignore them.
It finds defects in the code; only tests verify that the code meets its requirements. The two complement each other, and test coverage measures what the tests actually exercised.
A list of ten thousand alarms produced once improves nothing. You need a starting point, priorities, and one simple rule: new code adds no defects.
| Standard | What it asks for |
|---|---|
| ISO 26262-6 (automotive) | Recommends static code analysis to verify software units, whatever the ASIL, and requires coding guidelines, for example MISRA C. |
| IEC 61508-3 (industrial) | Rates static analysis as "recommended" at SIL 1 and "highly recommended" from SIL 2 to SIL 4. |
| EN 50128 / EN 50716 (railway) | Devotes a table of techniques to it among the software verification methods. |
| DO-178C (avionics) | Requires reviews and analyses of the source code: compliance with coding standards, accuracy, consistency. A tool whose output replaces a verification activity must be qualified under DO-330. |
| IEC 62304 (medical) | Requires software unit verification without imposing a technique; static analysis is a common way to meet it. |
Outside embedded software, no standard mandates static analysis. But auditors, customers and regulators increasingly ask for evidence of code quality, especially for code delivered by subcontractors.
Most of the time, the problem is not a lack of tools, but how many there are. Each project has its analyzers, each tool its format, and nobody can tell whether code quality is improving.
TiCS does not replace your analyzers: it orchestrates them. It takes in the results of more than a hundred tools, in 25 languages, including:
It maps them to the ISO/IEC 25010 quality model and sums them up in one indicator, the TQI, readable from developers to management. Quality gates stop new code from adding defects. Trends show whether quality is improving, project by project and across the whole portfolio. TiCS is installed on-premise when your context requires it.
Static analysis reads the code without running it. Dynamic analysis observes the program while it runs: tests, coverage measurement, run-time memory error detection. The two complement each other.
No. It takes care of the mechanical checks, such as coding rules and common errors, so that reviews can focus on design and logic.
Rarely. You set a baseline, deal with serious defects first, and forbid adding new ones in new code. The debt then shrinks as the code is changed.
Yes, in the same way. It is even one of the best ways to check its quality without reviewing everything.
A first assessment takes a few days. The TiCS proof of concept runs on your code, with your tools.
A free TiCS proof of concept, installed and configured by a Precilog consultant, on a few applications of your choice.
TiCS · Languages and integrations · TiCS or SonarQube? · Testwell CTC++ · Standards · Learn