Using Static Code Analysis to Reduce Programming Errors
Static code analysis is a method of examining code, without executing it, and reporting on inconsistencies, redundancies, and design patterns known to cause defects or unexpected run-time behavior. It can also ensure compliance with internal, and industry-standard coding standards such as MISRA.
Coding Standards Enforcement
Organizations developing safety-critical embedded software applications benefit greatly by adopting coding standards. Enforcement of coding standards reduces the probability of introducing errors by:
- Identifying problematic constructs the underlying language allows
- Restricting or eliminating use of those constructs within the application code
Some software development organizations, such as those building embedded automotive applications, have long embraced coding standards for software development. MISRA C, and MISRA C++ for example, are widely used in the automotive industry.
Combining Static Analysis and Dynamic Testing
Vector Software supports static code analysis for embedded C and C++ with VectorCAST/Lint. VectorCAST/Lint utilizes the powerful Lint analysis engine from Gimpel Software.
VectorCAST/Lint provides a perfect complement to the VectorCAST dynamic testing tools which provide users with automated unit and integration testing, including code coverage and regression test management capability.
It is important to note that the VectorCAST/Lint and VectorCAST/C++ are completely integrated, but can be used separately or togther. The dynamic tools used for unit/integration test and code coverage have no dependence on the static analysis for information to construct executable test harnesses. This alleviates the need to run the static analysis every time a change is made to a file when doing unit, integration, and regression testing.