Unlock instant, AI-driven research and patent intelligence for your innovation.
Method and device for obtaining code coverage rate
What is Al technical title?
Al technical title is built by PatSnap Al team. It summarizes the technical point description of the patent document.
A code coverage and code technology, applied in the field of obtaining code coverage, can solve the problems of unable to obtain manual test code coverage, consuming manpower and material resources, etc.
Active Publication Date: 2014-03-12
TENCENT TECH (SHENZHEN) CO LTD
View PDF3 Cites 20 Cited by
Summary
Abstract
Description
Claims
Application Information
AI Technical Summary
This helps you quickly interpret patents by identifying the three key elements:
Problems solved by technology
Method used
Benefits of technology
Problems solved by technology
[0004] The inventor finds that there are at least the following problems in the prior art: since the functions of the existing Android android platform are mainly guaranteed by manual testing, manual test code coverage cannot be obtained; in addition, due to the need to write a large number of automated test cases when obtaining code coverage, Consume a lot of manpower and material resources
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
Click on the blue label to locate the original text in one second.
Reading with bidirectional positioning of images and text.
Smart Image
Examples
Experimental program
Comparison scheme
Effect test
Embodiment 1
[0046] An embodiment of the present invention provides a method for obtaining code coverage, the execution subject of the method is a terminal, such as an Android device, such as figure 1 As shown, the method includes the following steps:
[0047] Step 101, obtaining the second code after adding the code for obtaining code coverage in the first code of the tested application program (Application, APP), and compiling the first code recorded in the second code process information to generate the first file;
[0048] In this step, the first code refers to the source code of the application program APP.
[0049]Wherein, the information of the first code includes version information of the code, package, class method and information of the line where the code is located. That is to say, the information of the first code includes the version information of the code, the package used, the class method used, and the line where a certain code is located.
[0050] This step includes:...
Embodiment 2
[0082] An embodiment of the present invention provides a method for obtaining code coverage, the method is executed by a terminal, such as an Android device, such as image 3 As shown, the method includes the following steps:
[0083] Step 301, obtaining the second code after adding the code for obtaining code coverage to the first code of the tested application program APP;
[0084] The first code in this step is the source code of the APP. APP is the abbreviation of Application, and APP mostly refers to third-party application programs of smart phones. In the embodiment of the present invention, APP may refer to an application program on an Android device.
[0085] Further, there are two ways to obtain the second code in this step:
[0086] Method 1: Receive the code for obtaining code coverage added in the function called when logging out or exiting in the first code of the APP under test, and obtain the code consisting of the first code and the code for obtaining code c...
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
Login to View More
Abstract
The invention discloses a method and device for obtaining the code coverage rate, and relates to the technical field of communication. The code coverage rate of manual test can be obtained, and consumption of a large number of manpower and material resources is avoided. The method comprises the steps that second codes are obtained after codes with the code coverage rate being obtained are added to first codes of a tested application, and information, recorded in a compiling process of the second codes, of the first codes is used for generating first files; test cases operate after test instructions are received, and code executing information, recorded in an operation process of the test cases, of the first codes is used for generating second files; according to the first files, the second files and code files for obtaining the code coverage rate, the code coverage rate of the first codes is obtained. The method and device for obtaining the code coverage rate are suitable for being adopted when the code coverage rate is obtained by conducting manual test.
Description
technical field [0001] The invention relates to the field of communication technology, in particular to a method and device for acquiring code coverage. Background technique [0002] Code coverage is an important index reflecting the degree of coverage of test cases on the software under test. It is a reference value used to measure the integrity of the test. Its value is equal to the code divided by the total code that the test runs. With code coverage data, it is possible to assess the adequacy of testing. [0003] At present, a test project is established on the basis of the tested application program (Application, APP), wherein EMMA or a similar code coverage statistical tool is added to the test project, and then a large number of automated test cases are written in the test project. After running a large number of test cases written according to the test plan, the current code coverage can be obtained. [0004] The inventor finds that there are at least the following...
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
Application Date:The date an application was filed.
Publication Date:The date a patent or application was officially published.
First Publication Date:The earliest publication date of a patent with the same application number.
Issue Date:Publication date of the patent grant document.
PCT Entry Date:The Entry date of PCT National Phase.
Estimated Expiry Date:The statutory expiry date of a patent right according to the Patent Law, and it is the longest term of protection that the patent right can achieve without the termination of the patent right due to other reasons(Term extension factor has been taken into account ).
Invalid Date:Actual expiry date is based on effective date or publication date of legal transaction data of invalid patent.