A testing tool allowing convenient testing of programs and also classes in general. The tool automatically divides each program into many groups such that if one line (or statement) is executed it may reasonably be assumed that all the lines in the group are also executed. A tester is provided the ability to provide desired arguments (including class instances) and cause all groups to be executed such that all lines of code in the programs of a class are executed at least once. The groups are conveniently further logically combined into hierarchical blocks, with each block at a higher level corresponding to a logical structure such as if structure, for structure, while structure, etc. The blocks at the lowest level may contain a single group. Due to such hierarchy, a tester may visually easily identify the unexecuted blocks/groups. The tester may further define and execute small pieces of code (macros) in the middle of testing.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method of testing a program having statements, said method comprising the steps of: a) dividing said program into a plurality of groups such that every statement in the program belongs to at least one of the groups, wherein each of said groups contains a respective sequence of ones of the statements such that all the statements of such a group are executed if at least one statement of said group is executed, and wherein such a group is deemed to be executed if at least one of the statements of the group is executed when the program is executed; b) determining the ones of the groups that are executed when said program is executed while testing said program; c) indicating unexecuted ones of the groups based on the ones of the groups that were determined in step b) to have been executed; d) enabling a tester to execute said unexecuted groups such that said tester can ensure that all statements in said program are executed at least once; e) including an extra statement in each of said groups, wherein execution of such an extra statement enables said determining in step b) to identify an executed one of the groups corresponding to said extra statement, wherein said program is contained in a plurality of programs which in turn are contained in a class of an object oriented environment; f) enabling said tester to define a macro containing a plurality of program lines; storing said macro in a database; and g) enabling said tester to execute said macro in the middle of testing said plurality of programs.
2. The method of claim 1 , wherein said extra statements contain respective group identifiers, wherein said determining in step b) further comprises examining such a group identifier to determine a specific one of the groups which has been executed.
3. The method of claim 1 , further comprising the steps of: grouping a sequence of the groups into a block; and determining tat said block has been executed only if all of the groups of the block are executed.
4. The method of claim 3 , wherein said grouping comprises: determining a language structure present in said plurality of programs; grouping a subset of groups present in said language structure into a block such that the statements in said language structure are presented as a block to said tester.
5. The method of claim 4 , wherein said blocks are defined hierarchically according to the inclusive relationship of language structures in said plurality of programs.
6. The method of claim 5 , wherein said language structure comprises one of program delimiters, control structure and loop structure.
7. The method of claim 1 , wherein said enabling comprises: enabling said tester to examine the statements associated with said unexecuted blocks such that said tester can determine arguments which would cause an unexecuted block to be executed; enabling said tester to enter said determined arguments to cause said unexecuted block to be executed.
8. The method of claim 7 , wherein such an argument comprises an instance of another object.
9. The method of claim 8 , further comprises: enabling said tester to instantiate said instance of said another object; enabling said tester to assign a name to said instance, wherein said tester can enter said name to provide said instance as an argument value.
10. The method of claim 9 , further comprising: receiving a string as an argument; and determining that said string indicates that said instance is said argument value if said name matches said string.
11. The method of claim 1 , wherein said macro is designed to examine the data structures within an instance of an object or to set the values for the variables in the object.
12. The method of claim 1 , wherein said dividing, determining, indicating and enabling are performed in a single computer system.
13. The method of claim 1 , wherein said object is generated in Java Programming language.
14. The method of claim 1 , further comprising: enabling said tester to load said class; enabling said tester to instantiate an instance of said class; and enabling said tester to execute said program on said instance.
15. A computer program product for use with a computer system, said computer program product comprising a computer usable medium having computer readable program code means embodied in said computer usable medium, said computer readable program code means enabling testing of a program having statements, said computer readable program code means comprising: dividing means for dividing said program into a plurality of groups such that every statement in the program belongs to at least one of the groups, wherein each of said groups contains a respective sequence of ones of the statements such that all the statements of such a group are executed if at least one statement of said group is executed, and wherein such a group is deemed to be executed if at least one of the statements of the group is executed when the program is executed; determining means for determining the ones of the groups that are executed when said program is executed while testing said program; indicating means for indicating unexecuted ones of the groups based on said determining; first enabling means for enabling a tester to execute said unexecuted groups such that said tester can ensure that all statements in said program are executed at least once; means for including an extra statement in each of said groups, wherein execution of such an extra statement enables said determining means to identify an executed one of the groups corresponding to said extra statement, wherein said program is contained in a plurality of programs which in turn are contained in a class of an object oriented environment; second enabling means for enabling said tester to define a macro containing a plurality of pro gram lines; storing means for storing said macro; and third enabling means for enabling said tester to execute said macro in the middle of testing said plurality of programs.
16. The computer program product of claim 15 , wherein said extra statements contain respective group identifiers, wherein said determining means examines such a group identifier to determine a specific one of the groups which has been executed.
17. The computer program product of claim 15 , further comprising grouping means for grouping a sequence of the groups into a block, and second determining means for determining that said block has been executed only if all of the groups of the block are executed.
18. The computer program product of claim 17 , wherein said grouping means comprises: third determining means for determining a language structure present in said plurality of programs; a second grouping means for grouping a subset of groups present in said language structure into a block such that the statements in said language structure are presented as a block to said tester.
19. The computer program product of claim 18 , wherein said blocks are defined hierarchically according to the inclusive relationship of language structures in said plurality of programs.
20. The computer program product of claim 15 , wherein said enabling means comprises: second enabling means for enabling said tester to examine the statements associated with said unexecuted blocks such that said tester can determine arguments which would cause an unexecuted block to be executed; third enabling means for enabling said tester to enter said determined arguments to cause said unexecuted block to be executed.
21. The computer program product of claim 20 , wherein such an argument comprises an instance of another object, and the computer program product further comprises: means for enabling said tester to instantiate said instance of said another object; means for enabling said tester to assign a name to said instance, wherein said tester can enter said name to provide said instance as an argument value.
22. The computer program product of claim 21 , further comprising: means for receiving a sting as an argument; and means for determining that said string indicates that said instance is said argument if said name matches said string.
23. The computer program product of claim 15 , wherein said macro is designed to examine the data structures within an instance of an object or to set the values for the variables in the object.
24. The computer program product of claim 21 , further comprising: means for enabling said tester to load said class; means for enabling said tester to instantiate an instance of said class; and means for enabling said tester to execute said program on said instance.
25. A system enabling a tester to test a program having statements, said computer system comprising: a random access memory (RAM); a display unit containing a display screen; an input interface; a processor dividing said program into a plurality of groups such that every statement in the program belongs to at least one of the groups, wherein each of said groups contains a respective sequence of ones of the statements such that all the statements of such a group are executed if at least one statement of said group is executed, and wherein such a group is deemed to be executed if at least one of the statements of the group is executed when the program is executed, said processor executing said program in response to instructions received from said input interface; said processor determining the ones of the groups that are executed when said program is executed; said processor causing a display to be generated on said display unit, said display indicating unexecuted ones of the groups based on the ones of the groups that were determined to have been executed; said processor enabling said tester to execute said unexecuted groups such that said tester can ensure that all statements in said program are executed at least once, wherein said processor includes an extra statement in each of said groups, wherein execution of such an extra statement enables said processor to identify an executed one of the groups corresponding to said extra; and wherein said computer system further comprises a secondary storage, wherein said processor stores said program including said extra statement on said secondary storage, wherein said program is contained in a plurality of programs which in turn are contained in a class of an object oriented environment, wherein said processor receives a plurality of program lines representing a macro, said processor storing said macro in a database, and said processor executing said macro in response to receiving an instruction to execute said macro.
26. The system of claim 25 , wherein said extra statements contain respective group identifiers, wherein said processor examines such a group identifier to determine a specific one of the groups which has been executed.
27. The system of claim 25 , wherein said processor groups a sequence of the groups into a block, and wherein said display indicates that said block has been executed only if all of the groups of the block are executed.
28. The system of claim 27 , wherein said processor groups said sequence of groups according to a language structure present in said plurality of programs.
29. The system of claim 28 , wherein said blocks are defined hierarchically according to the inclusive relationship of language structures in said plurality of programs.
30. The system of claim 25 , wherein said processor receives instructions from said input interface to display the statements associated with said unexecuted blocks, said processor causing the statements to be displayed on said display unit such that said tester can determine arguments which would cause an unexecuted block to be execute.
31. The system of claim 30 , wherein such an argument comprises an instance of another object.
32. The system of claim 31 , wherein said processor instantiates said instance of another object in response to receiving an instruction to instantiate said instance of said another object, said processor further associating a name associated with said instance of another object, wherein said name is received from said input interface and said tester can enter said name to provide said instance as an argument value.
33. The system of claim 32 , wherein said processor receives a string as an argument and determines that said string indicates that said instance is said argument value if said name matches said string.
34. The system of claim 25 , wherein said macro is designed to examine the data structures within an instance of an object or to set the values for the variables in the object.
35. The system of claim 25 , wherein said processor loads said class into said RAM in response to receiving an instruction to load said class, said processor further instantiating an instance of said class in response to receiving another instruction, said processor executing said program on said instance in response to receiving one more instruction.
36. The system of claim 25 , wherein said input interface is connected to at least one of a mouse and a key-board.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
February 14, 2001
April 22, 2008
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.