CN115905031B - Test case recommendation method based on accurate quality assurance system - Google Patents
Test case recommendation method based on accurate quality assurance system Download PDFInfo
- Publication number
- CN115905031B CN115905031B CN202310238633.5A CN202310238633A CN115905031B CN 115905031 B CN115905031 B CN 115905031B CN 202310238633 A CN202310238633 A CN 202310238633A CN 115905031 B CN115905031 B CN 115905031B
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- test case
- codes
- branch
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a test case recommending method based on a precise quality assurance system, which comprises the steps of establishing a knowledge base containing a plurality of test cases, executing the test cases, acquiring codes of the test cases, and constructing a mapping relation between the test cases and the codes; pulling branch codes in the distributed version control system, deploying a test environment, submitting a test, performing differential comparison and call chain analysis on the branch codes and codes of all test cases in a knowledge base, and positioning an affected interface range; based on the interface scope of the influence, a new test case is created or an existing test case in the knowledge base is called as a test case recommendation. According to the method, the test cases are automatically recommended according to iteration, and the flow is more efficient and more targeted. The invention goes deep into the system code level, aims at the focus test range, improves the traceability and transparency of the test process, and improves the quality work efficiency and the product quality.
Description
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a test case recommending method based on a precise quality assurance system.
Background
From the system characteristics of the building industry, all systems almost have the characteristics of large scale, various materials, complex business, strong system relevance, large transaction amount, quick change of requirements and the like. In addition, various new and old systems are staggered, so that the test analysis design difficulty is extremely complex. The traditional quality assurance method for guaranteeing the product quality is not an optimal solution, and the requirements cannot be met by only solving through manual analysis, so that the quality analysis design is more effective through technical means, the whole process is traceable, the conclusion is high in reliability, and a good solution idea is brought to a precise quality assurance system.
On the other hand, with the rapid and vigorous development of cloud networking service, the service complexity is gradually increased, the quality assurance tasks faced by research and development personnel are increasingly complicated, and how to cope with the increasingly growing tasks under the condition of limited human resources and develop the assurance work with high quality is one of the main problems faced by the current work. Aiming at the requirements of the Internet development of the building industry, how to ensure zero faults of a system faster, more efficiently and more accurately, the system is really responsible for customers, and the system is a technical problem to be solved by the technicians.
Therefore, the invention provides a test case recommending method based on a precise quality assurance system, so as to at least solve the technical problems.
Disclosure of Invention
The invention aims to solve the technical problems that: a test case recommending method based on a precise quality assurance system is provided, so as to at least solve the above part of technical problems.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
a test case recommending method based on a precise quality assurance system comprises the following steps:
step 1, establishing a knowledge base containing a plurality of test cases, executing the test cases, acquiring codes of the test cases, and constructing a mapping relation between the test cases and the codes;
step 2, pulling branch codes in the distributed version control system, deploying a test environment, submitting a test, performing differential comparison and call chain analysis on the branch codes and codes of all test cases in a knowledge base, and positioning an affected interface range;
and step 3, creating a new test case or calling an existing test case in the knowledge base as a test case recommendation based on the affected interface range.
Further, in the step 2, the differential comparison and call chain analysis of the branch codes include: step A, pulling a code test environment of a basic branch and a deployment branch in a distributed version control system and submitting a test; step B, based on the open source component, differential comparison is carried out on codes of the basic branch and the deployment branch, and a change file of the deployment branch is obtained; step C, calculating the increment coverage rate of the increment codes in the change file based on an open source code coverage rate tool; step D, the Java reflection screening and reading of the changed file are carried out, and noise reduction treatment is carried out on classes and methods in the changed file; and analyzing the corresponding class and method by utilizing the Java byte code control framework, sequentially recursively searching the call chain of the previous stage call and storing the corresponding interface, globally generating the call chain of each interface, removing the duplication, positioning the level change of each interface and generating a first change result.
Further, in the step 2, the differential comparison and call chain analysis of the codes of the test cases in the knowledge base includes: step a, calculating the code coverage rate of codes of each test case in a knowledge base based on an open source code coverage rate tool; step b, analyzing the classes in each test case code by utilizing a Java byte code control framework to obtain a call chain of an interface corresponding to each class; and c, based on the open source component, performing differential comparison on classes, methods and parameters in each test case code, screening call chains of the classes, methods and parameters which are compared in a differential way, screening call chains of the top layer, positioning level change of an interface and generating a second change result.
Further, the affected interface range is located according to the first change result and the second change result.
Further, in the step 3: the influence interface is a new interface, and a new test case is created and used as a recommended test case based on a branch code of the new interface; the influence interface is a history interface, and the test case corresponding to the history interface in the knowledge base is used as a recommended test case.
Further, the step 2 further includes: and jumping to an automation platform, creating test cases based on the branch codes and dynamically supplementing the test cases to a knowledge base.
Further, the invention also comprises:
step 4, noise reduction processing is carried out on the recommended test case;
step 5, executing the recommended test case;
and 6, carrying out increment coverage statistics on the recommended test cases.
Further, in the step 6, code coverage calculation is performed on the recommended test cases based on the open-source code coverage tool.
Compared with the prior art, the invention has the following beneficial effects:
according to the method, the test cases are automatically recommended according to iteration, and the flow is more efficient and more targeted. The invention goes deep into the system code level, aims at the focus test range, improves the traceability and transparency of the test process, and improves the quality work efficiency and the product quality.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
Technical noun:
git: an open-source distributed version control system;
JGit: a class library of lightweight pure Java for realizing access of the Git version control system and providing a core version control algorithm;
java Parser: the Java-based language lexical analysis tool is based on the Java CC;
jacaco: code coverage tool of open source;
ASM: java bytecode handles the framework.
The present invention will be described in further detail with reference to the accompanying drawings, in order to make the objects, technical solutions and advantages of the present invention more apparent. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, the test case recommending method based on the accurate quality assurance system provided by the invention comprises the following steps:
step 1, establishing a knowledge base containing a plurality of test cases, executing the test cases, acquiring codes of the test cases, and constructing a mapping relation between the test cases and the codes;
step 2, pulling branch codes in the distributed version control system, deploying a test environment, submitting a test, performing differential comparison and call chain analysis on the branch codes and codes of all test cases in a knowledge base, and positioning an affected interface range;
and step 3, creating a new test case or calling an existing test case in the knowledge base as a test case recommendation based on the affected interface range.
The invention solves the problem that the corresponding relation between the code change and the test case caused by unquantified change in the existing regression test process, and avoids the high cost caused by full regression. According to the invention, the mapping relation between the test cases and the codes is acquired by establishing the knowledge base, so that the knowledge base is conveniently utilized to recommend the test range; aiming at the problem that a large number of redundant test cases possibly exist in a knowledge base to influence the test efficiency, the range of the test cases is narrowed through noise reduction and interface positioning, and the effect of accurate recommendation is achieved.
In some embodiments, in the step 2, the differential comparing and the call chain analysis of the branch code include: step A, pulling a code test environment of a basic branch and a deployment branch in a distributed version control system and submitting a test; step B, based on the plug-in of the open source component JGit, javaParser, the codes of the basic branch and the deployment branch are subjected to differential comparison, and a change file of the deployment branch is obtained; step C, calculating the increment coverage rate of the increment codes in the change file based on an open source code coverage rate tool Jacoco; step D, the Java reflection screening and reading of the changed file are carried out, and noise reduction treatment is carried out on classes and methods in the changed file; and analyzing the corresponding class and method by using the Java byte code control framework ASM, sequentially recursively searching the call chain of the previous stage call and storing the corresponding interface, globally generating the call chain of each interface, removing the duplication, positioning the level change of each interface and generating a first change result. According to the invention, the Git address is transmitted through the newly added interface, codes of the basic branch and the deployment branch are pulled, differential information is analyzed by utilizing an open-source JGit, javaParser plug-in, and change files of adding, deleting and modifying the current deployment branch are obtained after differential comparison; and carrying out secondary development on the basis of Jacoco to obtain a specific change file, and then carrying out incremental coverage calculation on the incremental code by utilizing the existing capability of Jacoco to evaluate whether the change code is completely covered.
In some embodiments, in the step 2, the differential comparison and call chain analysis of the codes of the test cases in the knowledge base includes: step a, calculating the code coverage rate of each test case code in a knowledge base based on an open source code coverage rate tool Jacoco; step b, analyzing the classes in each test case code by using a Java byte code control framework ASM to obtain a call chain of an interface corresponding to each class; and c, based on the open source component, performing differential comparison on classes, methods and parameters in each test case code, screening call chains of the classes, methods and parameters which are compared in a differential way, screening call chains of the top layer, positioning level change of an interface and generating a second change result. The method is based on Jacoco, and code coverage rate calculation is carried out on codes of all test cases; then, performing byte code analysis (including analysis of class names, methods, attributes, java byte codes and the like) on the classes by using ASM, and analyzing a code call chain of each interface; the whole call chain of each interface can be known through the call chain analysis technology, and then the methods in the call chain of the interfaces are compared according to differentiation, so that the affected interface range is finally positioned. The invention obtains the call chain of each interface through call chain analysis, and the call condition of the method in each interface is clear. And finally, determining a changed interface according to the first change result and the second change result, and finally positioning the affected interface range.
The interface comprises a Core interface and a Tree interface, wherein the Core interface operates the class based on a visitor mode, the Tree interface Tree operates the class based on a Tree node, and the call chain scheme uses the visitor mode. The visitor mode based call chaining scheme provides a ClassVisitor, methodVisitor, fieldVisitorAPI interface. When ASM scans the class field, callback the method, when scanning the class method, callback the method and when scanning the class annotation, callback the AnnogionViactor; and information in the method body is read and inserted through a visitxxxInsn () method provided by a method.
In some embodiments, in the step 3: the influence interface is a new interface, and can directly jump to an automation platform, and a new test case is created and used as a recommended test case based on a branch code of the new interface; the influence interface is a history interface, is communicated with the automation platform, and takes the test cases corresponding to the history interface in the knowledge base as recommended test cases.
In some embodiments, the step 2 further includes: and jumping to an automation platform, creating test cases based on the branch codes and dynamically supplementing the test cases to a knowledge base. The method is convenient for continuous expansion of the knowledge base and more accurate recommendation.
In some embodiments, the invention further comprises:
step 4, noise reduction processing is carried out on the recommended test case;
step 5, executing the recommended test case;
and 6, carrying out increment coverage statistics on the recommended test cases, and finally obtaining a test report based on the coverage statistics to inform a responsible person to carry out rectification.
In the step 6, the recommended test case is subjected to code coverage calculation based on an open source code coverage tool Jacoco.
Finally, it should be noted that: the above embodiments are merely preferred embodiments of the present invention for illustrating the technical solution of the present invention, but not limiting the scope of the present invention; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions; that is, even though the main design concept and spirit of the present invention is modified or finished in an insubstantial manner, the technical problem solved by the present invention is still consistent with the present invention, and all the technical problems are included in the protection scope of the present invention; in addition, the technical scheme of the invention is directly or indirectly applied to other related technical fields, and the technical scheme is included in the scope of the invention.
Claims (3)
1. The test case recommending method based on the accurate quality assurance system is characterized by comprising the following steps of: step 1, establishing a knowledge base containing a plurality of test cases, executing the test cases, acquiring codes of the test cases, and constructing a mapping relation between the test cases and the codes;
step 2, pulling branch codes in the distributed version control system, deploying a test environment, submitting a test, performing differential comparison and call chain analysis on the branch codes and codes of all test cases in a knowledge base, and positioning an affected interface range;
step 3, based on the interface range of influence, creating a new test case or calling the existing test case in the knowledge base as the test case recommendation;
in the step 2, the differential comparison and call chain analysis of the branch codes comprise: step A, a Git address is transmitted through a newly added interface, a code test environment of a basic branch and a deployment branch in a distributed version control system is pulled, and a test is submitted; step B, based on the plug-in of the open source component JGit, javaParser, the codes of the basic branch and the deployment branch are subjected to differential comparison, and a change file of the deployment branch is obtained; step C, calculating the increment coverage rate of the increment codes in the change file based on an open source code coverage rate tool Jacoco; step D, the Java reflection screening and reading of the changed file are carried out, and noise reduction treatment is carried out on classes and methods in the changed file; analyzing the corresponding class and method by using a Java byte code control framework ASM, sequentially recursively searching a call chain of a previous stage call and storing a corresponding interface, globally generating a call chain of each interface, removing duplication, positioning level change of each interface and generating a first change result;
the differential comparison and call chain analysis of codes of each test case in the knowledge base comprises the following steps: step a, calculating the code coverage rate of each test case code in a knowledge base based on an open source code coverage rate tool Jacoco; step b, analyzing the classes in each test case code by using a Java byte code control framework ASM to obtain a call chain of an interface corresponding to each class; step c, based on the open source component, performing differential comparison on classes, methods and parameters in each test case code, screening call chains of the classes, methods and parameters which are compared in a differential manner, screening call chains of the top layer, positioning level change of an interface and generating a second change result;
positioning the affected interface range according to the first change result and the second change result;
the interface comprises a core interface and a tree interface, wherein the core interface is used for operating the class based on the visitor mode, the tree interface is used for operating the class based on the tree node, and the call chain scheme based on the visitor mode comprises the following steps: when ASM scans the class field, callback the method, when scanning the class method, callback the method and when scanning the class annotation, callback the AnnogionViactor; reading and inserting byte codes by a method provided by a method identifier;
the step 2 further includes: jumping to an automatic platform, creating test cases based on branch codes and dynamically supplementing the test cases to a knowledge base;
in the step 3, the influence interface is a newly added interface, and a newly added test case is created and used as a recommended test case based on a branch code of the newly added interface; the influence interface is a history interface, and the test case corresponding to the history interface in the knowledge base is used as a recommended test case.
2. The test case recommending method based on the accurate quality assurance system of claim 1, further comprising:
step 4, noise reduction processing is carried out on the recommended test case;
step 5, executing the recommended test case;
and 6, carrying out increment coverage statistics on the recommended test cases.
3. The test case recommending method based on the accurate quality assurance system according to claim 2, wherein in the step 6, the recommended test case is subjected to code coverage calculation based on an open source code coverage tool.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310238633.5A CN115905031B (en) | 2023-03-14 | 2023-03-14 | Test case recommendation method based on accurate quality assurance system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310238633.5A CN115905031B (en) | 2023-03-14 | 2023-03-14 | Test case recommendation method based on accurate quality assurance system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115905031A CN115905031A (en) | 2023-04-04 |
CN115905031B true CN115905031B (en) | 2023-06-23 |
Family
ID=86474934
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310238633.5A Active CN115905031B (en) | 2023-03-14 | 2023-03-14 | Test case recommendation method based on accurate quality assurance system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115905031B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116594918B (en) * | 2023-07-18 | 2024-01-26 | 中邮消费金融有限公司 | Test case change influence analysis method, device, equipment and storage medium |
CN117112413A (en) * | 2023-08-18 | 2023-11-24 | 鱼快创领智能科技(南京)有限公司 | Method for automatically generating interface test case |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019200808A1 (en) * | 2018-04-17 | 2019-10-24 | 平安科技(深圳)有限公司 | Test case recommendation method, electronic device, and readable storage medium |
CN111382073A (en) * | 2020-03-09 | 2020-07-07 | 腾讯科技(深圳)有限公司 | Automatic test case determination method, device, equipment and storage medium |
WO2020140820A1 (en) * | 2019-01-03 | 2020-07-09 | 京东方科技集团股份有限公司 | Software testing method, system, apparatus, device, medium, and computer program product |
CN112783800A (en) * | 2021-03-19 | 2021-05-11 | 北京奇艺世纪科技有限公司 | Test case screening method and device |
CN112817865A (en) * | 2021-02-24 | 2021-05-18 | 福建天泉教育科技有限公司 | Coverage precision test method and system based on componentized distributed system |
CN113419961A (en) * | 2021-07-09 | 2021-09-21 | 平安国际智慧城市科技股份有限公司 | Method, device, equipment and storage medium for establishing case library for business test |
CN113568833A (en) * | 2021-07-28 | 2021-10-29 | 深圳Tcl新技术有限公司 | Test case determination method and device, computer equipment and readable storage medium |
CN114064497A (en) * | 2021-11-22 | 2022-02-18 | 平安证券股份有限公司 | Application program testing method and device, computer equipment and storage medium |
CN114116505A (en) * | 2021-12-02 | 2022-03-01 | 北京达佳互联信息技术有限公司 | Code testing method and device |
CN114911706A (en) * | 2022-05-23 | 2022-08-16 | 腾讯科技(深圳)有限公司 | Use case recommendation method, device, equipment and storage medium |
CN115391233A (en) * | 2022-10-31 | 2022-11-25 | 深圳联友科技有限公司 | Accurate test method based on coverage rate analysis and link tracking |
CN115391228A (en) * | 2022-09-20 | 2022-11-25 | 浙江极氪智能科技有限公司 | Precise test method, device, equipment and medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10372596B2 (en) * | 2017-03-24 | 2019-08-06 | International Business Machines Corporation | Distributed system test device |
US10877864B2 (en) * | 2018-12-20 | 2020-12-29 | International Business Machines Corporation | Controlling segment layout in a stress test for a processor memory with a link stack |
CN110413506B (en) * | 2019-06-19 | 2023-02-03 | 平安普惠企业管理有限公司 | Test case recommendation method, device, equipment and storage medium |
-
2023
- 2023-03-14 CN CN202310238633.5A patent/CN115905031B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019200808A1 (en) * | 2018-04-17 | 2019-10-24 | 平安科技(深圳)有限公司 | Test case recommendation method, electronic device, and readable storage medium |
WO2020140820A1 (en) * | 2019-01-03 | 2020-07-09 | 京东方科技集团股份有限公司 | Software testing method, system, apparatus, device, medium, and computer program product |
CN111382073A (en) * | 2020-03-09 | 2020-07-07 | 腾讯科技(深圳)有限公司 | Automatic test case determination method, device, equipment and storage medium |
CN112817865A (en) * | 2021-02-24 | 2021-05-18 | 福建天泉教育科技有限公司 | Coverage precision test method and system based on componentized distributed system |
CN112783800A (en) * | 2021-03-19 | 2021-05-11 | 北京奇艺世纪科技有限公司 | Test case screening method and device |
CN113419961A (en) * | 2021-07-09 | 2021-09-21 | 平安国际智慧城市科技股份有限公司 | Method, device, equipment and storage medium for establishing case library for business test |
CN113568833A (en) * | 2021-07-28 | 2021-10-29 | 深圳Tcl新技术有限公司 | Test case determination method and device, computer equipment and readable storage medium |
CN114064497A (en) * | 2021-11-22 | 2022-02-18 | 平安证券股份有限公司 | Application program testing method and device, computer equipment and storage medium |
CN114116505A (en) * | 2021-12-02 | 2022-03-01 | 北京达佳互联信息技术有限公司 | Code testing method and device |
CN114911706A (en) * | 2022-05-23 | 2022-08-16 | 腾讯科技(深圳)有限公司 | Use case recommendation method, device, equipment and storage medium |
CN115391228A (en) * | 2022-09-20 | 2022-11-25 | 浙江极氪智能科技有限公司 | Precise test method, device, equipment and medium |
CN115391233A (en) * | 2022-10-31 | 2022-11-25 | 深圳联友科技有限公司 | Accurate test method based on coverage rate analysis and link tracking |
Also Published As
Publication number | Publication date |
---|---|
CN115905031A (en) | 2023-04-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115905031B (en) | Test case recommendation method based on accurate quality assurance system | |
Borg et al. | Szz unleashed: an open implementation of the szz algorithm-featuring example usage in a study of just-in-time bug prediction for the jenkins project | |
Verbeek et al. | Diagnosing workflow processes using Woflan | |
Tsantalis et al. | Assessing the refactorability of software clones | |
JP5791698B2 (en) | Code inspection execution system for ABAP source code | |
Bruntink et al. | On the use of clone detection for identifying crosscutting concern code | |
US9122540B2 (en) | Transformation of computer programs and eliminating errors | |
CN110059006B (en) | Code auditing method and device | |
CN108345532A (en) | A kind of automatic test cases generation method and device | |
US6374261B1 (en) | Expert system knowledge-deficiency reduction through automated database updates from semi-structured natural language documents | |
CN112765031B (en) | Decomposition method of crowd-sourcing vulnerability mining task | |
Di Lucca et al. | Clone analysis in the web era: An approach to identify cloned web pages | |
CN108897678B (en) | Static code detection method, static code detection system and storage device | |
CN114265772B (en) | Test case generation method and test method | |
CN109086985B (en) | Professional test information management system for spacecraft assembly | |
CN110928535B (en) | Derived variable deployment method, device, equipment and readable storage medium | |
Rapos et al. | SimPact: Impact analysis for simulink models | |
Henry | A technique for hiding proprietary details while providing sufficient information for researchers; or, do you recognize this well-known algorithm? | |
Peng et al. | Sif: A framework for solidity code instrumentation and analysis | |
CN113807077A (en) | Natural language test script parsing processing method and device and electronic equipment | |
Smirnov et al. | Revizor: a data-driven approach to automate frequent code changes based on graph matching | |
El Sakkout | Modelling and solving fleet assignment in a flexible environment | |
Al-Slais | Towards a comprehensive self-admitted technical debt extraction technique from source code comments | |
KGDKI | " Code Point"-software code clone analysis visualizer | |
Burd et al. | Assisting human understanding to aid the targeting of necessary reengineering work |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |