Mock-based unit test method, apparatus and device and readable storage medium

A unit test and storage technology, applied in the computer field, can solve problems such as fusion, difficult effective management and maintenance of test cases, high cost of Mock hard coding, etc., and achieve the effect of reducing coding costs

Inactive Publication Date: 2019-04-12
JINGDONG TECH HLDG CO LTD
View PDF3 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, the existing Mock framework requires a lot of hard coding, and the cost of hard coding is proportional to the complexity of the test case (Test Case). The higher the coverage of unit tests, the higher the cost of Mock hard c

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
  • Mock-based unit test method, apparatus and device and readable storage medium
  • Mock-based unit test method, apparatus and device and readable storage medium
  • Mock-based unit test method, apparatus and device and readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated descriptions will be omitted.

[0035] Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present invention. However, those skilled in the ...

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 invention discloses a Mock-based unit test method, apparatus and device, and a readable storage medium. The method comprises the following steps: when a Mock object is created, searching whether amapping class and a mapping method corresponding to the Mock object exist in at least one pre-configured test case; if the mapping class and the mapping method are found, obtaining the mapping method; and when the Mock object method is called, executing the mapping method, and returning corresponding Mock data. According to the method, test cases can be managed in a centralized manner, and the coding cost is effectively reduced.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a Mock-based unit testing method, device, equipment and a readable storage medium. Background technique [0002] Unit testing refers to the inspection and verification of the smallest measurable unit in software, usually implemented by developers or testers during the development process or after the development is completed. The smallest measurable unit can be a method or function, or a window or menu, etc. [0003] Unit testing usually needs to be done in isolation from the rest of the program. But in the smallest test unit, it may depend on a large number of objects and call the methods of the dependent objects. Most of these dependent objects and their methods are not easy to be manufactured directly, and need to be manufactured virtually. The Mock framework is used to create objects and their methods and data virtually. The objects that are created virtually are called...

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
IPC IPC(8): G06F11/36G06F9/455
CPCG06F9/45558G06F11/3688G06F2009/45575G06F2009/45591
Inventor 杨宽赖韬任弘
Owner JINGDONG TECH HLDG CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products