US2007271483A1PendingUtilityA1

Method and system for dynamically invoking and/or checking conditions of a computer test program

50
Assignee: PARASOFT CORPPriority: Aug 10, 2001Filed: Aug 3, 2007Published: Nov 22, 2007
Est. expiryAug 10, 2021(expired)· nominal 20-yr term from priority
G06F 11/3698G06F 11/3688G06F 11/3684
50
PatentIndex Score
0
Cited by
0
References
0
Claims

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 comments 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.

Claims

exact text as granted — not AI-modified
1 . A method for testing a computer code including contracts, the method comprising: 
 analyzing the contracts included in the computer code;    combining information from the computer code and information from analyzed contracts to create relevant inputs for unit test cases;    executing the unit test cases with the generated relevant inputs; and    suppressing expected errors based on the analyzed contract information.    
     
     
         2 . The method of  claim 1 , wherein the computer code comprises JAVA programming language.  
     
     
         3 . The method of  claim 1 , wherein the computer code comprises Java Server Pages programming language.  
     
     
         4 . The method of  claim 1 , further comprising reporting any violation in functioning of the contracts on a display monitor.  
     
     
         5 . The method of  claim 1 , further comprising altering program execution when a violation in functioning of the contracts is found.  
     
     
         6 . The method of  claim 1 , further comprising automatically generating the unit test cases.  
     
     
         7 . The method of  claim 6 , wherein automatically generating unit test cases comprises generating automatic stubs.  
     
     
         8 . The method of  claim 1 , further comprising regression testing of the computer code.  
     
     
         9 . The method of  claim 8 , wherein the regression testing step comprises: 
 determining first outcomes for the generated unit test cases;    re-executing the generated unit test cases;    determining second outcomes for the re-tested unit test cases;    checking the second outcomes against the first outcomes; and    reporting a regression error when the second outcomes do not match the first outcomes.    
     
     
         10 . The method of  claim 1 , further comprising storing the generated test cases for future use.  
     
     
         11 . The method of  claim 1 , further comprising a graphical user interface (GUI) for accepting user's input.  
     
     
         12 . The method of  claim 11 , further comprising reporting any violation in functioning of the contracts in the GUI.  
     
     
         13 . The method of  claim 11 , wherein reporting any violation comprises reporting only the portion of the computer code that violates proper functioning of the contracts.  
     
     
         14 . The method of  claim 1 , wherein the computer code includes a plurality of classes and components, and further comprising: 
 verifying proper functioning of the plurality of classes and components    compiling the verified plurality of classes and components;    responsive to the analyzing contracts, generating a second plurality of classes each with extra bytecodes that describe how the respective class is expected to function;    integrating the second plurality of classes with a system under test;    executing the system under test;    monitoring the system under test while being executed; and    detecting any contract violation of the integrated plurality of classes.    
     
     
         15 . The method of  claim 1 , wherein the computer code is source code.  
     
     
         16 . A method for testing a class in a computer code including software contracts, the method comprising: 
 analyzing contract information of the computer code;    automatically generating stubs to cover permissible branches of the contracts included in the computer code responsive to the analyzed contract information;    instrumenting the class with the generated stubs;    executing the computer code with the instrumented class; and    suppressing expected errors responsive to the analyzed contract information.    
     
     
         17 . The method of  claim 16 , further comprising altering the computer code execution if any violation in functioning of the class is found.  
     
     
         18 . 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: 
 analyzing the contracts included in the computer code;    combining information from the computer code and information from analyzed contracts to create relevant inputs for unit test cases;    executing the unit test cases with the generated relevant inputs; and    suppressing expected errors based on the analyzed contract information.    
     
     
         19 . The computer readable medium of  claim 18 , wherein the computer code is source code.  
     
     
         20 . The computer readable medium of  claim 18 , further including instructions for automatically generating the unit tests including stubs.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.