Supercharge Your Innovation With Domain-Expert AI Agents!

Java program running code coverage rate test method and system

A technology of code coverage and program operation, applied in the field of Java program operation code coverage test, can solve the problem of not having a better test method Java program operation coverage rate, etc., to achieve the effect of ensuring software quality

Active Publication Date: 2016-09-07
HUIZHOU TCL MOBILE COMM CO LTD
View PDF3 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The method for testing code coverage of the present invention aims to solve the problem that there is no better testing method or tool to count the running coverage of Java programs in the software development process in the prior art

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
  • Java program running code coverage rate test method and system
  • Java program running code coverage rate test method and system
  • Java program running code coverage rate test method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0042] The present invention provides a method and system for testing code coverage of Java program operation. In order to make the purpose, technical solution and effect of the present invention clearer and clearer, the present invention will be further described in detail below. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0043] see figure 1 , a flow chart of a preferred embodiment of the method for testing Java program running code coverage of the present invention. As shown in the figure, the test method of the Java program running code coverage comprises the following steps:

[0044] S1. Preset the code line monitoring item and callback function; obtain the valid code line table in the corresponding function according to the code line monitoring item, and obtain the position of the valid code line in the valid code table; save the position of the valid code line...

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 Java program running code coverage rate test method and system. The method comprises the following steps: S1, presetting a code line monitoring item and a callback functions, obtaining an effective code line table in a corresponding function according to the code line monitoring item, obtaining positions of effective code lines in the effective code line table, storing the positions of the effective code lines in a database, and setting an interruption; S2, when the interruption is triggered in a running process of a program, calling the callback functions, obtaining the current running position of the program, searching a corresponding code line position in the database according to the current running position of the program, updating running frequency of the corresponding code line position, and returning to continue the program running; S3, when the running of the program is finished, counting quantity of all the effective code lines and quantity of all the code lines, the running frequencies of which are greater than 0, in the database, and carrying out calculation to obtain a program running code coverage rate. According to the method and system disclosed in the invention, a relatively good running code coverage rate test manner is provided for the Java program development process.

Description

technical field [0001] The invention relates to the technical field of Java program testing, in particular to a method and system for testing the coverage rate of Java program running codes. Background technique [0002] At present, in the Java program development process, when programmers do Java program self-test or unit test, especially the white box test used in the Java program design and development software process, in order to ensure that the developed test cases can fully test the code For test verification, it is often necessary to analyze which lines of code are not executed, and then write test cases for the unexecuted code, and in the process, the code coverage rate of the program operation is an important basis for evaluating whether the test verification is sufficient. For example, in the development of Android mobile phone software, in order to ensure the quality of the software, engineers are required to fully test and verify the modified code. On the other...

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/36
CPCG06F11/3676
Inventor 邹章锋
Owner HUIZHOU TCL MOBILE COMM CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More