CN116166565A - Regression testing method, device, equipment and medium - Google Patents

Regression testing method, device, equipment and medium Download PDF

Info

Publication number
CN116166565A
CN116166565A CN202310255205.3A CN202310255205A CN116166565A CN 116166565 A CN116166565 A CN 116166565A CN 202310255205 A CN202310255205 A CN 202310255205A CN 116166565 A CN116166565 A CN 116166565A
Authority
CN
China
Prior art keywords
test
case
cases
regression
test case
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
CN202310255205.3A
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.)
Sungrow Power Supply Co Ltd
Original Assignee
Sungrow Power Supply 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 Sungrow Power Supply Co Ltd filed Critical Sungrow Power Supply Co Ltd
Priority to CN202310255205.3A priority Critical patent/CN116166565A/en
Publication of CN116166565A publication Critical patent/CN116166565A/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a regression testing method, device, equipment and medium, belonging to the field of semi-physical simulation automatic testing. After the test cases are executed and the test results are collected, clustering analysis is carried out on the test results, and three operations of failure rate prediction and case mining are carried out. After the operation, the test case generated before is optimized, the test density is increased for the functional blocks with more test problems, the reliability of the test is ensured, and more problem points are expected to be found. And for functional blocks with fewer testing problems, the original testing cases are optimized, the testing similarity is reduced, and the testing efficiency is ensured. The modified test case can be used as the next round of return test of the controller to be tested, and repeated analysis processing and optimization are carried out according to the mode after the regression test is finished. The semi-physical simulation automatic test method aims at solving the technical problems of inaccurate semi-physical simulation automatic test and low coverage in the conventional technology.

Description

Regression testing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of semi-physical simulation automation testing, and in particular, to a regression testing method, a regression testing device, a regression testing apparatus, and a computer readable storage medium.
Background
In the current semi-physical simulation automatic test, test cases are designed and written mainly manually, and a tester is required to have a certain experience and a certain professional level, so that the coverage of the test is difficult to ensure in the process of manually designing the test cases. Meanwhile, different testers have different levels, and large projects require a large number of test cases, but not all the test cases are written by the same tester, so that the uniformity of the written test cases is difficult to ensure.
In order to avoid the above-mentioned situation, the uniformity is usually ensured by adopting a test case library form, that is, a complete test case library is established, test cases required by different test items are selected from the test case library, and input and output values are modified, so that the design of the test cases is completed. However, this approach can lead to the problem that the test cases gradually lose "sensitivity" during the continuous use process, and the software product cannot be checked out by the test cases. That is, the test cases in the test case library cannot cover all the test problems, wherein the test cases have limitations, the software product can only test through the existing test cases in the test case library, and the test case library has poor applicability. Although the test cases in the test case library can be passed each time, the test cases in the test case library can be passed, and after the software product is actually delivered, the problem that the test cases in the test case library are not covered often occurs.
Disclosure of Invention
The main purpose of the application is to provide a regression testing method, a regression testing device, regression testing equipment and a computer readable storage medium, and aims to solve the technical problems of inaccurate semi-physical simulation automatic test and low coverage in the conventional technology.
To achieve the above object, the present application provides a regression testing method, including:
performing cluster analysis, failure rate prediction and analysis processing of case mining on test results of the test cases;
optimizing the test cases according to analysis processing results to generate target test cases;
and carrying out the next round of regression testing based on the target test case.
Exemplary, the step of performing cluster analysis on the test result of the test case includes:
and eliminating the similar or low-sensitivity test cases in the regression test according to the test results of the test cases.
Exemplary, the step of predicting the failure rate of the test result of the test case includes:
and analyzing a heat point diagram of passing or failing of the test cases based on the failure rate prediction model, and pushing the test cases which are easy to fail to the next round of return test based on the heat point diagram.
Exemplary, the step of performing case mining on the test result of the test case includes:
And generating a test case with high support degree for the test case which is easy to fail and corresponds to the hot spot diagram, and multiplexing templates with smaller granularity.
Illustratively, before the steps of performing cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases, the method includes:
generating an application scene of the regression test according to the scene requirement of the regression test, and generating an interface model of the regression test based on the application scene;
and loading the test case and the application scene through the interface model, and running the test case in the application scene in a regression test environment to obtain a test result of the test case.
The test case includes an original test case and/or an extended test case, and before the step of generating the application scenario of the regression test according to the scenario requirement of the regression test, the method includes:
acquiring a function requirement specification of a controller to be tested, and generating a logic relation diagram of the function requirement specification;
and generating an original test case based on the logic relation diagram, and decomposing and expanding the original test case to obtain an expanded test case.
Illustratively, the step of generating the logical relationship diagram of the functional requirement specification includes:
analyzing the function requirement specification to obtain a test step of the function requirement specification, and dividing the functions of the test step to obtain a function block of the function requirement specification;
and generating a logic relation diagram of the function requirement specification based on the function content of the function block.
Exemplary, the step of decomposing and expanding the original test case to obtain an expanded test case includes:
randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, and increasing the reverse and/or fault test case of the original test case to obtain an extended test case.
The step of optimizing the test case according to the analysis processing result to generate the target test case includes:
for functional blocks with the number of the test problems exceeding a preset value, increasing the test density of the test cases corresponding to the functional blocks;
and reducing the test similarity of the test cases corresponding to the functional blocks for the functional blocks with the number of the test problems not exceeding the preset value.
The application also provides a regression testing device, the regression testing device includes:
the analysis module is used for carrying out cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases;
the optimizing module is used for optimizing the test cases according to analysis processing results to generate target test cases;
and the switching module is used for carrying out the next round of return test based on the target test case.
The application also provides a regression testing apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the regression testing method as described above.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the regression testing method as described above.
The embodiment of the application provides a regression testing method, a regression testing device, regression testing equipment and a computer readable storage medium, which are used for carrying out cluster analysis, failure rate prediction and analysis processing of case mining on the testing result of the testing case; optimizing the test cases according to analysis processing results to generate target test cases; and carrying out the next round of regression testing based on the target test case.
In the application, after the test cases are executed and the test results are collected, clustering analysis is carried out on the test results, and three operations of failure rate prediction and case mining are carried out. After the operation, the test case generated before is optimized, the test density is increased for the functional blocks with more test problems, the reliability of the test is ensured, and more problem points are expected to be found. And for functional blocks with fewer testing problems, the original testing cases are optimized, the testing similarity is reduced, and the testing efficiency is ensured. The modified test case can be used as the next round of return test of the controller to be tested, and repeated analysis processing and optimization are carried out according to the mode after the regression test is finished.
In the application, 1, a framework for intelligently generating a test case of a semi-physical simulation automatic test is provided, in the framework, not only the test case can be generated according to requirements, but also the currently generated test case can be optimized according to test results, so that the problem point of a controller to be tested in the test process can be continuously found; 2. the method for analyzing the test results, namely cluster analysis, failure rate prediction and case mining, can abandon the concept of a test case library in the traditional scheme through the mutual cooperation of the analysis processing, can construct different analysis models for the test results so as to judge the influence of the current test case on the whole test process, and ensures that the generated test case has higher sensitivity to the software of the controller to be tested all the time and continuously discovers the software defects in the controller to be tested.
Drawings
FIG. 1 is a schematic diagram of an operating device of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flow chart of an embodiment of a regression testing method according to an embodiment of the present application;
FIG. 3 is a flow chart of another embodiment of a regression testing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an application scenario of a regression testing method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a first regression testing apparatus according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of an operating device of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 1, the operation device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is not limiting of the operating device and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
As shown in fig. 1, an operating system, a data storage module, a network communication module, a user interface module, and a computer program may be included in the memory 1005 as one type of storage medium.
In the operating device shown in fig. 1, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001, the memory 1005 in the operation device of the present application may be provided in an operation device that calls a computer program stored in the memory 1005 through the processor 1001 and performs the following operations:
performing cluster analysis, failure rate prediction and analysis processing of case mining on test results of the test cases;
optimizing the test cases according to analysis processing results to generate target test cases;
and carrying out the next round of regression testing based on the target test case.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
The step of performing cluster analysis on the test results of the test cases comprises the following steps:
and eliminating the similar or low-sensitivity test cases in the regression test according to the test results of the test cases.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the step of predicting the failure rate of the test result of the test case comprises the following steps:
and analyzing a heat point diagram of passing or failing of the test cases based on the failure rate prediction model, and pushing the test cases which are easy to fail to the next round of return test based on the heat point diagram.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the step of performing case mining on the test result of the test case comprises the following steps:
and generating a test case with high support degree for the test case which is easy to fail and corresponds to the hot spot diagram, and multiplexing templates with smaller granularity.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
before the steps of carrying out cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases, the method comprises the following steps:
Generating an application scene of the regression test according to the scene requirement of the regression test, and generating an interface model of the regression test based on the application scene;
and loading the test case and the application scene through the interface model, and running the test case in the application scene in a regression test environment to obtain a test result of the test case.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the test cases comprise original test cases and/or extended test cases, and before the step of generating the application scene of the regression test according to the scene requirement of the regression test, the method comprises the following steps:
acquiring a function requirement specification of a controller to be tested, and generating a logic relation diagram of the function requirement specification;
and generating an original test case based on the logic relation diagram, and decomposing and expanding the original test case to obtain an expanded test case.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the step of generating the logical relation diagram of the functional requirement specification comprises the following steps:
Analyzing the function requirement specification to obtain a test step of the function requirement specification, and dividing the functions of the test step to obtain a function block of the function requirement specification;
and generating a logic relation diagram of the function requirement specification based on the function content of the function block.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the step of decomposing and expanding the original test case to obtain an expanded test case comprises the following steps:
randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, and increasing the reverse and/or fault test case of the original test case to obtain an extended test case.
In an embodiment, the processor 1001 may call a computer program stored in the memory 1005, and further perform the following operations:
the step of optimizing the test case according to the analysis processing result and generating the target test case comprises the following steps:
for functional blocks with the number of the test problems exceeding a preset value, increasing the test density of the test cases corresponding to the functional blocks;
And reducing the test similarity of the test cases corresponding to the functional blocks for the functional blocks with the number of the test problems not exceeding the preset value.
An embodiment of the present application provides a regression testing method, referring to fig. 2, in an embodiment of the regression testing method, the method includes:
step S10, carrying out cluster analysis, failure rate prediction and analysis processing of case mining on test results of the test cases;
in this embodiment, the semi-physical simulation automation test includes a virtual controller+a Rapid Control Prototype (RCP) simulation system of a real object, and a hardware-in-loop (HiL) simulation system of a real controller+a virtual object. In general, the premise of performing HIL test is that the controller is developed and whether the function of the controller is normal or not needs to be tested under an ideal or safe environment.
In this embodiment, each test step of the test case being executed is dynamically determined, whether the test result of each test step meets the design requirement is determined, and a final test result is generated according to the result of the dynamic determination. In one embodiment, the test results of the test cases are subjected to one or more of cluster analysis, failure rate prediction, and case mining.
Exemplary, the step of performing cluster analysis on the test result of the test case includes:
step S10A, eliminating the similar or low-sensitivity test cases in the regression test according to the test results of the test cases.
In the analysis processing process of the cluster analysis, a multi-dimensional cluster analysis model is built mainly based on the text, test scripts and/or execution results of the test cases, a test case cluster pipeline is further built, and the test cases with similar or lower sensitivity in the test tasks are automatically removed according to the operation results of the test cases.
In an embodiment, according to the test result, the test result passing rate of the functional policy (functional block) a is displayed to be higher, and then the module uses the number of test cases similar to the generated test cases of the functional policy (functional block) a to reject, that is, reject the functional block which is normal and has no problem, and does not need to test the test cases of the functional block again, so as to ensure the execution efficiency of the next round of return test process. In the module, similar test cases are removed, and each test attribute of the passing functional block is reduced to one or a plurality of attributes.
Exemplary, the step of predicting the failure rate of the test result of the test case includes:
and step S10B, analyzing a hot spot diagram passing or failing the test case based on the failure rate prediction model, and pushing the test case which is easy to fail to the next round of return test based on the hot spot diagram.
In the analysis processing process of failure rate prediction, high-value features are automatically extracted from test case execution and result records, wherein the high-value features are features with more problems, a failure rate prediction model is constructed, the influence of the current test case on test coverage and a passing or failing heat point diagram of the test case are analyzed through the failure rate prediction model, candidate test cases in the next round of return test are ordered, and the test cases which are easy to fail are mainly pushed, so that the software problems of the current version are found in advance.
Exemplary, the step of performing case mining on the test result of the test case includes:
and S10C, generating a test case with high support degree for the corresponding test case which is easy to fail in the hot spot diagram, and multiplexing templates with smaller granularity.
In the analysis processing process of case mining, a multidimensional association relation model is constructed, a hot point diagram of passing or failing of test cases in the analysis processing process of failure rate prediction is combined, a flow chart is mined and refined for function points with more failed tests, and the result of test case basification is obtained, so that more test cases with high support degree are generated for the function points. That is, the test cases with larger probability of problem determined by the prediction model are subjected to template multiplexing with smaller granularity, finer test cases are designed, and a large amount of manual operation for the traditional redesigned test cases is avoided through a full-automatic process.
In an embodiment, in the result determination module, the test cases are baselined, the primary function of the test case baselining is to only keep the most basic test cases (including basic forward test and reverse fault test, etc.) which can meet each functional policy (functional block) according to the running result of the test cases, and the most basic test cases are used as templates for generating more tests later, after the operation is completed, the most basic test cases are integrated and combined and fed back to an upper computer, the templates and the result are displayed, preparation is made for the next test, and the final templates are used in logic relations such as a flow chart/a state chart.
Step S20, optimizing the test cases according to analysis processing results to generate target test cases;
and step S30, performing the next round of regression testing based on the target test case.
After the test cases are executed and the test results are collected, clustering analysis is carried out on the test results, and three operations of failure rate prediction and case mining are carried out. After the operation, the test case generated before is optimized, the test density is increased for the functional blocks with more test problems, the reliability of the test is ensured, and more problem points are expected to be found. And for functional blocks with fewer testing problems, the original testing cases are optimized, the testing similarity is reduced, and the testing efficiency is ensured. The modified test case can be used as the next round of return test of the controller to be tested, and repeated analysis processing and optimization are carried out according to the mode after the regression test is finished.
In this embodiment, the test results of the test cases are subjected to cluster analysis, failure rate prediction, and analysis processing of case mining; optimizing the test cases according to analysis processing results to generate target test cases; and carrying out the next round of regression testing based on the target test case.
In the embodiment, 1, a framework for intelligently generating a test case of a semi-physical simulation automatic test is provided, in the framework, not only the test case can be generated according to requirements, but also the currently generated test case can be optimized according to test results, so that the problem point of a controller to be tested in the test process can be continuously found; 2. the method for analyzing the test results, namely cluster analysis, failure rate prediction and case mining, can abandon the concept of a test case library in the traditional scheme through the mutual cooperation of the analysis processing, can construct different analysis models for the test results so as to judge the influence of the current test case on the whole test process, and ensures that the generated test case has higher sensitivity to the software of the controller to be tested all the time and continuously discovers the software defects in the controller to be tested.
Referring to fig. 3, in another embodiment of the regression testing method, before the steps of performing cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases, the method includes:
step C, generating an application scene of the regression test according to the scene requirement of the regression test, and generating an interface model of the regression test based on the application scene;
and D, loading the test case and the application scene through the interface model, and running the test case in the application scene in a regression test environment to obtain a test result of the test case.
A series of preparation work is also required before the test results of the test cases are analyzed and processed. In this embodiment, the upper computer of the regression test generates an application scenario of the regression test according to the scenario requirements of the regression test (such as a model version of the HIL simulator and a model version of the automated HIL test software), and generates a corresponding application scenario as an interface model of the regression test, where the interface model is similar to a compiler and is used to convert the script of the test case into an operation language in the application scenario.
After the interface model is generated, the test cases and the application scenes are loaded into the interface model of the regression test, so that the test cases in the application scenes are operated in the regression test environment, and the test results of the test cases are obtained.
In an embodiment, when testing is formally started, the interface model transmits the loaded test case and the configured application scenario to the test environment for execution, so that the test environment builds the configured application scenario, builds the running environment of the running language corresponding to the test script, dynamically judges each test step of the test case in the test process, and generates a final test result according to the dynamic judgment result.
The test case includes an original test case and/or an extended test case, and before the step of generating the application scenario of the regression test according to the scenario requirement of the regression test, the method includes:
step A, obtaining a function requirement specification of a controller to be tested, and generating a logic relation diagram of the function requirement specification;
and step B, generating an original test case based on the logic relation diagram, and decomposing and expanding the original test case to obtain an expanded test case.
Before the application scene of the regression test is generated according to the scene requirement of the regression test, test cases are also required to be generated, and the generated test cases comprise original test cases and/or expanded test cases. In this embodiment, the function requirement specification of the controller to be tested is obtained, the function requirement specification of the controller to be tested is loaded to the upper computer, and then the logic relationship diagrams such as the function flow chart/state chart/traverse chart are automatically generated from the text document in a keyword extraction mode and the like according to the specific function content of the function requirement specification. Next, the original test cases are generated based on the logic relation diagram, namely, scripts such as matching function flow diagrams/state diagrams/traversal diagrams which can be run and identified are generated in the test simulation environment. And decomposing and expanding the original test case to obtain an expanded test case.
Illustratively, the step of generating the logical relationship diagram of the functional requirement specification includes:
step A1, analyzing the function requirement specification to obtain a test step of the function requirement specification, and dividing the functions of the test step to obtain a function block of the function requirement specification;
and step A2, generating a logic relation diagram of the function requirement specification based on the function content of the function block.
The upper computer analyzes the loaded function requirement specification and divides the function into different function strategies (function blocks) according to the function of the testing step. For example, a test case may include 10 test steps, but may be divided into three functions according to the function division, so that three functional blocks of function a, function B and function C may be obtained. Namely, the test steps in the case script of each test case are subjected to functional division, so that functional blocks of each test case are obtained, and the functional blocks correspond to code blocks of the case script of the test case. And then, generating a logic relation diagram of the function requirement specification according to the function content of each function block.
Exemplary, the step of decomposing and expanding the original test case to obtain an expanded test case includes:
randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, and increasing the reverse and/or fault test case of the original test case to obtain an extended test case.
And decomposing and expanding the original test case based on the decomposition and expansion of the original test case to obtain an expanded test case. The expansion test cases are mainly used for supplementing the original test cases and comprise randomly increasing effective values, selecting characteristic values, processing boundary values and reversing/fault test cases. Wherein the valid value may be an interval boundary value; the feature value selection may be to select a boundary value of a section where the problem frequently occurs as a feature value; the boundary value processing may be to delete an interval boundary value where a problem rarely occurs.
The step of optimizing the test case according to the analysis processing result to generate the target test case includes:
step S20A, for functional blocks with the number of test problems exceeding a preset value, increasing the test density of the test cases corresponding to the functional blocks;
and step S20B, for the functional blocks with the number of the test problems not exceeding a preset value, reducing the test similarity of the test cases corresponding to the functional blocks.
After the test cases are executed and the test results are collected, clustering analysis is carried out on the test results, and three operations of failure rate prediction and case mining are carried out. After the operation, the test cases generated before are optimized, the test density is increased for the functional blocks with more test problems, the number of the test problems exceeds the preset value, the reliability of the test is ensured, and more problem points are expected to be found. And for functional blocks with fewer testing problems, the number of the testing problems does not exceed a preset value, the original testing cases are optimized, the testing similarity is reduced, and the testing efficiency is ensured. The modified test case can be used as the next round of return test of the controller to be tested, and repeated analysis processing and optimization are carried out according to the mode after the regression test is finished.
Referring to fig. 4, in an application scenario of a regression testing method of the present application, a method for rapid automated testing based on semi-physical simulation is provided.
1. And the upper computer automatically reads and analyzes the function requirement specification of the controller to be tested, and generates a function flow traversal chart according to the function requirement specification.
2. According to the process traversal diagrams of different functions, an original test case is firstly generated, and according to the original test case, an extension test case is generated. The expansion test cases are mainly used for supplementing the original test cases and comprise randomly increasing effective values, selecting characteristic values, processing boundary values and reversing/fault test cases.
3. Meanwhile, the upper computer generates a corresponding interface file according to the application scene required to be tested, namely the type of the simulation machine and the type and version of the automatic test software of the HIL test, and the interface file is used for loading the test cases.
4. After the test cases are executed and the test results are collected, three operations, namely cluster analysis, failure rate prediction and case mining, are needed to be carried out on the test results. After the operation, the analyzed test result is subjected to machine learning, the test case generated before is optimized according to the machine learning result, the test density is increased for the functional blocks with more test problems, the reliability of the test is ensured, and more problem points are expected to be found. And for functional blocks with fewer testing problems, the original testing cases are optimized, the testing similarity is reduced, and the testing efficiency is ensured.
5. The modified test case can be used as the next round of return test of the controller to be tested, and after the regression test is finished, repeated machine learning and optimization are performed according to the mode.
In the application scenario, taking the HIL test as an example, the specific implementation process is as follows:
and (3) loading the requirement specification of the controller to be tested to the upper computer through the step (1), analyzing the requirement specification by the upper computer, and dividing the requirement specification into different functional strategies (functional blocks) through the step (2) according to the functions of the requirement specification. For example, a test case may contain 10 test steps, but may be divided into three functions (function a, function B, and function C) according to the function division. [ analyzing the functional requirement specification to obtain a test step of the functional requirement specification, dividing the functions of the test step to obtain a functional block of the functional requirement specification ]
Different functional test strategies (functional blocks) generate functional flow charts/state charts/traversal charts and the like according to the specific content of the functions through the step 3, and the logical relation flow charts are generated from the text documents through a keyword extraction mode. [ generating a logical relation diagram of the functional requirement Specification based on the functional content of the functional Block ]
And generating an original test case according to the generated functional flow chart/state chart/traversing chart in step 4, wherein the original test case only comprises basic forward test contents. That is, scripts are generated in the simulation environment of the Hil test that can run, match functional flowcharts/state diagrams/traversals that can be identified, etc. [ Generation of original test cases based on the logical relationship diagram ]
Based on the original test case, decomposing and expanding the original test case into an expanded test case through the step 5. [ decomposing and expanding the original test case to obtain an expanded test case ]
The expansion test cases are mainly used for supplementing the original test cases and comprise randomly increasing effective values, selecting characteristic values, processing boundary values and reversing/fault test cases. Effective value: interval boundary values; and (3) characteristic value selection: selecting a boundary value of a section where the problem frequently occurs as a characteristic value; boundary value processing: and deleting the interval boundary value with few problems. Randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, increasing the reverse and/or fault test case of the original test case, and obtaining an extended test case
The upper computer generates an application scene through step 18 according to the scene requirement of the HIL test (such as the model version of the HIL simulator and the model version of the automatic HIL test software), and generates a corresponding application scene into an interface model of the HIL test through step 8 (similar to a compiler, the script of the test case is converted into an operation language in the application scene). [ generating an application scenario of the regression test according to scenario requirements of the regression test, and generating an interface model of the regression test based on the application scenario ]
After the interface model is generated, the generated original test case and the generated extended test case are loaded into the interface model of the HIL test through the step 6 and the step 7 respectively. [ loading test cases and the application scenarios through the interface model ]
When the test is formally started, the HIL test interface model issues the loaded test cases and the configured application scenes to the HIL test environment for execution through the step 9, so that the test environment builds the configured application scenes, builds the running environment of the running language corresponding to the test script, dynamically judges each test step of the test cases through the step 10 in the test process (in the prior art, whether the test result of each test step meets the design requirement or not needs to be judged), and generates a final HIL test result according to the dynamically judged result through the step 11. [ running the test cases under the application scenario in a regression test Environment to obtain test results of the test cases ]
And (3) according to the final HIL test result generated in the step (11), three modules are designed to analyze and process the test result, namely a cluster analysis module, a failure rate prediction module and a use case mining module. [ analysis of test results of test cases, failure Rate prediction, and analysis processing of case mining ]
It is difficult to eliminate all problems in one round of testing and multiple rounds of modified testing are required to determine all problems. The steps of random number setting and the like are random, the results of the steps are not known, therefore, the 3 modules analyze the obtained actual test results to determine where the problems are, such as where the problems are more or less, where the coverage is higher or lower, where the test results are unstable, the test is required to be repeated or stable can pass, and finally, a convergence result is obtained. The machine module passes the learned results to a flowchart/state diagram/traversal diagram for the next round of return testing, via step 15. [ Next round of regression testing based on the target test case ]
In the cluster analysis module, the main function is to construct a multi-dimensional cluster analysis model based on test case texts/scripts/execution results, further construct a test case clustering pipeline and automatically reject test cases with similar or lower sensitivity in test tasks according to the running results of the test cases. For example, according to the test result, the test result passing rate of the functional policy (functional block) a is higher, and then the module will reject the number of test cases similar to the generated test cases of the functional policy (functional block) a (reject the functional block without problems, and not need to test the test cases of the functional block) so as to ensure the execution efficiency of the next round of return test process. In this module, similar test cases are culled: and (3) simplifying each test attribute of the passed functional block into one or a plurality of attributes. [ test cases with similar or Low sensitivity in the rejection regression test according to the test results of the test cases ]
In the failure rate prediction module, high-value features are automatically extracted from test case execution and result records: the method comprises the steps of generating more-problem characteristics, constructing a failure rate prediction model, analyzing the influence of a current test case on test coverage and a pass/fail hot spot diagram of the test case, sequencing candidate test cases in the next round of return test, mainly pushing the test case which is easy to fail, and finding out the software problem of the current version in advance. [ analyzing a hot spot diagram of test cases passing or failing based on a failure rate prediction model, pushing test cases which are likely to fail to a next round of return test based on the hot spot diagram ]
In the case mining module, a multidimensional association relation model is mainly constructed, a test case pass/fail hot spot diagram in a failure rate prediction module is combined, a flow chart is mined and refined for functional points with more test failures, a test case baseline result is obtained according to the step 17, more test cases with high support degree are generated for the functional points, the test cases with higher problem probability determined by the prediction model are subjected to template multiplexing with smaller granularity, finer test cases are designed, and a large amount of manual operation for traditional redesign of the test cases is avoided through a full-automatic flow. [ generating test cases with high support for corresponding test cases which are easy to fail in the hot spot diagram, and multiplexing templates with smaller granularity ]
In the result determination module, the test cases are baselined through step 12, and the primary function of the test case baselining is to only keep the most basic test cases (including basic forward test and reverse fault test, etc.) which can meet each functional policy (functional block) according to the running result of the test cases, and to be used as templates for later generation of more tests, and to feed back the integrated combination of the test cases to the upper computer through step 18 after the operation is completed. The templates and results are presented and used in the flow/state diagram by arrows 16, 15 in the figure, ready for the next test.
Among them, for "machine learning module", one, it has three input quantities: namely a cluster analysis module (eliminating test cases with similar or lower sensitivity in the test task), a failure rate prediction module (sorting candidate test cases in the next round of return test, mainly pushing test cases which are easy to fail) and an output result (called as three modules below) of a case mining module (generating more test cases with high support degree for the functional point). It has two outputs: the method is characterized in that the method is respectively transmitted to an upper computer module for summarizing the current learning information, namely informing a tester of test cases needing to be developed next time, and simultaneously feeding the learning result back to a flow chart/state diagram module.
2. When the first round of testing is finished, the machine learning module mainly plays roles of transmission, recording and summarizing. Firstly, summarizing and recording, namely, a machine learning module firstly records the information of a first round of test according to the information transmitted by the three modules, comprises basic test cases and analysis results corresponding to the three modules, and feeds back the information of the test cases to be executed of a second round to an upper computer module and a flow chart/state diagram module according to the analysis results.
3. After the second round of testing is finished, the machine learning module adds a comparison analysis function on the basis of the functions, namely, the results of the first round of testing and the results of the second round of testing are compared.
For example, after the first round of test results, the number of problem points of the a functional module is found to be more, and when a software engineer modifies the finished software, the "machine learning module" increases the test cases of the a functional module, and reduces the test cases of the B functional module, and starts to perform the second round of test, the problem of the a functional module is found to be basically solved (the test is completely passed or the test failure rate is less than 5%), but the problem of the B functional module which is originally passed (the test failure rate is greater than 20%) is found to start to occur. At this time, the machine learning module does not complete the subsequent operation according to the original three module input quantity providing schemes, namely, the testing problem points of the A functional block are reduced, and the testing points of the B functional block are increased.
At this time, the "machine learning module" determines that the problem of the a module in the second round of testing is solved, but many problems are found in the first round of testing, so the "machine learning module" randomly increases the test cases passed by the a function module in the first round of testing and the test cases failed in the test according to a certain weight value on the basis of keeping the minimum test content of the a function module, and the number of the increased test cases accounts for 40% of all the test cases of the a function module in the first round of testing. And adding test points of the B functional block according to suggestions provided by the three modules.
4. Continuing with the third round of testing, if the A-function module still passes all tests (or less than 5%), the increased number of test cases is reduced from 40% to 30% of the second round, again in the manner described above, and if the A-function module appears to have exceeded a certain weight (e.g., a test failure rate of greater than 20%), the increased number of test cases is increased from 40% to 50% of the second round, again in the manner described above.
5. After a plurality of rounds of testing are performed, it can be seen from the above that when the test failure rate of the continuous four-wheel test of the functional module a is less than 5%, the functional module a is considered to pass the test "truly", and only the minimum test content is reserved in the later test. If the failure rate of the functional module A is greater than 5% in the later test, repeating the operation.
In a typical application case of the application scenario, the specific implementation process is as follows:
when a tester needs to perform an HIL test on a certain controller, the tester firstly guides the function specification of the controller into an upper computer. After the upper computer analyzes the function specification, the function specification is first divided into three function strategies (function blocks), and a flow chart/state diagram/traversing diagram and the like are generated according to the three function strategies.
The upper computer generates an original test case for each of three functional strategies ABC (functional blocks) according to the generated flow chart/state chart/traversing chart, and generates a plurality of extended test cases randomly (for example, 10 pieces of A are generated, 20 pieces of B are generated, and 30 pieces of C are generated) according to the principles of random increase of effective values, selection of characteristic values, boundary value processing and reverse/failure based on the original test case. And meanwhile, the upper computer generates a corresponding HIL test interface model according to the tested HIL environment.
In the HIL test interface model, the test cases (10 pieces of A, 20 pieces of B and 30 pieces of C) and the HIL test environment are integrated, and the test work is completed.
After the test is finished, firstly, processing test results by the executed 60 test cases according to a cluster analysis module, a failure rate prediction module and a case mining module, and simultaneously, in a test case baselining module, carrying out baselining operation on the test cases, only preserving the most basic test cases of a functional strategy ABC (functional block) and using the most basic test cases as templates for later generation of more tests.
After the test result and the test case are processed, the test result is sent to a machine learning unit for self-learning, and the current test case is optimized according to the learned result, so that more software problems can be found when the regression test is carried out next time.
In addition, referring to fig. 5, an embodiment of the present application further provides a regression testing apparatus, where the regression testing apparatus includes:
the analysis module M1 is used for carrying out cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases;
the optimizing module M2 is used for optimizing the test cases according to analysis processing results to generate target test cases;
and the switching module M3 is used for carrying out the next round of return test based on the target test case.
Illustratively, the analysis module is further to:
and eliminating the similar or low-sensitivity test cases in the regression test according to the test results of the test cases.
Illustratively, the analysis module is further to:
and analyzing a heat point diagram of passing or failing of the test cases based on the failure rate prediction model, and pushing the test cases which are easy to fail to the next round of return test based on the heat point diagram.
Illustratively, the analysis module is further to:
and generating a test case with high support degree for the test case which is easy to fail and corresponds to the hot spot diagram, and multiplexing templates with smaller granularity.
Illustratively, the regression testing apparatus further includes a loading module for:
before the steps of cluster analysis, failure rate prediction and analysis processing of case mining are carried out on the test results of the test cases:
generating an application scene of the regression test according to the scene requirement of the regression test, and generating an interface model of the regression test based on the application scene;
and loading the test case and the application scene through the interface model, and running the test case in the application scene in a regression test environment to obtain a test result of the test case.
Illustratively, the test cases include original test cases and/or extended test cases, and the loading module is further configured to:
before the step of generating the application scenario of the regression test according to the scenario requirement of the regression test:
acquiring a function requirement specification of a controller to be tested, and generating a logic relation diagram of the function requirement specification;
and generating an original test case based on the logic relation diagram, and decomposing and expanding the original test case to obtain an expanded test case.
Illustratively, the loading module is further configured to:
analyzing the function requirement specification to obtain a test step of the function requirement specification, and dividing the functions of the test step to obtain a function block of the function requirement specification;
and generating a logic relation diagram of the function requirement specification based on the function content of the function block.
Illustratively, the loading module is further configured to:
randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, and increasing the reverse and/or fault test case of the original test case to obtain an extended test case.
Illustratively, the optimization module is further configured to:
for functional blocks with the number of the test problems exceeding a preset value, increasing the test density of the test cases corresponding to the functional blocks;
and reducing the test similarity of the test cases corresponding to the functional blocks for the functional blocks with the number of the test problems not exceeding the preset value.
The regression testing device provided by the application adopts the regression testing method in the embodiment, and solves the technical problems of inaccurate semi-physical simulation automatic test and low coverage in the conventional technology. Compared with the conventional technology, the regression testing device provided by the embodiment of the present application has the same beneficial effects as the regression testing method provided by the above embodiment, and other technical features in the regression testing device are the same as the features disclosed by the method of the above embodiment, and are not described in detail herein.
In addition, the embodiment of the application also provides regression testing equipment, which comprises: a memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the regression testing method as described above.
Furthermore, the embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the regression testing method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the conventional technology in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (12)

1. A regression testing method, comprising:
performing cluster analysis, failure rate prediction and analysis processing of case mining on test results of the test cases;
Optimizing the test cases according to analysis processing results to generate target test cases;
and carrying out the next round of regression testing based on the target test case.
2. The regression testing method of claim 1 wherein the step of performing a cluster analysis on the test results of the test case comprises:
and eliminating the similar or low-sensitivity test cases in the regression test according to the test results of the test cases.
3. The regression testing method of claim 1 wherein the step of predicting the failure rate of the test results of the test case comprises:
and analyzing a heat point diagram of passing or failing of the test cases based on the failure rate prediction model, and pushing the test cases which are easy to fail to the next round of return test based on the heat point diagram.
4. The regression testing method of claim 3, wherein the step of performing case mining on the test results of the test cases comprises:
and generating a test case with high support degree for the test case which is easy to fail and corresponds to the hot spot diagram, and multiplexing templates with smaller granularity.
5. The regression testing method according to claim 1, wherein before the step of performing the analysis processing of cluster analysis, failure rate prediction, and case mining on the test results of the test cases, it comprises:
Generating an application scene of the regression test according to the scene requirement of the regression test, and generating an interface model of the regression test based on the application scene;
and loading the test case and the application scene through the interface model, and running the test case in the application scene in a regression test environment to obtain a test result of the test case.
6. The regression testing method of claim 5, wherein the test cases comprise original test cases and/or extended test cases, and wherein prior to the step of generating the application scenario of the regression test based on the scenario requirements of the regression test, the method comprises:
acquiring a function requirement specification of a controller to be tested, and generating a logic relation diagram of the function requirement specification;
and generating an original test case based on the logic relation diagram, and decomposing and expanding the original test case to obtain an expanded test case.
7. The regression testing method of claim 6 wherein the step of generating the logical relationship graph of the functional demand specification comprises:
analyzing the function requirement specification to obtain a test step of the function requirement specification, and dividing the functions of the test step to obtain a function block of the function requirement specification;
And generating a logic relation diagram of the function requirement specification based on the function content of the function block.
8. The regression testing method of claim 6 wherein said decomposing and expanding said original test case to obtain an expanded test case comprises:
randomly increasing the effective value of the original test case, selecting the characteristic value of the original test case, processing the boundary value of the original test case, and increasing the reverse and/or fault test case of the original test case to obtain an extended test case.
9. The regression testing method of claim 7 wherein the step of optimizing the test case based on the analysis processing results to generate a target test case comprises:
for functional blocks with the number of the test problems exceeding a preset value, increasing the test density of the test cases corresponding to the functional blocks;
and reducing the test similarity of the test cases corresponding to the functional blocks for the functional blocks with the number of the test problems not exceeding the preset value.
10. A regression testing apparatus, comprising:
the analysis module is used for carrying out cluster analysis, failure rate prediction and analysis processing of case mining on the test results of the test cases;
The optimizing module is used for optimizing the test cases according to analysis processing results to generate target test cases;
and the switching module is used for carrying out the next round of return test based on the target test case.
11. A regression testing apparatus, comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the regression testing method of any one of claims 1 to 9.
12. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the regression testing method according to any one of claims 1 to 9.
CN202310255205.3A 2023-03-13 2023-03-13 Regression testing method, device, equipment and medium Pending CN116166565A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310255205.3A CN116166565A (en) 2023-03-13 2023-03-13 Regression testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310255205.3A CN116166565A (en) 2023-03-13 2023-03-13 Regression testing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116166565A true CN116166565A (en) 2023-05-26

Family

ID=86416440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310255205.3A Pending CN116166565A (en) 2023-03-13 2023-03-13 Regression testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116166565A (en)

Similar Documents

Publication Publication Date Title
CN110221975B (en) Method and device for creating interface case automation test script
CN109146081B (en) Method and device for creating model project in machine learning platform
CN110287098A (en) Automatically create test script method, server and computer readable storage medium
CN112328489B (en) Test case generation method and device, terminal equipment and storage medium
CN102866944A (en) Pressure testing system and method
CN109669436B (en) Test case generation method and device based on functional requirements of electric automobile
CN111737152A (en) Method and device for realizing WEB automatic test by inputting data through webpage
CN111459796B (en) Automated testing method, apparatus, computer device and storage medium
JP7268759B2 (en) TEST DATA GENERATION DEVICE, TEST DATA GENERATION METHOD, AND PROGRAM
KR20190135074A (en) Ui testing automation method using deep learning algorithem and tree and appratus for the same
CN112765014A (en) Automatic test system for multi-user simultaneous operation and working method
CN116166565A (en) Regression testing method, device, equipment and medium
CN111581101A (en) Software model testing method, device, equipment and medium
KR20200144296A (en) Method and apparatus for parallel training of deep learning model
CN109298686A (en) System and method for using business intelligence for rule-based design and manufacture technology
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
EP3091453A1 (en) Designing a longevity test for a smart tv
CN109002980B (en) Scenarioized knowledge inspection method and device
CN115701591A (en) Business process testing method, device, medium and electronic equipment
CN112783775A (en) Special character input testing method and device
Trusova Health analysis and diagnostic program synthesis for avionics systems
CN116756050B (en) MBSE-based inertial product use case analysis method, system and storage medium
JP2020098413A (en) Test support device, test support method and computer program
CN111858387B (en) Data preparation method and device
CN116680194B (en) Implementation method of efficient semi-automatic artificial intelligence software

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