Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Unit Test Methods and Fixtures

A unit testing and test case technology, applied in software testing/debugging, error detection/correction, instrumentation, etc., can solve the problems of reduced test efficiency, test errors, and high time cost

Active Publication Date: 2021-09-14
杭州有赞科技有限公司
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical defect of the above-mentioned existing technology is that in the process of writing test cases, more energy needs to be invested, even more time and energy than business code development is invested to write unit test codes covering various scenarios, and the time cost is high; Moreover, there are too many manual interventions and test errors caused by human factors, so more or less loopholes left in the source program cannot be found in time, reducing the test efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Unit Test Methods and Fixtures
  • Unit Test Methods and Fixtures
  • Unit Test Methods and Fixtures

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0047] The above and other technical features and advantages of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Apparently, the described embodiments are only some of the embodiments of the present invention, not all of them.

[0048] see figure 1 , the unit testing method provided by Embodiment 1 of the present invention includes the following steps;

[0049] S100. Obtain the test object input under the current unit test, obtain each class information and method information corresponding to the test object through a reflection mechanism, and generate a unit test according to each class information and method information according to preset rules and preset code templates in turn. code; unit test code includes composite index key information;

[0050] S200. Load the associated configuration list from the database according to the combined index key information, and parse the configuration list to obtain test ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention discloses a unit test method and device, wherein the method includes: obtaining the test object input under the current unit test, obtaining each class information and method information corresponding to the test object through a reflection mechanism, and sequentially according to each class information and method information to generate unit test code according to preset rules and preset code templates; unit test code includes combined index key information; loads the associated configuration list from the database according to the combined index key information, and parses the configuration list, in turn Read all the parsed test case data, execute the unit test code, and generate a test report according to the execution result. It not only realizes the automatic generation of unit test code, which greatly improves the development efficiency of unit test code; but also loads the associated configuration list from the database by combining index key information to realize the automation of unit test, avoid test errors caused by human factors, and improve Test efficiency and accuracy.

Description

technical field [0001] The invention relates to the technical field of software testing, in particular to a unit testing method and device. Background technique [0002] Unit testing is a kind of white-box testing, which aims to detect errors and loopholes in software codes, and ensure the quality of software from the source. It is to conduct coverage tests on each line of code or code block of the software to judge whether it is correct or not. It plays an important role in the software development process and is a very effective means of code quality assurance. In the prior art, the unit test method is mainly combined with some open-source test frameworks (such as Junit, Testng, etc.) to be manually coded by developers, and then a large number of test case codes are manually written to cover the logic of each branch of the code, so as to check the source code. The program code is tested and verified, and the test report is generated by compiling, and then the errors and l...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684G06F11/3688
Inventor 潘福江
Owner 杭州有赞科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products