Exception test support technique
First Claim
1. An exception test support method, comprising:
- if a source program to be tested is analyzed, and a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, storing data of said specific class, said specific method and said exception into a storage device; and
referring to said storage device, and generating an exception occurrence stub class as a class having a same name as a name of said specific class, said the exception occurrence stub having a method, which generates said exception and has a same name as a name of said specific method.
1 Assignment
0 Petitions
Accused Products
Abstract
This invention is to provide a technique for automatically performing a test of exception handling in a program created by using an object-oriented programming language. The method according to this invention comprises: analyzing a source program to be tested; generating a driver class for invoking a method of classes included in the source program to be tested; storing data of lines in the source program to be tested, which are executed by the driver class, so as to correspond to the driver class; extracting the driver class for causing a line for invoking a specific method having a possibility that an exception occurs to be executed; generating an exception occurrence stub class as a class having a same name as a name of a specific class, wherein the exception occurrence stub class has a method, which generates the exception and has a same name as a name of the specific method; and executing the driver class and the exception occurrence stub class, and storing execution result data.
19 Citations
21 Claims
-
1. An exception test support method, comprising:
-
if a source program to be tested is analyzed, and a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, storing data of said specific class, said specific method and said exception into a storage device; and
referring to said storage device, and generating an exception occurrence stub class as a class having a same name as a name of said specific class, said the exception occurrence stub having a method, which generates said exception and has a same name as a name of said specific method.
-
-
2. An exception test support method, comprising:
-
analyzing a source program to be tested, specifying classes contained in said source program to be tested and methods contained in said classes, storing data of said classes and said methods into an analysis result storage, and if a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, storing data of a line for invoking said specific method into said analysis result storage;
referring to said analysis result storage, and generating and storing into a driver storage, a driver class for invoking a method of the specified class;
causing said driver classes stored in said driver storage to be executed, and storing data of lines in the source program to be tested, which are executed by said driver class, so as to correspond to said driver class, into an executed line data storage; and
extracting a driver class for causing a line for invoking said specific method to be executed, based on data stored in said analysis result storage and data stored in said executed line data storage. - View Dependent Claims (3, 4, 5, 6, 7)
-
-
8. An exception test support program embodied on a medium, said exception test support program comprising:
-
if a source program to be tested is analyzed, and a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, storing data of said specific class, said specific method and said exception into a storage device; and
referring to said storage device, and generating an exception occurrence stub class as a class having a same name as a name of said specific class, said the exception occurrence stub having a method, which generates said exception and has a same name as a name of said specific method.
-
-
9. An exception test support program embodied on a medium, said exception test support program comprising:
-
analyzing a source program to be tested, specifying classes contained in said source program to be tested and methods contained in said classes, storing data of said classes and said methods into an analysis result storage, and if a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, storing data of a line for invoking said specific method into said analysis result storage;
referring to said analysis result storage, and generating and storing into a driver storage, a driver class for invoking a method of the specified class;
causing said driver classes stored in said driver storage to be executed, and storing data of lines in the source program to be tested, which are executed by said driver class, so as to correspond to said driver class, into an executed line data storage; and
extracting a driver class for causing a line for invoking said specific method to be executed, based on data stored in said analysis result storage and data stored in said executed line data storage. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. An exception test support apparatus, comprising:
-
a unit that stores, if a source program to be tested is analyzed, and a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, data of said specific class, said specific method and said exception into a storage device; and
a unit that refers to said storage device, and generates an exception occurrence stub class as a class having a same name as a name of said specific class, said the exception occurrence stub having a method, which generates said exception and has a same name as a name of said specific method.
-
-
16. An exception test support apparatus, comprising:
-
an analyzing unit that analyzes a source program to be tested, specifies classes contained in said source program to be tested and methods contained in said classes, stores data of said classes and said methods into an analysis result storage, and if a specific method having a possibility that an exception occurs is detected in a specific class of said source program to be tested, stores data of a line for invoking said specific method into said analysis result storage;
a unit that refers to said analysis result storage, and generates and stores into a driver storage, a driver class for invoking a method of the specified class;
a unit that causes said driver classes stored in said driver storage to be executed, and stores data of lines in the source program to be tested, which are executed by said driver class, so as to correspond to said driver class, into an executed line data storage; and
an extracting unit that extracts a driver class for causing a line for invoking said specific method to be executed, based on data stored in said analysis result storage and data stored in said executed line data storage. - View Dependent Claims (17, 18, 19, 20, 21)
-
Specification