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

Unit testing code coverage (CC) generation method and device, readable storage medium and equipment

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

Active Publication Date: 2018-02-09
WUHAN DOUYU NETWORK TECH CO LTD
View PDF3 Cites 1 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 testing code coverage (CC) generation method and device, readable storage medium and equipment
  • Unit testing code coverage (CC) generation method and device, readable storage medium and equipment
  • Unit testing code coverage (CC) generation method and 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. Such as 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 ...

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 relates to the field of software testing technology, and particularly to a unit testing code coverage (CC) generation method and device, a readable storage medium and equipment. The method includes: S1, carrying out package dividing processing on reuse testing code blocks in a unit testing process on the basis of service logic; S2, calculating a prediction code coverage data set error on the basis of data of each subpackage obtained after package dividing processing, and using the same as a first error; S3, respectively carrying out code coverage testing on each subpackage obtained after package dividing processing, calculating and obtaining a testing code coverage data set error, and using the same as a second error; S4, judging whether a difference value absolute-value of aroot-mean-square error of the first error and the second error is greater than a preset code coverage standard value, and outputting a prediction code coverage data set if the difference value absolute-value is less than or equal to the preset code coverage standard value, increasing refinement degrees of the service logic in sequence to carry out another time of package dividing processing on each subpackage, which is obtained after package dividing processing, if the difference value absolute-value is greater than the preset code coverage standard value, and executing the S2-S4 in a cycle manner until the difference value absolute-value is less than or equal to the preset code coverage 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 Applications(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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products