CN114328195A - Method for rapidly counting interface defect rate and estimating development quality - Google Patents
Method for rapidly counting interface defect rate and estimating development quality Download PDFInfo
- Publication number
- CN114328195A CN114328195A CN202111538629.8A CN202111538629A CN114328195A CN 114328195 A CN114328195 A CN 114328195A CN 202111538629 A CN202111538629 A CN 202111538629A CN 114328195 A CN114328195 A CN 114328195A
- Authority
- CN
- China
- Prior art keywords
- interface
- execution
- defect rate
- development quality
- localstorage
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method for rapidly counting interface defect rate and estimating development quality. According to the invention, the execution failure times and the total execution times of each interface are obtained through the response interceptor, the defect rate is calculated, and the obtained data is stored in the localstorage, so that the defect rates of all the interfaces under a large amount of execution can be conveniently obtained during system lifting, the development quality of each interface is obtained, the development quality evaluation requirement in the software development process is met, and the authenticity of the development quality evaluation is improved.
Description
Technical Field
The invention relates to the technical field of software system development, in particular to a method for rapidly counting interface defect rate and estimating development quality.
Background
In software development, a set of business system often calls a plurality of background interfaces, and how to objectively calculate the interface defect rate (i.e. the number of execution failures/the total number of execution times of the interface) according to the interface execution condition, so as to evaluate the development quality. At present, no specific method is provided, and the defect rates of all interfaces of a set of service system can be counted. And estimating the interface development quality according to the defect rate. When the front-end joint debugging interface is used, the response condition of a single interface is checked through the console, and whether the current execution is normal or not is obtained. Currently, only a single execution condition of an interface can be acquired through a browser console, and the passing rate of the interface under a large number of executions cannot be counted. In this case, the defect rate of the interface cannot be objectively reflected, and it cannot be estimated whether the development quality of the interface is high or low.
Accordingly, the prior art is deficient and needs improvement.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a method for rapidly counting the interface defect rate and estimating the development quality.
The technical scheme of the invention is as follows: the method for rapidly counting the interface defect rate and estimating the development quality comprises the following steps:
step 1: packaging a response interceptor in front-end engineering so that all interface responses can pass through the response interceptor;
step 2: defining a data storage mechanism, wherein data is stored in a local storage localstorage of a browser, key is an interface url address, and value is a json object containing the execution failure times, the total execution times and the defect rate of the interface;
and step 3: acquiring an interface url address and a response message of a current request from a response interceptor, and acquiring historical execution information of the interface url from a localstorage;
and 4, step 4: updating the latest data of the failure times, the total times and the defect rate into a localstorage according to the information acquired in the step 3;
and 5: carrying out extraction and test on the system to obtain the execution conditions of all interfaces;
step 6: and (5) carrying out permutation analysis on the data obtained in the step (5) to obtain the development quality of each interface.
Further, the specific steps of step 4 are:
step 4.1: if the response message is abnormal information, adding 1 to the execution failure times; if the response message is normal information, the execution failure times do not need to be added with 1;
step 4.2: adding 1 to the total number of execution times of the interface;
step 4.3: calculating the ratio of the latest execution failure times to the total execution times to obtain the defect rate of the modified interface;
step 4.4: and updating the latest execution failure times, the latest execution total times and the latest defect rate data into the localstorage.
Further, the specific steps of step 5 are:
step 5.1: the tester automatically triggers an interface request by verifying the page function;
step 5.2: automatically recording the execution condition of the interface in a localstorage of the browser;
step 5.3: and sequentially acquiring the execution conditions of all the interfaces, and finally acquiring the execution conditions of all the interfaces of the whole system.
By adopting the scheme, the execution failure times and the total execution times of each interface are obtained through the response interceptor, the defect rate is calculated, and the obtained data is stored in the localstorage, so that the defect rates of all the interfaces under a large amount of execution can be conveniently obtained during system extraction, the development quality of each interface is obtained, the development quality evaluation requirement in the software development process is met, and the authenticity of development quality evaluation is improved.
Detailed Description
The present invention will be described in detail with reference to specific examples.
The invention provides a method for rapidly counting interface defect rate and estimating development quality, which comprises the following steps:
step 1: the response interceptor is encapsulated in the front-end engineering so that all interface responses will pass through the response interceptor. In some embodiments, in the VUE project, the vue.http.interpenetrates function is defined in the main.js entry file.
Step 2: defining a data storage mechanism, wherein data is stored in a local storage localstorage of a browser, key is an interface url address, and value is a json object containing the number of execution failures (failNum), the total number of execution times (totalNum) and the defect rate (bugRate) of the interface.
And step 3: and acquiring the interface url address and the response message of the current request in the response interceptor, and acquiring the historical execution information of the interface url from the localstorage.
And 4, step 4: and updating the latest data of the failure times, the total times and the defect rate into the localstorage according to the information acquired in the step 3. The method comprises the following specific steps:
step 4.1: if the response message is abnormal information, adding 1 to the execution failure times; if the response message is normal information, the number of execution failures does not need to be increased by 1.
Step 4.2: add 1 to the total number of executions of the interface.
Step 4.3: and calculating the ratio of the latest failure times to the total times of execution to obtain the defect rate of the modified interface.
Step 4.4: and updating the latest execution failure times, the latest execution total times and the latest defect rate data into the localstorage.
And 5: the system is tested to obtain the execution conditions of all the interfaces. The method comprises the following specific steps:
step 5.1: the tester automatically triggers the interface request by verifying the page function.
Step 5.2: the execution of the interface is automatically recorded in the localstorage of the browser.
Step 5.3: and sequentially acquiring the execution conditions of all the interfaces, and finally acquiring the execution conditions of all the interfaces of the whole system.
Step 6: and (5) carrying out permutation analysis on the data obtained in the step (5) to obtain the development quality of each interface.
And packaging the response interceptors in the front-end engineering, so that all interface responses pass through the response interceptors, acquiring the interface url address and the response message of the current request in the response interceptors, and acquiring historical execution information of the interface url from the localstorage, thereby sequentially acquiring the execution conditions of all interfaces in the system, and performing permutation analysis on the data to obtain the development quality of each interface. By the method, the statistical analysis can be performed on all the interfaces instead of the conventional method of performing recording on a single interface at a time, so that the statistical analysis structure is more real and the efficiency is higher.
In summary, the invention obtains the execution failure times and the total execution times of each interface through the response interceptor, calculates the defect rate, and stores the obtained data in the localstorage, so that the defect rate of all the interfaces under a large amount of execution can be conveniently obtained during system extraction, thereby obtaining the development quality of each interface, meeting the development quality evaluation requirement in the software development process, and improving the authenticity of development quality evaluation.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (3)
1. A method for rapidly counting the interface defect rate and estimating the development quality is characterized by comprising the following steps:
step 1: packaging a response interceptor in front-end engineering so that all interface responses can pass through the response interceptor;
step 2: defining a data storage mechanism, wherein data is stored in a local storage localstorage of a browser, key is an interface url address, and value is a json object containing the execution failure times, the total execution times and the defect rate of the interface;
and step 3: acquiring an interface url address and a response message of a current request from a response interceptor, and acquiring historical execution information of the interface url from a localstorage;
and 4, step 4: updating the latest data of the failure times, the total times and the defect rate into a localstorage according to the information acquired in the step 3;
and 5: carrying out extraction and test on the system to obtain the execution conditions of all interfaces;
step 6: and (5) carrying out permutation analysis on the data obtained in the step (5) to obtain the development quality of each interface.
2. The method for rapidly counting the interface defect rate and estimating the development quality according to claim 1, wherein the step 4 comprises the following steps:
step 4.1: if the response message is abnormal information, adding 1 to the execution failure times; if the response message is normal information, the execution failure times do not need to be added with 1;
step 4.2: adding 1 to the total number of execution times of the interface;
step 4.3: calculating the ratio of the latest execution failure times to the total execution times to obtain the defect rate of the modified interface;
step 4.4: and updating the latest execution failure times, the latest execution total times and the latest defect rate data into the localstorage.
3. The method for rapidly counting the interface defect rate and estimating the development quality according to claim 1, wherein the specific steps of the step 5 are as follows:
step 5.1: the tester automatically triggers an interface request by verifying the page function;
step 5.2: automatically recording the execution condition of the interface in a localstorage of the browser;
step 5.3: and sequentially acquiring the execution conditions of all the interfaces, and finally acquiring the execution conditions of all the interfaces of the whole system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111538629.8A CN114328195A (en) | 2021-12-15 | 2021-12-15 | Method for rapidly counting interface defect rate and estimating development quality |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111538629.8A CN114328195A (en) | 2021-12-15 | 2021-12-15 | Method for rapidly counting interface defect rate and estimating development quality |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114328195A true CN114328195A (en) | 2022-04-12 |
Family
ID=81052167
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111538629.8A Pending CN114328195A (en) | 2021-12-15 | 2021-12-15 | Method for rapidly counting interface defect rate and estimating development quality |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114328195A (en) |
-
2021
- 2021-12-15 CN CN202111538629.8A patent/CN114328195A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10102113B2 (en) | Software test automation systems and methods | |
TW201941058A (en) | Anomaly detection method and device | |
Xu et al. | POD-Diagnosis: Error diagnosis of sporadic operations on cloud applications | |
CN111756582B (en) | Service chain monitoring method based on NFV log alarm | |
CN105354126B (en) | Monitor method and apparatus abnormal in page script file | |
US20040167793A1 (en) | Network monitoring method for information system, operational risk evaluation method, service business performing method, and insurance business managing method | |
US20240039821A1 (en) | Mitigating failure in request handling | |
US11429574B2 (en) | Computer system diagnostic log chain | |
CN113946499A (en) | Micro-service link tracking and performance analysis method, system, equipment and application | |
WO2015080742A1 (en) | Production sampling for determining code coverage | |
CN115145751A (en) | Method, device, equipment and storage medium for positioning fault root cause of micro-service system | |
US8949669B1 (en) | Error detection, correction and triage of a storage array errors | |
CN116405412B (en) | Method and system for verifying cluster effectiveness of simulation server based on chaotic engineering faults | |
CN116909800A (en) | Method and device for locating crash information and storage medium | |
CN116954624A (en) | Compiling method based on software development kit, software development system and server | |
CN114328195A (en) | Method for rapidly counting interface defect rate and estimating development quality | |
CN115840686A (en) | Server performance test method and device, electronic equipment and storage medium | |
CN112162528B (en) | Fault diagnosis method, device, equipment and storage medium of numerical control machine tool | |
CN115269415A (en) | Interface test system and method based on simulation scene use case | |
CN112995648B (en) | Internet television full-flow fault diagnosis method and device and computing equipment | |
Kavulya et al. | Draco: Top Down Statistical Diagnosis of Large-Scale VoIP Networks | |
CN113127324B (en) | Automatic test report generation method and device, computer equipment and storage medium | |
CN113282506A (en) | Test data acquisition method, device, equipment and computer readable storage medium | |
CN113037550B (en) | Service fault monitoring method, system and computer readable storage medium | |
CN113127345A (en) | Application testing method and device, electronic equipment and storage medium |
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 |