Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Useful Notes from AIPS++ Programmers Up: General Help Previous: Distributed Objects

Subsections


The AIPS++ Code Review Process

written as Note 170 by Paul Shannon, NRAO-NM
June 23, 1995
This chapter is available in postscript.

Introduction

The AIPS++ project adopted a formal procedure for quality checking code in the late summer of 1994. The procedure requires that all new core6.1 source code be submitted to the ``code cop'' (email: aips2-cop@nrao.edu) before it can become sanctioned AIPS++ code. Once received, the cop assigns a reviewer, who judges the code against the AIPS++ Standards and Guidelines (note 167). A dialog between the programmer and the reviewer may follow, eventually leading to approval of the code, and its formal inclusion into AIPS++.

In this note, I discuss the review procedure

General

There are eight documents, in addition to this one, which are essential to the code preparation and review process. Both programmer and reviewer should study them carefully, and base their work upon them.

There are three main goals for the code review, all of which are equally important:

A great deal can be learned from reading through a class, and running test and demo programs. But no review is complete until other programmers use the new code. For this reason, we have a package called trial.6.3This package is automatically distributed by the AIPS++ code distribution system. If you ask the code cop to install your code in the trial directory, it will be available for everyone to examine and use. (All of these possible users will understand that trial code is subject to change with little or no notice.)

For the Programmer

For the Reviewer

Your job is a difficult one and requires a lot of time and effort. It may also require imagination and diplomacy. Imagination is needed because you must cultivate the perspective of the non-expert client programmer, intentionally forgetting things that you know, and scrutinizing the code (the class header in particular) to make sure that it explains everything the client programmer will need to know. You must also be able to take on the domain expert's point of view, and carefully examine the new class for the quality of its overall design. You may need considerable diplomacy to persuade a recalcitrant author that they need to make changes in their code and documentation.

Your responsibililites include these specific actions:

Test Programs

The programmer must provide one or more programs that thorougly test the newly submitted code. These programs should be very simple to run, and should exercise all aspects of the new code.6.6

To indicate a successful test, it will often suffice for the test program to simply print``OK'' to standard output, and return 0 as the value of the main program. In the test program fails, it should print a descriptive error message, and return some non-zero value to the environment. Some classes and global functions (especially those which employ numerical methods) can only be adequately tested by comparing a list of expected results against actual results, making allowance for tolerable roundoff differences6.7.

The programmer may use two strategies here:

1.
Create tMyClass.out, which contains the expected results, and tMyClass.exec, a shell script which runs tMyClass, redirects the actual results to a file, and compares them to the contents of tMyClass.out.
2.
Alternatively, the tMyClass program itself creates the new results file, and runs the comparison, using a system call; when the comparison of results is complete, tMyClass prints ``OK'' and returns 0 to the environment if it is successful, just as the simpler test programs do.

next up previous contents index
Next: Useful Notes from AIPS++ Programmers Up: General Help Previous: Distributed Objects   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15