littletree logo

Integrating the Ada Analyzer into a Software Development Process

The following paper describes how use of the Ada Analyzer can be integrated into a software development process. It describes the commands that each group within a software development team would use during various phases of the lifecycle.


Coding and Testing:

During coding, developers should execute the Locate_Coding_Violations_Interactively command often to check their Ada units for standards-conformance violations. This will ensure that emerging implementations do not contain coding violations that are more expensive to identify and remove later in the lifecycle. The interactive nature of this command can be used to immediately identify and repair violations.

The Display_Subprogram_Branch_Points command can be used to aid the developer in generating test driver programs. It can identify all paths and the variables that are used (inputs) and set (outputs) along each path.

Before Code Review or Internal Release:

One of the most effective ways to engineer quality into software is through some form of peer review process. A formal code review allows each developer the opportunity to get feedback from other members of the development team. It is important, however, that the code submitted for review be as high quality as possible so that reviewers focus on more substantive issues than the presence of coding violations or statically locatable problems. It should be mandatory that developers bring the results of the following commands to code review.

When preparing for code review, developers should also use the Generate_Listing command to create a postscript listing of their software. This listing will contain line numbers and be pretty printed in fancy format (key words bold, comments in italics) making it easier to read. Documentation tools (Framemaker, Interleaf, or other word processoring software) can be used to generate a table of contents for easy reference. Use of the Ada Analyzer Include_Line_Numbers switch will generate reports with line numbers correlated to the line numbers in the listing.

Code Reviewers

Preparing for Code Review:

Preparation for code review can be a difficult and time consuming process, especially since the reviewer is not the author of the code and likely has little understanding of its organization and content. The Ada Analyzer can be used to minimize the amount of time it takes to prepare for code review. Since developers are required to execute most of the code correctness and coding-standard verification commands, reviewers need not re-execute those commands. They can review these reports at code review, if necessary. Since no developer wants to present code that contains standards violations or defects, reviewers can be assured that the code under review is substantially free of those problems. They can, however, use the Ada Analyzer in other ways.

The following commands can be used to locate key constructs. This will give the reviewer some insight into the structure and content of the code. Since these constructs are often critical to the design of the code, locating them will help reviewers focus analysis on these key constructs.

The following commands can be used to locate complexity in a program. Areas of high complexity are more likely to contain code that requires external review. Output from these commands can help a reviewer focus on the places of highest return for the time they have to invest.

Once a single instance of a problem is found during analysis, the Ada Analyzer can be used to locate all occurrences of that problem. The commands designated to analyze Program Content would be the most likely candidates. Similarly, if the reviewer notices some interesting characteristic (like implementation specific constructs or a particular kind of construct usage), the Program Content commands can be used to focus analysis on those features.


Preparing For Design Review:

In addition to code reviews that focus on specific implementation of functional requirements, design reviews should be held to ensure quality of the system as a whole. At this level, review should focus on the structure of the software and the inter-relationship of the Ada features it uses. The following commands support analysis of the software structure:

The following commands support analysis of global software content and the inter-relationship of features.

Some code correctness analysis must be performed on a global level to locate problems. The following commands support analysis of global software defects and inconsistencies.

During Optimization:

Most software systems reach a point where they generally work as specified, but execute too slowly or take too much memory. The following commands can be used to assist the designer in analyzing the potential for optimization.


Analyzing Project Status:

Most Managers will not focus on the detailed Ada content of the system but on the management of the development process. Collecting and comparing metrics at significant release points can indicate trends that may suggest reallocation of resources. Line counting metrics can indicate progress toward completion and be used as an estimate for the amount of testing resources required.

Documentation Personnel

Generating Documentation Deliverables:

The Ada Analyzer can be used to create part of the deliverable documentation for a software system. Providing reference documentation on the content and structure of the delivered software can help the customer perform acceptance testing and/or perform future maintenance. Software projects can propose delivery of this additional documentation for little additional cost when it can be automatically generated. Although almost any Ada Analyzer report could be delivered as documentation, the following reference oriented commands may be the most likely:

Quality Assurance Personnel

In addition to these commands, an IV&V team would execute the following Ada Analyzer commands to ensure that customer releases are of the highest quality:

Analyzing Legacy Code

The approach to analyzing legacy code can be treated as one big design and code review. The commands that are specified above for these activities can also be used effectively in this context. This information can be used to estimate the cost of maintaining software or adding new features to the code.

Use of the Ada repair tool can be especially effective when beginning management of legacy code. Ada Repair can be used to remove inconsistencies in the code and transform it into a state that is easier and less costly to manage. Readability, consistency, and maintainability can be dramatically improved with a small set of semantically benign transformations.

One additional aspect of analyzing legacy code is the question of portability. The following commands support this analysis:

Finally, legacy code is often analyzed for reusable pieces. Although the determination of real reusability is beyond the scope of static analysis tools, indicators such as generic units and the use of private types can identify units with higher probability for reuse. In addition, the following considerations apply:

  1. Subprograms that operate only on their parameters and not on external variables may be good candidates for general utilities.

  2. Reusable units should have a limited dependency closure. If they depend on too many other units, the entire closure may be difficult to use in other contexts.

  3. Named numbers should be declared and referenced instead of literals sprinkled throughout the program.

  4. Units that have any host/target dependencies (see previous objective) generally will not be reusable.

  5. Packages containing static variables must either support synchronized access to these variables or state that they are not generally usable in multitasking applications.

The following commands can be used to assist in analyzing reusability:

little tree home | about little tree | technical articles | products | email