Annotation-based Java language method coverage rate and method input and output statistical method and device

A Java language, input and output technology, applied in the field of annotation-based Java language method coverage and method input and output statistics

Active Publication Date: 2019-06-07
杭州茂财网络技术有限公司
View PDF13 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this method needs to set breakpoints at the source code level and relies on IDE tools, so this solution is only suitable for developers to use for

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
  • Annotation-based Java language method coverage rate and method input and output statistical method and device
  • Annotation-based Java language method coverage rate and method input and output statistical method and device
  • Annotation-based Java language method coverage rate and method input and output statistical method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0034] For clarity, definitions of specific words or phrases used in the present invention are first provided.

[0035] Annotation is a new feature introduced by Java5, which provides a safe annotation-like mechanism for associating any information or metadata (metadata) with program elements (classes, methods, member variables, etc.). Annotations are code-level descriptions at the same level as classes, interfaces, and enumerations. It can be declared in front of packages, classes, fields, methods, local variables, method parameters, etc., to explain and comment on these elements. Add more intuitive and clear descriptions to program elements (classes, methods, member variables). These descriptions are not related to the business logic of the program and are used by specified tools or frameworks. Annotations will not and cannot affect the actual logic of the code, but only play an auxiliary role.

[0036] Method coverage is a measure of the coverage of new or modified method...

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 an annotation-based Java language method coverage rate and method input and output statistical method and device. The method comprises the following steps: S1, adding a compilation annotation to a newly-added or modified method, and counting and recording related information of the annotated method in an application compilation process by the compilation annotation definition during compilation; S2, adding a runtime annotation to a newly-added or modified method, wherein the runtime annotation definition obtains and records related information of the method when the method is called; and S3, compiling and executing the tested software, obtaining the related information in S1 and S2, calculating the coverage rate of the method according to the information recorded in S1 and S2, and counting the input and output of the method. The device is used for executing the method and comprises an annotation adding module, an annotation processor, a software execution module and an information storage module. The coverage rate and input and output of the statistical method are carried out by increasing annotations, the actual logic of codes cannot be affected, dependence on source codes does not exist, and the method is convenient for testers to use in daily tests.

Description

technical field [0001] The invention relates to the field of software testing, in particular to an annotation-based Java language method coverage rate and method input and output statistics method and device. Background technique [0002] In the process of software testing, the R&D personnel hope that the designed test cases can completely cover the modified or newly added methods, and in order to locate the problem, in the key method, the R&D personnel hope to see the input of the method during the execution of the test case. and input content. [0003] In the current software development process, the above requirements are realized through the combination of the code coverage tool and the breakpoint setting function of the IDE. The code coverage tool can only count the coverage of the code "line" level by the test case, and cannot count the coverage of the modified code at the method level, that is, it can only see how many lines of code are covered by the test case, but ...

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/36G06F8/41G06F8/73
Inventor 段建建刘洋
Owner 杭州茂财网络技术有限公司
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