CN113342685A - Precise test method and device, computer equipment and storage medium - Google Patents

Precise test method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113342685A
CN113342685A CN202110732035.4A CN202110732035A CN113342685A CN 113342685 A CN113342685 A CN 113342685A CN 202110732035 A CN202110732035 A CN 202110732035A CN 113342685 A CN113342685 A CN 113342685A
Authority
CN
China
Prior art keywords
test
version code
api
report
target api
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110732035.4A
Other languages
Chinese (zh)
Inventor
赵启航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Asset Management Co Ltd
Original Assignee
Ping An Asset Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Asset Management Co Ltd filed Critical Ping An Asset Management Co Ltd
Priority to CN202110732035.4A priority Critical patent/CN113342685A/en
Publication of CN113342685A publication Critical patent/CN113342685A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The application relates to the technical field of automatic testing, and provides a precise testing method, a device, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining a current iteration version code and a baseline version code, screening a target API according to the current iteration version code and the baseline version code, finding a test case associated with the target API, creating an automatic test task, executing the test case, generating a test case execution record, obtaining target API call data, generating a test statistic report according to the test case execution record and the target API call data, returning to the step of obtaining the current iteration version code and the baseline version code if the test statistic report judges that a preset accurate test termination condition is not met, and till the preset accurate test termination condition is met, wherein the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report. The method can improve the testing efficiency to a great extent.

Description

Precise test method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of automated testing technologies, and in particular, to an accurate testing method and apparatus, a computer device, and a storage medium.
Background
The accurate test is a set of computer test auxiliary analysis system. The core component of the accurate test comprises a software test oscilloscope, bidirectional tracing of cases and codes, selection of intelligent regression test cases, coverage rate analysis, defect positioning, cluster analysis of test cases and an automatic test case generation system, and the functions of the software test oscilloscope, the cases and the codes form an accurate test technical system.
The traditional precise test is a passive white-box coverage rate statistical tool based on codes from the technical point of view. Most functional testers have weak codes and effective understanding ability on the codes, and can not effectively associate uncovered codes with test scenes, so that statistical analysis on code coverage rates such as class coverage, method coverage and branch coverage provided by a traditional accurate test report can not help the functional testers to perform more efficient and accurate tests.
With the continuous increase of the system scale, the business logic becomes more complex, the iteration speed is faster and faster, and under the condition that the time is more and more valuable, a tester cannot perform full regression in a limited time. Therefore, how to improve the efficiency of the testing work and perform more accurate regression with limited time becomes more urgent and important.
Disclosure of Invention
In view of the above, it is necessary to provide a precise testing method, device, computer equipment and storage medium capable of improving testing efficiency.
A method of precision testing, the method comprising:
acquiring a current iteration version code and a baseline version code;
screening out a target API (Application Programming Interface) according to the current iteration version code and the baseline version code;
finding out a test case associated with the target API;
creating an automatic test task, executing a test case, and generating a test case execution record;
acquiring target API call data, and generating a test statistic report according to the test case execution record and the target API call data;
if the preset accurate test termination condition is not reached according to the test statistical report, returning to the step of obtaining the current iteration version code and the baseline version code until the preset accurate test termination condition is reached;
the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
In one embodiment, screening out the target API based on the current iteration version code and the baseline version code comprises:
comparing the current iteration version code with the baseline version code to obtain a difference file;
and analyzing the difference file and screening out the target API.
In one embodiment, analyzing the difference file and screening out the target API includes:
acquiring reference data in the difference file;
screening out an initial API according to the reference relation of the reference data;
determining the type of the initial API according to the file type of the difference file;
and screening out a target API corresponding to the preset type according to the type of the initial API.
In one embodiment, screening out the initial API according to the reference relationship of the reference data comprises:
tracing to obtain a changed API according to the reference relation of the reference data;
determining the recommendation degree of the changed API according to the reference relation and a preset calling link;
the initial API is screened from the changed APIs according to the recommendation level.
In one embodiment, obtaining the target API call data comprises:
and acquiring target API call data according to a preset mode, wherein the preset mode comprises at least one mode of log data, event tracking and link monitoring.
In one embodiment, the test cases associated with the target API include: an Interface automation test case associated with the target API and a UI (User Interface) automation test case.
In one embodiment, obtaining the current iteration version code and the baseline version code comprises:
acquiring warehouse addresses of a current iteration version code and a baseline version code;
and acquiring the current iteration version code and the baseline version code according to the warehouse address.
A precision testing apparatus, the apparatus comprising:
the code acquisition module is used for acquiring a current iteration version code and a baseline version code;
the interface screening module is used for screening out a target API according to the current iteration version code and the baseline version code;
the test case searching module is used for searching the test case associated with the target API;
the test module is used for creating an automatic test task, executing a test case and generating a test case execution record;
the test statistic report generation module is used for acquiring target API call data and generating a test statistic report according to the test case execution record and the target API call data;
the task monitoring module is used for awakening the code acquisition module to execute the operation of acquiring the current iteration version code and the baseline version code if the condition that the preset accurate test termination condition is not met is judged according to the test statistic report; the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a current iteration version code and a baseline version code;
screening out a target API according to the current iteration version code and the baseline version code;
finding out a test case associated with the target API;
creating an automatic test task, executing a test case, and generating a test case execution record;
acquiring target API call data, and generating a test statistic report according to the test case execution record and the target API call data;
if the preset accurate test termination condition is not reached according to the test statistical report, returning to the step of obtaining the current iteration version code and the baseline version code until the preset accurate test termination condition is reached;
the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a current iteration version code and a baseline version code;
screening out a target API according to the current iteration version code and the baseline version code;
finding out a test case associated with the target API;
creating an automatic test task, executing a test case, and generating a test case execution record;
acquiring target API call data, and generating a test statistic report according to the test case execution record and the target API call data;
if the preset accurate test termination condition is not reached according to the test statistical report, returning to the step of obtaining the current iteration version code and the baseline version code until the preset accurate test termination condition is reached;
the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
The accurate test method, the device, the computer equipment and the storage medium abandon the traditional method for calculating the code coverage rate, directly start from the service function angle, replace the code coverage rate by the interface coverage rate, do not need testers to analyze changed codes, associate uncovered codes with a test scene, judge whether the test scene has omission, directly find out the test case associated with the changed API through the association relation of the API and the test case, avoid the omission of the test scene, comprehensively and intuitively reflect the completion degree of the accurate test from three dimensions of the interface coverage rate, the case coverage rate and the case execution success rate by generating a test statistic report comprising an interface coverage rate report, a case coverage rate report and a case execution success rate report, so as to ensure the total regression, and the scheme searches the test case, and intuitively reflects the completion degree of the accurate test from the three dimensions of the interface coverage rate, the case coverage rate and the case execution success rate, And a closed loop is formed from the execution of the test case to the generation of the statistical report, so that a test scene is ensured to be omitted. In conclusion, the method can improve the testing efficiency to a great extent.
Drawings
FIG. 1 is a diagram of an exemplary application environment for a precision test method;
FIG. 2 is a schematic flow chart of a precise test method according to an embodiment;
FIG. 3 is a schematic flow chart of a precision test method according to another embodiment;
FIG. 4 is a flowchart illustrating the step of screening the target API in one embodiment;
FIG. 5 is a block diagram of a precision testing apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The accurate test method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The method includes that a tester sends a test instruction to a server 104 from a terminal 102, the server 104 responds to the test instruction to obtain a current iteration version code and a baseline version code, a target API is screened out according to the current iteration version code and the baseline version code, a test case associated with the target API is found out, an automatic test task is created, the test case is executed, a test case execution record is generated, target API call data are obtained, a test statistic report is generated according to the test case execution record and the target API call data, and if the test statistic report judges that a preset accurate test termination condition is not met, the step of obtaining the current iteration version code and the baseline version code is returned until the preset accurate test termination condition is met; the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a precision testing method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
at step 202, a current iteration version code and a baseline version code are obtained.
In practical application, the code is stored in a code repository (such as a professional code version management platform like git, SVN and the like). The method comprises the steps that a tester inputs a warehouse address of a current iteration version code and an online running version code, sends a test instruction to a server at a terminal, responds to the test instruction, judges whether a code warehouse exists locally or not according to the warehouse address, if so, the code is updated, and if not, the code is downloaded. Wherein the baseline version code is code that runs on the wire.
And step 204, screening out a target API according to the current iteration version code and the baseline version code.
The target API can be screened out by comparing the difference between the current iteration version code and the baseline version code and analyzing the difference data between the current iteration version code and the baseline version code. In practical applications, the reference relationship between classes and methods is complicated, and the number of affected APIs is large, but not all affected APIs are interfaces that need to be tested. Therefore, it is necessary to screen APIs to filter out insignificant APIs. In this embodiment, the target API is an API whose reference relationship satisfies a preset number of reference layers, and
step 206, find out the test case associated with the target API.
In practical application, the API and the test case have an association relationship, and after the API is found out, the test case associated with the API can be correspondingly found out. The test cases may include interface test cases and functional test cases.
And step 208, creating an automatic test task, executing the test case, and generating a test case execution record.
During specific implementation, an automatic test task is created, the execution of the test cases can be the creation of the automatic test task, then, the creation of the automatic test task is started, the test cases are executed, and after the execution of each test case is finished, a corresponding test case execution record including execution time, test case numbers, execution results and the like can be generated.
And 210, acquiring target API call data, and generating a test statistic report according to the test case execution record and the target API call data, wherein the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
The target API call data refers to a target API list or list that is called during test case execution. In this embodiment, the test statistic report includes an interface coverage report, a use case coverage report, and a use case execution success rate report. Specifically, the API interface coverage rate statistical report includes a function menu, a type, a priority, an API name, an API change type, API strength recommendation, whether a test is covered, whether a test is error-reported, and an interface coverage rate. And the interface coverage rate finds out all affected target API interfaces and the collected called API interface data according to the diff two version code branches, and the interface coverage rate is calculated. Similarly, the case coverage rate is obtained based on the number of executed test cases and the number of searched test cases to be executed. The case execution success rate is obtained based on the number of successfully executed test cases and the number of searched test cases to be executed. In the embodiment, whether the test of the interface is omitted or not can be comprehensively and intuitively reflected by generating the use case coverage rate report and the interface coverage rate report.
In another embodiment, the test statistics reports further include use case coverage reports and use case execution success rate reports. The case coverage rate report comprises the coverage rate of the test case, and the case execution success rate report comprises the execution success rate of the test case. The coverage rate of the test cases is calculated according to the number of the executed test cases and all the associated test cases. By generating the case coverage rate report and the case execution success rate report, the execution condition of the test case and whether the test scene has omission or not can be intuitively reflected.
And 212, judging whether the accurate test termination condition is met according to the test statistic report, and if the accurate test termination condition is not met according to the test statistic report, returning to the step of obtaining the current iteration version code and the baseline version code until the accurate test termination condition is met.
In this embodiment, the accurate test termination condition may be determined based on the interface coverage, the case coverage, and the case execution success rate, that is, whether the interface coverage, the case coverage, and the case execution success rate reach 100% or not is respectively determined, and if all the cases reach 100%, it is indicated that all test scenarios are not missed, the full regression is completed, and the accurate test termination condition is reached; if at least one item does not reach 100%, it indicates that the test scene has omission, at this time, the test is required to return to S1, and the test is continued until the interface coverage rate, the case coverage rate and the case execution success rate all reach 100%, at this time, it is considered that the accurate test termination condition is reached.
In the above-mentioned accurate testing method, the traditional method of calculating code coverage is abandoned, the code coverage is replaced by the interface coverage directly from the perspective of service function, the testing personnel is not required to analyze the changed codes, the uncovered codes are associated with the testing scene, whether the testing scene has omission is judged, but the testing case associated with the changed API is directly found out through the association relationship between the API and the testing case, the omission of the testing scene is avoided, and the completion degree of the accurate test is comprehensively and intuitively reflected from the three dimensions of the interface coverage, the case coverage and the case execution success rate by generating the testing statistical report comprising the interface coverage report, the case coverage report and the case execution success rate report, so as to ensure the full regression, and the scheme forms a closed loop from the searching of the testing case, the execution of the testing case to the generation of the statistical report, and the test scene can be ensured to be omitted. In conclusion, the method can improve the testing efficiency to a great extent.
As shown in FIG. 3, in one embodiment, screening out the target API based on the current iteration version code and the baseline version code comprises: and 224, comparing the current iteration version code with the baseline version code to obtain a difference file, analyzing the difference file, and screening out the target API.
Specifically, the difference file may be obtained by Diff of the codes of the two versions, listing the difference between the codes of the two versions, analyzing the variation lines in the difference file of the two versions, and finding out the file with the source branch and the file without the target branch; files with target branches and without source branches; both source and target branches have files that have been modified. And screening out the target API by analyzing the difference file. In this embodiment, by analyzing the difference file, the changed API can be automatically found out without the need for a tester to find out the changed API.
As shown in FIG. 4, in one embodiment, analyzing the difference file to screen out the target API includes:
step 220, acquiring the reference data in the difference file;
step 221, screening out an initial API according to the reference relation of the reference data;
step 222, determining the type of the initial API according to the file type of the difference file;
and 223, screening out a target API corresponding to the preset type according to the type of the initial API.
Reference data includes classes, methods, or variables, etc. The types of the difference files comprise file modification types and file attribute types, the file modification types comprise addition, modification and deletion, and the file attribute types comprise configuration types, public types and common types. In specific implementation, the method of the modified file or the newly added and deleted file is found, all files are scanned globally, codes are layered, the class, method or variable referenced by each file is analyzed, the class, method or variable referenced by the file is found, then a corresponding API is found according to a call link Controller layer of a spring frame → a Service layer → a Dao layer → a database, an initial API is obtained, the found API is divided into newly added, modified and deleted according to the file modification type, and the API is divided into a configuration class, a public class and a common class according to the file corresponding to the attribute. And then, screening out the APIs of the public class and the common class to obtain the target API. In the embodiment, the target API is screened according to the file type, so that the API can be simplified, the target PAPI can be screened in a targeted manner, and the subsequent processing time is shortened.
In one embodiment, screening out the initial API according to the reference relationship of the reference data comprises: and tracing to obtain the changed API according to the reference relation of the reference data, determining the recommendation degree of the changed API according to the reference relation and a preset calling link, and screening out the initial API from the changed API according to the recommendation degree.
After tracing to the changed API according to the reference relationship, the recommendation degree of the API can be determined according to the reference relationship. Specifically, the interface recommendation degree associated with the file referenced outside the call link may be set as a weak recommendation, and conversely, the interface recommendation degree may be set as a strong recommendation. The interface recommendation degree of the file association with the reference relationship between the 3 layers and the 3 layers may be defined as a strong recommendation, and the interface recommendation degree of the file association with the reference relationship between the 3 layers or more (excluding the 3 layers) may be defined as a weak recommendation. Further, for a strongly recommended API, the interface coverage rate may be required to reach 100%, and if the recommended API is not required, the interface coverage rate may be required to reach 100%. In this embodiment, by determining the recommendation degree of the API, an interface that needs to be fully covered can be determined in a targeted manner.
In one embodiment, obtaining the target API call data comprises: and acquiring target API call data according to a preset mode, wherein the preset mode comprises at least one mode of log data, event tracking and link monitoring.
Event trace data may also be referred to as a buried point. In a specific implementation, collecting the target API call data according to the log data may find the called interface according to a request address of an interface in the log. The collection of the target API call data according to the buried point can be to find a called interface according to data recorded in a database by clicking elements on a page by a user. Collecting target API call data based on link monitoring (e.g., pinpoint) may be collecting interface information to be called in conjunction with an open source tool, pinpoint. In the embodiment, the API interface data is acquired through three aspects of log, buried point or link monitoring, the API interface calling data can be counted in all directions, and the accuracy of the interface coverage rate is improved.
In one embodiment, the test cases associated with the target API include: an interface automation test case and a UI automation test case associated with the target API.
In practical application, the API interface has an association relationship with the function menu card and the interface test case, and the UI automation test case associated with the menu card can be associated from the UI automation use case library directly according to the relationship between the API interface and the menu card; and simultaneously, correlating the interface automation test cases correlated with the API interface from the API interface automation case library.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in each flowchart related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 5, a precision testing apparatus is provided, including: the system comprises a code acquisition module 510, an interface screening module 520, a test case searching module 530, a testing module 540, a test statistic report generating module 550 and a task monitoring module 560, wherein:
a code obtaining module 510 for obtaining the current iteration version code and the baseline version code.
And an interface screening module 520, configured to screen out the target API according to the current iteration version code and the baseline version code.
And the test case searching module 530 is used for searching the test case associated with the target API.
The test module 540 is configured to create an automated test task, execute a test case, and generate a test case execution record.
And a test statistic report generating module 550, configured to obtain the target API call data, and generate a test statistic report according to the test case execution record and the target API call data.
The task monitoring module 560 is configured to wake up the code obtaining module to execute the operation of obtaining the current iteration version code and the baseline version code if it is determined according to the test statistics report that the preset accurate test termination condition is not met; the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
The accurate test device abandons the traditional method for calculating the code coverage rate, directly starts from the service function angle, replaces the code coverage rate with the interface coverage rate, does not need a tester to analyze the changed codes, associates the uncovered codes with the test scene, judges whether the test scene has omission or not, directly searches the test case associated with the changed API through the association relationship of the API and the test case, avoids the omission of the test scene, comprehensively and intuitively reflects the completion degree of the accurate test from the three dimensions of the interface coverage rate, the case coverage rate and the case execution success rate by generating the test statistic report comprising the interface coverage rate report, the case coverage rate report and the case execution success rate report so as to ensure the full regression, and the scheme forms a closed loop from the searching of the test case, the execution of the test case to the generation of the statistic report, and the test scene can be ensured to be omitted. In conclusion, the method can improve the testing efficiency to a great extent.
In one embodiment, the interface filtering module 520 is further configured to compare the current iteration version code with the baseline version code to obtain a difference file, analyze the difference file, and filter out the target API.
In an embodiment, the interface screening module 520 is further configured to obtain reference data in the difference file, screen out the initial API according to a reference relationship of the reference data, determine a type of the initial API according to a file type of the difference file, and screen out a target API corresponding to the preset type according to the type of the initial API.
In one embodiment, the interface filtering module 520 is further configured to obtain a changed API according to a reference relationship of the reference data, determine a recommendation degree of the changed API according to the reference relationship and a preset call link, and filter out an initial API from the changed API according to the recommendation degree.
In an embodiment, the test statistic report generating module 550 is further configured to obtain the target API call data according to a preset manner, where the preset manner includes at least one of log data, event tracking, and link monitoring.
In one embodiment, the code obtaining module 510 is further configured to obtain warehouse addresses of the current iteration version code and the baseline version code, and obtain the current iteration version code and the baseline version code according to the warehouse addresses.
For specific embodiments of the precision testing apparatus, reference may be made to the above embodiments of the precision testing method, and details are not repeated here. The modules in the above-mentioned precision testing device can be wholly or partially implemented by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing code data, test cases and other data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a precision testing method.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: the method comprises the steps of obtaining a current iteration version code and a baseline version code, screening a target API according to the current iteration version code and the baseline version code, finding a test case associated with the target API, creating an automatic test task, executing the test case, generating a test case execution record, obtaining target API call data, generating a test statistic report according to the test case execution record and the target API call data, returning to the step of obtaining the current iteration version code and the baseline version code if the test statistic report judges that a preset accurate test termination condition is not met, and till the preset accurate test termination condition is met, wherein the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and comparing the current iteration version code with the baseline version code to obtain a difference file, analyzing the difference file, and screening out the target API.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring reference data in the difference file, screening out an initial API according to the reference relation of the reference data, determining the type of the initial API according to the file type of the difference file, and screening out a target API corresponding to a preset type according to the type of the initial API.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and tracing to obtain the changed API according to the reference relation of the reference data, determining the recommendation degree of the changed API according to the reference relation and a preset calling link, and screening out the initial API from the changed API according to the recommendation degree.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and acquiring target API call data according to a preset mode, wherein the preset mode comprises at least one mode of log data, event tracking and link monitoring.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and acquiring warehouse addresses of the current iteration version code and the baseline version code, and acquiring the current iteration version code and the baseline version code according to the warehouse addresses.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: the method comprises the steps of obtaining a current iteration version code and a baseline version code, screening a target API according to the current iteration version code and the baseline version code, finding a test case associated with the target API, creating an automatic test task, executing the test case, generating a test case execution record, obtaining target API call data, generating a test statistic report according to the test case execution record and the target API call data, returning to the step of obtaining the current iteration version code and the baseline version code if the test statistic report judges that a preset accurate test termination condition is not met, and till the preset accurate test termination condition is met, wherein the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
In one embodiment, the computer program when executed by the processor further performs the steps of: and comparing the current iteration version code with the baseline version code to obtain a difference file, analyzing the difference file, and screening out the target API.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring reference data in the difference file, screening out an initial API according to the reference relation of the reference data, determining the type of the initial API according to the file type of the difference file, and screening out a target API corresponding to a preset type according to the type of the initial API.
In one embodiment, the computer program when executed by the processor further performs the steps of: and tracing to obtain the changed API according to the reference relation of the reference data, determining the recommendation degree of the changed API according to the reference relation and a preset calling link, and screening out the initial API from the changed API according to the recommendation degree.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring target API call data according to a preset mode, wherein the preset mode comprises at least one mode of log data, event tracking and link monitoring.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring warehouse addresses of the current iteration version code and the baseline version code, and acquiring the current iteration version code and the baseline version code according to the warehouse addresses.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of precision testing, the method comprising:
acquiring a current iteration version code and a baseline version code;
screening out a target API according to the current iteration version code and the baseline version code;
finding out a test case associated with the target API;
executing the test case to generate a test case execution record;
acquiring target API call data, and generating a test statistic report according to the test case execution record and the target API call data;
if the test statistic report judges that the preset accurate test termination condition is not met, returning to the step of acquiring the current iteration version code and the baseline version code until the preset accurate test termination condition is met;
the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
2. The method of claim 1, wherein the screening out target APIs based on the current iteration version code and the baseline version code comprises:
comparing the current iteration version code with the baseline version code to obtain a difference file;
and analyzing the difference file and screening out a target API.
3. The method of claim 2, wherein the analyzing the difference file to screen out a target API comprises:
acquiring reference data in the difference file;
screening out an initial API according to the reference relation of the reference data;
determining the type of the initial API according to the file type of the difference file;
and screening out a target API corresponding to a preset type according to the type of the initial API.
4. The accurate testing method according to claim 3, wherein the screening out the initial API according to the reference relationship of the reference data comprises:
obtaining a changed API according to the reference relation traceability of the reference data;
determining the recommendation degree of the changed API according to the reference relation and a preset calling link;
and screening out the initial API from the changed API according to the recommendation degree.
5. The precision test method of any of claims 1 to 4, wherein the obtaining target API call data comprises:
and acquiring target API call data according to a preset mode, wherein the preset mode comprises at least one mode of log data, event tracking and link monitoring.
6. The accurate testing method according to any one of claims 1 to 4, wherein the target API-associated test case comprises: and the interface automation test case and the UI automation test case are associated with the target API.
7. The method of any of claims 1 to 4, wherein the obtaining the current iteration version code and the baseline version code comprises:
acquiring warehouse addresses of a current iteration version code and a baseline version code;
and acquiring a current iteration version code and a baseline version code according to the warehouse address.
8. An accurate testing device, the device comprising:
the code acquisition module is used for acquiring a current iteration version code and a baseline version code;
the interface screening module is used for screening out a target API according to the current iteration version code and the baseline version code;
the test case searching module is used for searching the test case associated with the target API;
the test module is used for creating an automatic test task, executing the test case and generating a test case execution record;
the test statistic report generation module is used for acquiring target API call data and generating a test statistic report according to the test case execution record and the target API call data;
and the task monitoring module is used for awakening the code acquisition module to execute the operation of acquiring the current iteration version code and the baseline version code until the preset accurate test termination condition is reached if the test statistic report judges that the preset accurate test termination condition is not reached, wherein the test statistic report comprises an interface coverage rate report, a case coverage rate report and a case execution success rate report.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110732035.4A 2021-06-29 2021-06-29 Precise test method and device, computer equipment and storage medium Pending CN113342685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110732035.4A CN113342685A (en) 2021-06-29 2021-06-29 Precise test method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110732035.4A CN113342685A (en) 2021-06-29 2021-06-29 Precise test method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113342685A true CN113342685A (en) 2021-09-03

Family

ID=77481784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110732035.4A Pending CN113342685A (en) 2021-06-29 2021-06-29 Precise test method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113342685A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722234A (en) * 2021-09-14 2021-11-30 京东科技控股股份有限公司 Test case screening method and device, electronic equipment and storage medium
CN113900962A (en) * 2021-12-10 2022-01-07 广州易方信息科技股份有限公司 Code difference detection method and device
CN113946515A (en) * 2021-10-19 2022-01-18 平安普惠企业管理有限公司 Code coverage rate testing method and device, computer equipment and storage medium
CN114676068A (en) * 2022-05-30 2022-06-28 云账户技术(天津)有限公司 Code coverage rate statistical method, system, network equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240911A (en) * 2018-08-13 2019-01-18 腾讯科技(北京)有限公司 Accurate test method, device and computer equipment
US20190278700A1 (en) * 2018-03-07 2019-09-12 Jpmorgan Chase Bank, N.A. System and method for automated service layer testing and regression
CN110389896A (en) * 2019-06-18 2019-10-29 中国平安人寿保险股份有限公司 Code automated analysis and test method, device and computer readable storage medium
CN111258876A (en) * 2018-11-30 2020-06-09 中国移动通信集团浙江有限公司 Accurate regression testing method and device under micro-service architecture
CN111831564A (en) * 2020-07-09 2020-10-27 北京齐尔布莱特科技有限公司 Regression testing method and device and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190278700A1 (en) * 2018-03-07 2019-09-12 Jpmorgan Chase Bank, N.A. System and method for automated service layer testing and regression
CN109240911A (en) * 2018-08-13 2019-01-18 腾讯科技(北京)有限公司 Accurate test method, device and computer equipment
CN111258876A (en) * 2018-11-30 2020-06-09 中国移动通信集团浙江有限公司 Accurate regression testing method and device under micro-service architecture
CN110389896A (en) * 2019-06-18 2019-10-29 中国平安人寿保险股份有限公司 Code automated analysis and test method, device and computer readable storage medium
CN111831564A (en) * 2020-07-09 2020-10-27 北京齐尔布莱特科技有限公司 Regression testing method and device and computing equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722234A (en) * 2021-09-14 2021-11-30 京东科技控股股份有限公司 Test case screening method and device, electronic equipment and storage medium
CN113946515A (en) * 2021-10-19 2022-01-18 平安普惠企业管理有限公司 Code coverage rate testing method and device, computer equipment and storage medium
CN113900962A (en) * 2021-12-10 2022-01-07 广州易方信息科技股份有限公司 Code difference detection method and device
CN114676068A (en) * 2022-05-30 2022-06-28 云账户技术(天津)有限公司 Code coverage rate statistical method, system, network equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
CN113342685A (en) Precise test method and device, computer equipment and storage medium
CN108427613B (en) Abnormal interface positioning method and device, computer equipment and storage medium
US8151248B1 (en) Method and system for software defect management
CN110287101A (en) User interface automated testing method, device, computer equipment and storage medium
US11112993B2 (en) Methods and systems for memory suspect detection
CN111026647B (en) Method and device for acquiring code coverage rate, computer equipment and storage medium
CN111522728A (en) Method for generating automatic test case, electronic device and readable storage medium
CN111897727A (en) Software testing method and device, computer equipment and storage medium
CN111190827A (en) Interface automation test method and device, storage medium and electronic equipment
CN105183658A (en) Software code testing method and device
CN113688288A (en) Data association analysis method and device, computer equipment and storage medium
KR101830936B1 (en) Performance Improving System Based Web for Database and Application
CN108399125A (en) Automated testing method, device, computer equipment and storage medium
CN113391998A (en) Regression testing method, device, electronic equipment and storage medium
CN111459796B (en) Automated testing method, apparatus, computer device and storage medium
CN105912467B (en) Performance test method and device
CN114328168A (en) Anomaly detection method and device, computer equipment and storage medium
CN112835779A (en) Test case determination method and device and computer equipment
CN111444093B (en) Method and device for determining quality of project development process and computer equipment
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN107102938B (en) Test script updating method and device
CN112612882B (en) Review report generation method, device, equipment and storage medium
CN116340187B (en) Rule engine migration test method and device, electronic equipment and storage medium
CN117742897B (en) Method for realizing automatic repair of vulnerability based on container mirror image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination