AdaCore has just released the newest version of its CodePeer 2.1 advanced static analysis tool for detecting potential run-time and logic errors in Ada programs.
According to Arnaud Charlet, CodePeer Product Manager at AdaCore, by mathematically analyzing every line of software, and considering every possible input and every path through the program, CodePeer can be used very early in the development life-cycle to identify problems when defects are much less costly to repair.
He said CodePeer 2.1 introduces many enhancements, most driven by customer feedback, including:
1 – Complete support for all new features of the upcoming Ada 2012 language revision;
2 – Improved support for race condition analysis: support for specifying custom task entry points and locking functions; automatic handling of the environment task;
3 – Detection of access to global uninitialized variables;
4 – More precise preconditions to provide more accurate messages and reduce “false positives”;
5 – Improved handling of unused assignments; and New warning on infinite loops.
The new release also includes enhancements to two tools that are part of the CodePeer product:
1 – Many new options and pretty-printing improvements in gnatpp;
2 – Coupling metrics now available in gnatmetric.
CodePeer identifies constructs that are likely to lead to run-time errors such as buffer overflows, and it flags legal but suspect code, typical of logic errors.
It also produces a detailed analysis of each subprogram, including pre- and post-conditions. Such an analysis makes it easier to find potential bugs and vulnerabilities early: if the implicit specification deduced by CodePeer does not match the component’s requirements, a reviewer is alerted immediately to a likely logic error.
CodePeer can be used in several ways. During system development it can help prevent errors from being introduced, and it can also be used as part of a systematic code review process to dramatically increase the efficiency of human review. CodePeer can also be applied retrospectively on existing code, to detect and remove latent bugs.