US10437714B2ActiveUtilityA1

System and method for performing script-less unit testing

Assignee: WIPRO LTDPriority: Jan 25, 2017Filed: Jan 25, 2017Granted: Oct 8, 2019
Est. expiryJan 25, 2037(~10.5 yrs left)· nominal 20-yr term from priority
Inventors:Surya Vorganti
G06F 11/3684G06F 11/3688
36
PatentIndex Score
0
Cited by
36
References
18
Claims

Abstract

Systems and methods for performing unit testing are described. During code level testing of the software code, the software code is scanned and converted into compiled code which is received by the system. The system further converts back the compiled code into its source code which comprises several units of source. However, the system filters out only user-defined units of source code for testing. The system further identifies rules for the units of source to be tested. Further, based on the rules and content of the units of source code, the system determines expected parameters. Further, the system utilizes the expected parameters for generating test eases for units of source code. The test eases generated may be a. combination of positive and/or negative test case. This way, the system automatically generates the test .cases and performs unit testing by using the generated test cases.

Claims

exact text as granted — not AI-modified
I claim: 
     
       1. A method of performing unit testing, the method comprising:
 generating, by a testing system, a source code based on a compiled code received from a user; 
 classifying, by the testing system, the source code into testable components and non-testable components, wherein the testable components comprise units of source code; 
 identifying, by the testing system, one or more rules from a set of organized rules based on the units of source code, wherein each rule defines a scope of test that is to be performed on the units of source code based on an access level of the units of source code, wherein the access level of the units of source code is a level of access to containing class, containing type and current assembly of the units of source code, and wherein the scope of test defined by one rule is different from another rule in the set of organized rules; 
 determining, by the testing system, one or more expected parameters corresponding to each unit of source code from the units of source code, based on the one or more rules and content of the unit of source code, wherein the content comprises one or more input fields; 
 generating, by the testing system, one or more test cases for each of the one or more input fields of the unit of source code by using the one or more expected parameters; and 
 performing, by the testing system, a script-less unit testing of the compiled code by executing the one or more test cases. 
 
     
     
       2. The method as claimed in  claim 1 , wherein the compiled code comprises at least one of an executable code and any compiled code associated with a programming language. 
     
     
       3. The method as claimed in  claim 1 , wherein the units of source code comprises at least one of a subroutine, a procedure, a function, a method, a callable unit, or a subprogram associated with the compiled code. 
     
     
       4. The method as claimed in  claim 1 , wherein the one or more test cases are associated with at least one of a positive test case and a negative test case. 
     
     
       5. The method as claimed in  claim 1  further comprising receiving values corresponding to the one or more expected parameters and one or more testing parameters from the user through a user-interface. 
     
     
       6. The method as claimed in  claim 1  further comprising dynamically updating a newly added unit of source code into the testable components. 
     
     
       7. A testing system for performing unit testing, the system comprising:
 a processor; and 
 a memory communicatively coupled to the processor, wherein the memory stores processor-executable instructions, which, on execution, causes the processor to:
 generate a source code based on a compiled code received from a user; 
 classify the source code into testable components and non-testable components, wherein the testable components comprise units of source code; 
 identify one or more rules from a set of organized rules based on the units of source code, wherein each rule defines a scope of test that is to be performed on the units of source code based on an access level of the units of source code, wherein the access level of the units of source code is a level of access to containing class, containing type and current assembly of the units of source code, and wherein the scope of test defined by one rule is different from another rule; 
 determine one or more expected parameters corresponding to each unit of source code from the units of source code, based on the one or more rules and content of the unit of source code, wherein the content comprises one or more input fields; 
 generate one or more test cases for each of the one or more input fields of the unit of source code by using the one or more expected parameters; and 
 perform a script-less unit testing of the compiled code by executing the one or more test cases. 
 
 
     
     
       8. The testing system as claimed in  claim 7 , wherein the compiled code comprises at least one of an executable code and any compiled code associated with a programming language. 
     
     
       9. The testing system as claimed in  claim 7 , wherein the units of source code comprises at least one of a subroutine, a procedure, a function, a method, a callable unit, and a subprogram associated with the compiled code. 
     
     
       10. The testing system as claimed in  claim 7 , wherein the one or more test cases, are associated with at least one of a positive test case and a negative test case. 
     
     
       11. The testing system as claimed in  claim 7 , wherein the processor is further configured to receive values corresponding to the one or more expected parameters and one or more testing parameters from the user through a user-interface. 
     
     
       12. The testing system as claimed in  claim 7 , wherein the processor is further configured to dynamically update a newly added unit of source code into the testable components. 
     
     
       13. A non-transitory computer-readable medium storing instructions, wherein upon execution of the instructions by one or more processors, the processors perform operations comprising:
 generating a source code based on a compiled code received from a user; 
 classifying the source code into testable components and non-testable components, wherein the testable components comprise units of source code; 
 identifying one or more rules from a set of organized rules based on the units of source code, wherein each rule defines a scope of test that is to be performed on the units of source code based on an access level of the units of source code, wherein the access level of the units of source code is a level of access to containing class, containing type and current assembly of the units of source code, and wherein the scope of test defined by one rule is different from another rule; 
 determining one or more expected parameters corresponding to each unit of source code from the units of source code, based on the one or more rules and content of the unit of source code, wherein the content comprises one or more input fields; 
 generating one or more test cases for each of the one or more input fields of the unit of source code by using the one or more expected parameters; and 
 performing a script-less unit testing of the compiled code by executing the one or more test cases. 
 
     
     
       14. The medium of  claim 13 , wherein the compiled code comprises at least one of an executable code and any compiled code associated with a programming language. 
     
     
       15. The medium of  claim 13 , wherein the units of source code comprises at least one of a subroutine, a procedure, a function, a method, a callable unit, and a subprogram associated with the compiled code. 
     
     
       16. The medium of  claim 13 , wherein the one or more test cases, are associated with at least one of a positive test case and a negative test case. 
     
     
       17. The medium of  claim 13 , wherein the processor is further configured to receive values corresponding to the one or more expected parameters and one or more testing parameters from the user through a user-interface. 
     
     
       18. The medium of  claim 13 , wherein the processor is further configured to dynamically update a newly added unit of source code into the testable components.

Join the waitlist — get patent alerts

Track US10437714B2 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.