Annotation-based Java language method coverage and method input and output statistics

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: 2022-04-15
杭州茂财网络技术有限公司
View PDF13 Cites 0 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 code debugging, and many testers cannot use this solution during the execution of use cases to count the coverage of the method and method input and output

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0034] For the sake of clarity, the definition of specific words or phrases used in the present invention will be described.

[0035] Note is a new feature that Java5 began to introduce, which provides a safe similar notes to associate any information or metadata (Metadata) with program elements (clauses, methods, members variables, etc.). The annotation is an explanation of a code level, with a class, interface, and an enumeration are at the same level. It can be declared in front of the package, classes, fields, methods, local variables, method parameters, and the like to explain these elements, annotations. To add more intuitive descriptions for the element (class, method, member variable) of the program, these instructions are unrelated to the business logic of the program and are used for the specified tool or framework. The annotation will not affect the actual logic of the code, only the role of assistance.

[0036] Method coverage is a metric of the absence of a new or mod...

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 statistics method and device. The method includes the following steps: S1, adding a compile-time annotation to the newly added or modified method, and the compile-time annotation definition counts and records the relevant information of the annotated method during the application compilation process; S2, adds or modifies the method Add a runtime annotation to the method, and the runtime annotation definition obtains and records the relevant information of the method when the method is called; S3, compiles the tested software and executes it, obtains the relevant information described in S1 and S2, according to the information recorded in S1 and S2 The information calculates the method coverage and counts the input and output of the method. The device is used to execute the above method, and includes an annotation adding module, an annotation processor, a software execution module and an information storage module. In the present invention, the coverage rate and input and output of the statistical method are added by adding annotations, which will not affect the actual logic of the code, have no dependence on the source code, and are convenient for testers to use in daily testing.

Description

Technical field [0001] The present invention relates to the field of software tests, and more particularly to an annotated java language method coverage and method input and output statistical methods and apparatus. Background technique [0002] During the software test, the research example of the R & D person hopes that the test case designed can completely cover the modification or new method, and for the need for positioning problems, the R & D person wants to see the process of test case execution, the input And output content. [0003] During the current software research and development, the above-mentioned needs are combined through the code coverage tool and the breakpoint setting function of the IDE. The code coverage tool can only count the inspection case of the code "line" level, which cannot be covered by the method level statistics, which is only how many lines of code covered by the use case, but do not count these code corresponding The method, it is more unable ...

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/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