Coverage rate acquisition method and device for Java program test
The invention relates to the technical field of program testing, and particularly discloses a coverage rate collection method and device for Java program testing, and the method comprises the steps: obtaining source code data of a target application; compiling the source code data of the target appl...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention relates to the technical field of program testing, and particularly discloses a coverage rate collection method and device for Java program testing, and the method comprises the steps: obtaining source code data of a target application; compiling the source code data of the target application to obtain byte code data of the target application; aiming at a target class in the byte code data of the target application, generating a corresponding brother class; the brother class comprises an auxiliary method for collecting the coverage rate; the operation of accessing and assigning the auxiliary method in the brother class is embedded in the target class; and collecting the coverage rate of the target application by using an auxiliary method, wherein the coverage rate refers to the ratio data of the operated code and the to-be-operated code. By means of the scheme, collection of the coverage rate of the target class is guaranteed, meanwhile, fields or methods are not injected into the target class, |
---|