A method for generating program specification from source program - analysis by transforming program structure and argument manipulation

This paper proposes a method of transformation analysis for the automatic generation of program specification from the source program. The system APSG/I (Automatic Program Specification Generator I), on which the proposed method is implemented, is discussed. The transformation analysis notes the similarity to the list-processing program of Prolog. By utilizing the framework of analogical reasoning, the specification for the given program is generated based on the typical list-processing programs and its specification. When the program is inputted, the following two aspects are examined and the difference is determined by comparison with the already defined typical program: 1 the structure specified by the existence of the command or the order of the execution; and 2 the combination of arguments specified by the passing of data, etc. Then based on the determined difference, the already defined program specification is transformed, and the specification for the inputted program is generated. The specification generated by the proposed transformation analysis has the following features: 1 the result is the natural language sentence, since the program specification and the transformation rule for the specification are defined by the natural language; and 2 the format is unified and sufficient information to the details is contained.

[1]  Leon Sterling,et al.  The Art of Prolog , 1987, IEEE Expert.

[2]  Alan R. Hevner,et al.  Using function abstraction to understand program behavior , 1990, IEEE Software.