System for automatically generating tests to ensure binary...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000

Reexamination Certificate

active

06425118

ABSTRACT:

BACKGROUND OF THE INVENTION
This invention relates to compiler construction technology. More specifically, the present invention relates to the accurate translation of computer programs from one computer language to another.
Computer program, or “code,” translators are useful for translating a computer program written in a first language (the “original,” or “source” language) into a second language (the “target” language). For example, some older languages may become unpopular or outdated making their programs difficult to support because of lack of skilled programmers, lack of compatible computers to execute the code, etc. Or, a company or user of original source code may wish to translate the code to be in the same language as other programs, or to migrate the code to a computer system that doesn't support the original language.
However, the accurate translation between computer languages is extremely difficult because of the magnitude and complexity of today's computer programs. One area of difficulty in source-to-source translations is ensuring the accuracy of the translation. Since the translator itself is a large and complex computer program, like all large and complex computer programs, it is not guaranteed to operate without errors. Additionally, the translator itself may introduce an error into the target program code so that the target program behaves differently than the source program code.
Thus, a translator system that can detect discrepancies between original program code and translated program code is desirable.
SUMMARY OF THE INVENTION
The present invention provides a strategy for automatic generation of tests for source-to-source translators. This strategy makes certain that converted software components, produced in a different programming language by a source-to-source translator, are binary-compatible with all other software components of the original program that remain unchanged. With this strategy, converted software components continue as before to interact correctly with software components that remain in the original programming language. (An original computer program, with all original software components, is also referred to as the “source program”. Original software components that remain unchanged are also referred to as the “legacy code” and “legacy data” or collectively the “legacy code”. Converted software components are also referred to as the “target code”. A computer program that includes both target and legacy code is also referred to as the “target program”.)
Since target code is required to be operable with legacy code, the present invention makes certain that procedure interfaces in the target program are correct. More specifically, structure layouts are required to be binary compatible, and global variable must remain shareable. In addition, procedure calls involving both target code and legacy code are required to work seamlessly in that conversion of software components, such as processes, is transparent to the unconverted software components (i.e., legacy code).
To that end, the present invention provides a method and, for implementing the method, a system that 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. The callable procedures created by the system serve to perform tests on variables and other data that is passed to each procedure via each procedures' interface specification.
The system-generated procedure calls are designed to assign different test values to each variable while the system-generated procedures are designed to test for the value 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.
In one embodiment the invention provides a method for assuring the valid operation of a translator that translates an original computer program into a target computer program in a target language. The target language is different from the language of the original computer program. The original program includes procedures that have interface specifications. The method is executed in the system by a processor coupled to a storage device. The method includes obtaining the interface specifications from one or more procedure calls in the original computer program. The method also includes deriving and storing test procedures that use the obtained interface specifications to determine whether a variable value passed to the test procedures during execution of the test procedures is valid; using the translator to translate the test procedures onto the target language; linking the translated test procedures to one or more portions of the original computer program to produce a test module; executing the test module to execute the test procedures; and determine whether passed variable values are valid. The method further includes indicating an error condition if a passed variable value is invalid.
Another embodiment provides a method for verifying the operation of a translator for translating computer programs from a first language into a second language, the method including steps of deriving test procedures having procedure interfaces analogous to the procedure interfaces in the first language; and analyzing procedure interfaces in both the first and second languages by linking the test procedures to portions of the computer programs.
Thus, in accordance with the purpose of the present invention as embodied and broadly described herein, the present invention relates to a method for automatic generation of self-checking tests of a source-to source translation. The method includes generating test components from a source program code, the test components being in an original language; performing a source-to-source translation of the test components to produce target test components in a target language different from the original language; compiling the test components and target test components, the compilation producing test objects and target test objects, respectively; and linking, respectively, the test objects with target test objects, the linked test and target test objects being executable tests. The generating step of the method further includes scanning the source program code, the scanning producing a virtual source that represents the source program code; and parsing the virtual source, the parsing produces the representation in the form of a syntax tree of the virtual source. When the original language is Ptal, the source-to-source translation produces the target test components in C++. The test components are Verify and Do, and the source-to-source translation of the test components is performed by a Rosetta Translator. It is noted that the virtual source is in the form of a fragment tree.
In further accordance with the purpose of the invention as embodied and broadly described herein, the present invention also relates to a system for automatically generating self-checking tests of a source-to source translation. The system includes a scanner that receives a source program code and produces therefrom a virtual source representing the source program code; a parser that produces a syntax tree representation of the virtual source; a test generator that produces test components, the test components being in an original language; a translator, preferably a Rosetta Translator, that performs a source-to-source translation of the test components in order to produce target test components in a target language that is different from the original language; a compiler that produces test objects and target test objects, respecti

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

System for automatically generating tests to ensure binary... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with System for automatically generating tests to ensure binary..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and System for automatically generating tests to ensure binary... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2886077

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.