Comparison of the Ada Analyzer and AdaMAT
The following items characterize the differences between the Ada Analyzer and AdaMAT from the perspective of Little Tree Consulting. Although Little Tree is not an expert on all features of AdaMAT, we have tried to fairly represent their offering to the best of our knowledge and ability.
The primary focus of the AdaMAT toolset is the generation of condensed metrics that measure certain qualities (i.e., readability or portability) of the software. Metrics of this sort can be useful:
The problem with such quality measurements is that they are very hard to correlate to specific code constructs that can be modified to improve the quality of the code.
- Quality-control personnel receive a relative measure of quality even if they are not completely literate in the Ada-level details that contribute to quality software.
- Managers can get a high-level overview of the content of their software and its relative progress toward completion. Trend analysis through the project's lifecycle can be performed.
- Developers can identify areas of high complexity or low readability where rework might be appropriate.
Although the Ada Analyzer does generate some low-level metrics such as McCabe cyclomatic complexity, line counts, and other complexity measures, its focus is on identifying specific constructs in the software that are suspect from a quality, consistency, or efficiency perspective. It collects overview information so that analysts can better understand the content of their software and make informed decisions about possible improvements. In addition to textual entries, the report output contains hypertext connections to the suspect constructs to minimize the time required to locate and repair deficiencies. In the same way that a debugger helps the user locate errors with dynamic analysis, the Ada Analyzer helps locate potential errors with static analysis. In short, the Ada Analyzer is focused at a deeper level of detail to facilitate quality improvement not just quality measurement.
Content of Standards Conformance Checks
Both Ada Analyzer and AdaMAT offer checking for violations of coding standards in both interactive and batch modes. The issue of what quality means for Ada software will always be debated and differences of opinion will always occur. As one might expect, the set of supported coding-standard checks differs between the two products. The details of these differences is beyond the scope of this document. At a high level, the Ada Analyzer supports checking of conformance to Ada 95, the Ada quality and style guidelines developed by the Software Productivity Consortium, its own software-quality guidelines, and compatibility and portability checking for other targets. The Ada Analyzer currently supports 130 standards-conformance checks and 16 Ada 95 compatibility checks. All checks can be separately enabled to match local coding standard requirements.
Ada Repair is an add-on product to the Ada Analyzer. Ada Repair takes static analysis of coding violations a step further by automatically creating new versions of Ada units that no longer contain violations. The resulting code is semantically equivalent to the original but with improved maintainability, consistency, and readability. Examples include the removal of unused with clauses, the qualification of unqualified references, and the expansion of case "when others" alternatives. There are currently 27 coding violations that can automatically be repaired. This product is integrated with the Apex configuration management system to manage the quality improvement changes made by Ada Repair. To our knowledge, AdaMAT offers no similar capability.
Generation of Data-Dictionary Information
AdaMAT's strength is metrics. Coding standards checking is supported by both products with differing reporting methods and support for specific checks (described above). The Ada Analyzer provides additional command to generate data-dictionary information. This information can be used by project personnel for reference or delivered to the customer as part of the program documentation. Examples include the location and attributes of all key program constructs, such as tasks, generics, exceptions, type declarations, and subprograms. Low-level constructs such as pragmas, representation specs, and expressions can be located when necessary. A list of all named declarations (an Ada program's name space) can be generated and sorted by kind or by name. Call trees, with-dependency hierarchies, and cross-subsystem dependency lists can also be generated. A list of all sets and uses of all objects can be generated either statically or within a specific calling thread sequence. All reports contain hyper-text links to the analyzed software to facilitate additional analysis by the user. We are unaware of similar capabilities in AdaMAT.
Addition Analysis Objectives
The Ada Analyzer supports several other analysis objective in addition to metrics collection, standards-conformance checking, and the collection of data dictionary information. Dynamic analysis that locates variables that are used before they are set is one of the more sophisticated aspects of code correctness analysis. An entire set of analysis commands is dedicated to code optimization. The generation of test procedures is supported with commands to locate all execution paths and the variables that are read (inputs) and set (outputs) along those execution paths. Several commands support the identification of code that is more portable and/or more reusable. AdaMAT support for these analysis objects in based in their collection of metrics and the condensation of readability and portability quotients.
Both the Ada Analyzer and AdaMAT are customizable. AdaMAT allows its Adamatize checks to be disabled when they are not accepted by the local coding standards. It also allows the weighting for each component of a metric to be adjusted to local preferences.
The Ada Analyzer allows coding standards checks to be enabled as errors or warnings or disabled entirely. Exceptions to any rule are allowed by marking the code with a structured comment. The Ada Analyzer also supports the development and integration of user-deÞned checks and metrics into the analysis process. This is performed via customization of check templates and the addition of the new check to the list of enabled checks. Templates and customization instructions are also available for the construction of more sophisticated analysis commands. This kind of customization is not provided by AdaMAT.
The Ada Analyzer also supports file-based customization where limits and lists of acceptable or unacceptable constructs can be specified.
little tree home | about little tree | technical articles | products | email