Unit test coverage generation method, device, readable storage medium and equipment

A test coverage and unit test technology, applied in software testing/debugging, error detection/correction, instruments, etc., can solve problems such as inaccurate coverage and large coverage base

Active Publication Date: 2020-02-07
WUHAN DOUYU NETWORK TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, according to the existing coverage generation method, the reused code blocks will be directly included in the calculation of the coverage, resulting in too large a base of the coverage, resulting in inaccurate calculated coverage, and there is a large error

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 coverage generation method, device, readable storage medium and equipment
  • Unit test coverage generation method, device, readable storage medium and equipment
  • Unit test coverage generation method, device, readable storage medium and equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0052] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0053] The embodiment of the present application provides a method for generating unit test coverage, the method can be applied to the Android system, and the coding language of the method can be Java. like figure 1 As shown, the method includes:

[0054] S1: Based on the business logic, the reuse test code blocks in the unit test process are subcontracted.

[0055] For S1, what S1 executes is the process of sub-packaging and mul...

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 relates to the technical field of software testing, and particularly to a unit testing code coverage (CC) generation method and apparatus, a readable storage medium, and a device. The method comprises: S1, performing, on the basis of service logic, package division processing on reuse testing code blocks in the unit testing process; S2, calculating, on the basis of data of each subpackage obtained by package division processing, a prediction CC data set error as a first error; S3, respectively performing CC testing on each subpackage obtained by package dividing processing, and calculating to obtain a testing CC data set error as a second error; S4, determining whether the absolute difference value between root-mean-square errors of the first error and the second error is greater than a preset CC standard value; if the absolute difference value is smaller than or equal to the preset CC standard value, outputting the prediction CC data set, and if the absolute difference value is greater than the preset CC standard value, increasing the refinement degree of the service logic in sequence and performing package division processing again on each subpackage obtained by package division processing, and performing S2-S4 in a cycle until the absolute difference value is smaller than or equal to the preset CC standard value.

Description

technical field [0001] The invention relates to the technical field of software testing, in particular to a method, device, readable storage medium and equipment for generating unit test coverage. Background technique [0002] In the process of application program development, unit testing is an important and necessary link before the program is formally submitted to testers for large-scale functional testing. Unit testing refers to logical checking and verification of the smallest testable unit in a program, where a unit is the smallest specified functional module to be tested. [0003] In the Android (Android) application development process, unit testing is divided into: Java virtual machine unit testing (JVMTest) and equipment testing (Instrumentation Test). Among them, for JVM Test, it is generally implemented by running a test pile (Test Case) written in pure Java code without relying on other components. Since the code runs on the JVM virtual machine, the test speed ...

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/3676G06F11/3688
Inventor 尹成陈少杰张文明
Owner WUHAN DOUYU NETWORK 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