Method and system for dynamically invoking and/or checking conditions of a computer test program
First Claim
1. A method for testing a computer code including software contracts, the method comprising:
- parsing the computer code;
analyzing the contracts included in the parsed computer code;
automatically combining information from the parsed code and information from analyzed contracts to create relevant inputs for unit test cases to cover different conditions that the contracts specify;
executing the unit test cases with the generated relevant inputs;
verifying proper functioning of the different conditions in the contracts; and
suppressing expected errors based on the analyzed contract information.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for dynamically invoking and/or checking conditions of a computer test program. Test cases that verify class/component functionality are automatically created from the DbC contracts. When the classes/components that contain DbC contracts are added to the system, the invention automatically verifies whether the system uses them correctly. The information in the contract continents is used to generate more comprehensive and better quality test cases.
In one embodiment, a code'"'"'s specification information is analyzed and a class with extra bytecodes that describe how the class is supposed to work and be used is generated. Next, the instrumented class is integrated into the system, and the system is run. The system is monitored as it runs and contract violations are automatically detected.
-
Citations
24 Claims
-
1. A method for testing a computer code including software contracts, the method comprising:
-
parsing the computer code; analyzing the contracts included in the parsed computer code; automatically combining information from the parsed code and information from analyzed contracts to create relevant inputs for unit test cases to cover different conditions that the contracts specify; executing the unit test cases with the generated relevant inputs; verifying proper functioning of the different conditions in the contracts; and suppressing expected errors based on the analyzed contract information. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A method for testing a class in a computer code including software contracts, the method comprising:
-
analyzing contract information of the computer code; based on the analyzed contract information, automatically generating stubs to cover permissible branches of the contracts included in the computer code; instrumenting the class with the generated stubs; integrating the instrumented class with the computer code; running the computer code with the instrumented class; monitoring the computer code while it is being run; detecting any contract violation of the integrated class; and suppressing expected errors based on the analyzed contract information. - View Dependent Claims (16, 17, 18, 19, 20)
-
-
21. A computer readable storage medium having stored thereon a set of instructions including instructions for testing a computer code including software contracts, the instructions, when executed by a computer, cause the computer to perform the steps of:
-
parsing the computer code; analyzing the contracts included in the parsed computer code; automatically combining information from the parsed code and information from analyzed contracts to create relevant inputs for unit test cases to cover different conditions that the contracts specify; executing the unit test cases with the generated relevant inputs; verifying proper functioning of the different conditions in the contracts; and suppressing expected errors based on the analyzed contract information. - View Dependent Claims (22, 23, 24)
-
Specification