Unit testing method and system

A unit test and unit determination technology, applied in the software field, can solve problems such as service interdependence, uncontrollable unit test failure, unit test failure, etc., to achieve the effect of avoiding service interdependence

Active Publication Date: 2020-06-09
JUHAOKAN TECH CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

When unit testing a certain service, if there are problems such as unavailability of the dependent service, the unit test for the service will fail
It can be seen that a large number of services depend on each other, which will lead to uncontrollable unit test failures

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 testing method and system
  • Unit testing method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0027] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application. The technical solutions provided by various embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

[0028] Unit testing is the lowest level of testing activity to be performed during software development, in which an independent unit of software is tested in isolation from the rest of 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 embodiment of the invention discloses a unit test method and system. The method comprises the steps: obtaining a mock main switch state; in response to the fact that the mock main switch state ison, obtaining the mock switch state of each dependent service; determining an output result of the dependent service according to the mock switch state of the dependent service; and determining a unittest result according to the output result of each dependent service. In the embodiment of the invention, the output result of the dependent service is determined through the configured mock main switch state and the mock switch state of each dependent service, so that the test unit can be normally carried out when the dependent service is unavailable or has other problems. An output result obtained by directly calling the dependency service is replaced by local data for the dependency service influencing normal operation of the unit test, so that uncontrollable failure of the unit test caused by mutual dependency of a large number of services is avoided.

Description

technical field [0001] The invention relates to the technical field of software, in particular to a unit testing method and system. Background technique [0002] In a distributed scenario, many interdependent scenarios are involved. When unit testing a certain service, if there are problems such as unavailability of the dependent service, the unit test for the service will fail. It can be seen that a large number of services depend on each other, which will lead to uncontrollable failure of unit tests. [0003] Therefore, it is an urgent problem to be solved by those skilled in the art to avoid uncontrollable failure of unit testing. Contents of the invention [0004] Based on the above technical problems, the purpose of the present invention is to provide a unit testing method and system. [0005] The first aspect of the embodiment of the present application shows a unit testing method, including: [0006] Get the status of the mock master switch; [0007] In respons...

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 Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3672G06F11/3688
Inventor 郭伟王绍民
Owner JUHAOKAN TECH 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