Automatic unit test realizing method and device
A technology of unit testing and implementation methods, applied in the field of testing, can solve problems such as high coding time consumption, high personnel requirements, and heavy workload, and achieve the effects of improving testing efficiency and accuracy, reducing coding time, and realizing automation
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0028] figure 1 It is a schematic flowchart of a method for implementing an automated unit test provided in Embodiment 1 of the present invention. The method can be executed by an automatic unit test implementing device, which is implemented by software. see figure 1 The implementation method of the automated unit test provided in this embodiment specifically includes the following operations:
[0029] Operation S110, acquiring the configuration information of the object under test, the load object and the test case input by the user in this unit test.
[0030] Among them, the object under test is represented as an algorithm in the software, which is used to realize the processing of the internal or external logical relations of various load objects. The load object is represented as a structure in the software. The test case is composed of at least one assertion, and each assertion It includes an input parameter and an expected output parameter. The input parameter and the...
Embodiment 2
[0039] figure 2 It is a schematic flowchart of a method for implementing an automated unit test provided in Embodiment 2 of the present invention. In this embodiment, on the basis of the first embodiment above, operation S120 and operation S130 are optimized. see figure 2 The implementation method of the automated unit test provided in this embodiment specifically includes the following operations:
[0040] Operation S210, obtaining the configuration information of the object under test, the load object and the test case input by the user in this unit test;
[0041] Operation S220, according to the pre-generated StringTemplate code file template and the configuration information, according to the standard code format under CUnit, generate the corresponding measured object and test case code file, and the load object code file;
[0042] Operation S230, by referring to the automatic mode of the CUnit framework, based on the generated code file and the test framework code fi...
Embodiment 3
[0051] image 3 It is a schematic flowchart of a method for implementing an automated unit test provided in Embodiment 3 of the present invention. In this embodiment, the operation S230 is optimized on the basis of the second embodiment above. see image 3 The implementation method of the automated unit test provided in this embodiment specifically includes the following operations:
[0052] Operation S310, obtaining the configuration information of the object under test, the load object and the test case input by the user in this unit test;
[0053] Operation S320, according to the pre-generated StringTemplate code file template and the configuration information, according to the standard code format under CUnit, generate the corresponding measured object and test case code file, and the load object code file, and store the generated code file to the preset target folder directory;
[0054] Operation S330, determine the code file and the CUnit compilation library file of ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com