摘要 |
A system and method that implement a strategy for automatically generating self-checking tests of source-to-source translation. The tests make certain that software components produced by a source-to-source computer language translator continue to be binary-compatible with all other software components with which they previously interacted correctly, including components that remain in the original programming language. To that end, the correctness of procedure interfaces in a target computer program is also verified. With this strategy, correct translation of text preprocessor mechanisms such as macros, conditionally compiled regions of code, and source file inclusion can be achieved. The target program is the result of translating a source program written in a different language from the target program. The system creates a set of procedure calls to each procedure in the source program. The system also creates a set of callable procedures with the same interface specification as in the source program. However, the callable procedures created by the system to serve to perform tests on variables and other data that is passed to each procedures' interface specification. The system-generated procedure calls are designed to assign different test values to ensure that a valid interface exists. For example, high, low, zero, and random values, or other values, are chosen for a variable to test. The procedure calls, and callable procedures, are generated in the source language and are also translated into the target language by a translator. The procedure calls and callable procedures in both language formats are then cross-linked and executed to determine whether the translator is translating correctly with respect to the procedure interface specifications.
|