Unit test method and device
A technology of unit testing and testing methods, applied in the direction of software testing/debugging, etc., can solve problems such as poor maintainability and low efficiency of unit test programs, and achieve the effects of improving efficiency, saving workload, and maintaining good maintainability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0147] Corresponding to the method provided in Embodiment 1 of a unit test method of the present application, see Figure 7 , the present application also provides a unit test device embodiment 1, in this embodiment, the device may include:
[0148] The receiving module 701 is configured to receive an input expected field and a test value; the expected field is the return value type or the attribute type of the tested method in the original class selected by the user.
[0149] The search module 702 is configured to search the domain object from the pre-built domain object model library according to the tested method, and / or search the Mock class from the pre-generated Mock library.
[0150] A generation module 703, configured to use the domain object and / or the Mock class to generate the test method of the method under test.
[0151] Among them, in practical application, refer to Figure 8 As shown, the generating module 703 may specifically include:
[0152] The fourth obt...
Embodiment 2
[0160] Corresponding to the method provided in Embodiment 2 of a unit test method of the present application, see Figure 9 , the present application also provides a unit test device embodiment 2, in this embodiment, the device may include:
[0161] The Mock library generation module 901 is used to generate a Mock library.
[0162] refer to Figure 10 As shown, in practical applications, the generating Mock library module 901 may specifically include:
[0163] The first obtaining sub-module 1001 is used to obtain each original class that needs to be mocked in the source code to be tested.
[0164] The first reflection sub-module 1002 is configured to obtain the parameters of the methods under test in the class of each original class through reflection, and the class parameters include: the name of the method under test, parameter types and return value types.
[0165] The first generation sub-module 1003 is configured to generate each Mock class corresponding to the origina...
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