CN117873854A - Regression testing method and device and electronic equipment - Google Patents

Regression testing method and device and electronic equipment Download PDF

Info

Publication number
CN117873854A
CN117873854A CN202211242858.XA CN202211242858A CN117873854A CN 117873854 A CN117873854 A CN 117873854A CN 202211242858 A CN202211242858 A CN 202211242858A CN 117873854 A CN117873854 A CN 117873854A
Authority
CN
China
Prior art keywords
test
test case
duration
case
cases
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
CN202211242858.XA
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.)
Contemporary Amperex Technology Co Ltd
Contemporary Amperex Intelligence Technology Shanghai Ltd
Original Assignee
Contemporary Amperex Technology Co Ltd
Contemporary Amperex Intelligence Technology Shanghai 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 Contemporary Amperex Technology Co Ltd, Contemporary Amperex Intelligence Technology Shanghai Ltd filed Critical Contemporary Amperex Technology Co Ltd
Priority to CN202211242858.XA priority Critical patent/CN117873854A/en
Publication of CN117873854A publication Critical patent/CN117873854A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a regression testing method, a regression testing device and electronic equipment, and relates to the technical field of batteries. The method comprises the following steps: under the condition that a regression test request of target software is received, responding to the regression test request, acquiring the total historical test duration of a test case library and the expected test duration of the regression test request, wherein the test case library comprises a plurality of test cases, and the total historical test duration is the total duration consumed by testing the target software based on each test case in the test case library; under the condition that the total time length of the historical test is longer than the expected test time length, determining that part of test cases in the test case library are to-be-tested test cases based on the expected test time length; and carrying out regression testing on the target software through the test case to be tested.

Description

Regression testing method and device and electronic equipment
Technical Field
The application belongs to the technical field of batteries, and particularly relates to a regression testing method, a regression testing device and electronic equipment.
Background
In the process of software development, in order to achieve better running performance of the software, the software needs to be continuously and iteratively updated, for example, optimizing, deleting or adding software functions, and the like. The code is modified in the software iteration, and new errors may be introduced into the software or other errors may be caused in the modified code, so in order to ensure that the iterated software can normally run, regression testing is generally required to be performed on the iterated software. However, the current regression testing of software generally has the problem of being time-consuming.
Disclosure of Invention
The embodiment of the application aims to provide a regression testing method, a regression testing device and electronic equipment, which can solve the problem of safety accidents caused by out-of-control of a baking oven in the existing electronic equipment.
In a first aspect, an embodiment of the present application provides a regression testing method, including:
under the condition that a regression test request of target software is received, responding to the regression test request, acquiring a historical test total time length of a test case library and an expected test time length of the regression test request, wherein the test case library comprises a plurality of test cases, and the historical test total time length is the total time length consumed by testing the target software based on each test case in the test case library;
under the condition that the total historical test duration is longer than the expected test duration, determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration;
and carrying out regression testing on the target software through the test case to be tested.
In the embodiment of the application, by acquiring the total historical test duration of the test case library and the expected test duration of the regression test request, under the condition that the total historical test duration is greater than the expected test duration, determining that part of the test cases in the test case library are to-be-tested test cases based on the expected test duration, and carrying out regression test on the target software through the to-be-tested test cases. Therefore, a reasonable number of test cases can be selected from the test case library according to the expected test duration to carry out regression test on the target software, so that the time consumption in the process of carrying out regression test on the target software is shortened.
In some embodiments, the historical test total duration includes a test failure total duration, where the test failure total duration is a total duration consumed by at least one first test case test in testing the target software based on the test case library, the first test case is a test case that fails to test, and the at least one first test case is a part of test cases in the test case library;
under the condition that the total historical test duration is longer than the expected test duration, determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration comprises the following steps:
and under the condition that the total test failure time length is greater than or equal to the expected test time length, determining that at least part of the test cases are test cases in the at least one first test case.
In this embodiment, when the total test failure duration is greater than or equal to the expected test duration and greater than or equal to the expected test duration, at least a portion of test cases that fail in the history are determined to be test cases, so that the determined test cases are easier to find errors in the regression test, and accuracy of the regression test is further improved.
In some embodiments, the determining, in the at least one first test case, that at least a portion of the test cases are test cases:
acquiring the priority and the historical test duration of each first test case in the at least one first test case;
based on the historical test duration and the priority of each first test case in the at least one first test case, determining M first test cases as the test cases in the at least one first test case, wherein M is a positive integer, and the priority of the M first test cases is greater than the priority of the first test cases except the M first test cases.
In this embodiment, according to the historical test duration and the priority of each first test case in at least one first test case, it is determined that M first test cases are the test cases to be tested, so that the determined test cases to be tested are more suitable, and accuracy of regression testing of the target software is further improved.
In some embodiments, before the obtaining the priority of each of the at least one first test case, the method further includes:
obtaining failure rate of each first test case in multiple historical regression tests;
And determining the priority of the first test cases based on the failure rate of each first test case in the multi-round historical regression test, wherein the priority is positively correlated with the failure rate.
In this embodiment, the failure rate of each first test case in the historical multi-round test is determined as the priority, and since the first test case serving as the test case has a higher priority than other test cases, the first test case with a high failure rate can be determined as the test case, thereby further improving the accuracy of test regression of the target software.
In some embodiments, in the case where the total historical test duration is greater than the expected test duration, determining, based on the expected test duration, that a portion of the test cases in the test case library are test cases to be tested further includes:
determining at least one second test case in the test cases except the at least one first test case in the test case library according to the time difference between the expected test time and the total test failure time when the expected test time is longer than the total test failure time and is shorter than the total historical test time;
And determining the at least one first test case and the at least one second test case as test cases to be tested.
In this embodiment, when the expected test time period is longer than the total test failure time period and is shorter than the total historical test time period, all test cases (i.e., the at least one first test case) that fail to be tested in the test case library and part of test cases (i.e., the at least one second test case) that are tested successfully are determined as test cases to be tested, so that coverage comprehensiveness of the test cases can be improved, and accuracy of test regression of the target software can be further improved.
In some embodiments, the test cases except the at least one first test case in the test case library are distributed in N test case groups, where N is an integer greater than 1, and different test case groups are used to test different functional modules of the target software;
the determining at least one second test case in the test cases except the at least one first test case in the test case library comprises the following steps:
and determining at least one test case in each test case group of the N test case groups as at least one second test case.
In this embodiment, at least one test case in each test case group of the N test case groups is determined as the second test case, so that the determined test case to be tested can realize the test of each functional module, and the regression test of the target software is more accurate.
In some embodiments, the determining at least one test case in each of the N test case groups as at least one second test case includes:
acquiring expected test sub-duration and historical test duration of test cases in each test case group of the N test case groups, wherein the expected test sub-duration is the duration obtained by dividing the duration difference by the N;
and determining at least one test case in the test case group as at least one second test case based on the expected test sub-duration and the historical test duration of the test cases in each test case group.
In this embodiment, at least one test case in each test case group of the N test case groups is determined to be the second test case based on the expected test sub-time length, so that the determined second test case is distributed more uniformly in each test case group, and accuracy of regression test is further improved.
In some embodiments, the method further comprises:
and under the condition that the total time length of the historical test is smaller than or equal to the expected test time length, determining all the test cases in the test case library as the test cases to be tested.
In this embodiment, when the total duration of the historical test is less than or equal to the expected test duration, all the test cases in the test case library are determined to be the test cases, so that, when the time is enough, the regression test can be performed through all the test cases, and the accuracy of the regression test is optimal.
In some embodiments, the target software is software for a power domain controller.
In this embodiment, regression testing of the software of the power domain controller may be implemented.
In a second aspect, the present application further provides a regression testing apparatus, including:
the method comprises the steps that a time length acquisition module is used for responding to a regression test request of target software under the condition that the regression test request is received, acquiring the total historical test time length of a test case library and the expected test time length of the regression test request, wherein the test case library comprises a plurality of test cases, and the total historical test time length is the total time length consumed by testing the target software based on each test case in the test case library;
The first case determining module is used for determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration under the condition that the total historical test duration is greater than the expected test duration;
and the regression testing module is used for carrying out regression testing on the target software through the test case to be tested.
In the embodiment of the application, by acquiring the total historical test duration of the test case library and the expected test duration of the regression test request, under the condition that the total historical test duration is greater than the expected test duration, determining that part of the test cases in the test case library are to-be-tested test cases based on the expected test duration, and carrying out regression test on the target software through the to-be-tested test cases. Therefore, a reasonable number of test cases can be selected from the test case library according to the expected test duration to carry out regression test on the target software, so that the time consumption in the process of carrying out regression test on the target software is shortened.
In some embodiments, the historical test total duration includes a test failure total duration, where the test failure total duration is a total duration consumed by at least one first test case test in testing the target software based on the test case library, the first test case is a test case that fails to test, and the at least one first test case is a part of test cases in the test case library;
The first example determination module includes:
the first case determining unit is configured to determine that at least part of the test cases are test cases under test under the condition that the total test failure time length is greater than or equal to the expected test time length.
In this embodiment, when the total test failure duration is greater than or equal to the expected test duration and greater than or equal to the expected test duration, at least a portion of test cases that fail in the history are determined to be test cases, so that the determined test cases are easier to find errors in the regression test, and accuracy of the regression test is further improved.
In some embodiments, the first example determining unit includes:
the first acquisition subunit is used for acquiring the priority and the historical test duration of each first test case in the at least one first test case;
the first case determination subunit is configured to determine, in the at least one first test case, that M first test cases are to be tested cases based on a historical test duration and a priority of each first test case in the at least one first test case, where M is a positive integer, and the priority of the M first test cases is greater than the priority of the first test cases except for the M first test cases.
In this embodiment, according to the historical test duration and the priority of each first test case in at least one first test case, it is determined that M first test cases are the test cases to be tested, so that the determined test cases to be tested are more suitable, and accuracy of regression testing of the target software is further improved.
In some embodiments, the first example determining unit further includes:
the second acquisition subunit is used for acquiring the failure rate of each first test case in the multi-round historical regression test;
and the priority determining subunit is used for determining the priority of the first test case based on the failure rate of each first test case in the multi-round historical regression test, and the priority is positively related to the failure rate.
In this embodiment, the failure rate of each first test case in the historical multi-round test is determined as the priority, and since the first test case serving as the test case has a higher priority than other test cases, the first test case with a high failure rate can be determined as the test case, thereby further improving the accuracy of test regression of the target software.
In some embodiments, the first example determination module further includes:
The second case determining unit is used for determining at least one second test case in the test cases except the at least one first test case in the test case library according to the time difference between the expected test time and the total test failure time when the expected test time is longer than the total test failure time and is smaller than the total historical test time;
and the third case determining unit is used for determining the at least one first test case and the at least one second test case as test cases to be tested.
In this embodiment, when the expected test time period is longer than the total test failure time period and is shorter than the total historical test time period, all test cases (i.e., the at least one first test case) that fail to be tested in the test case library and part of test cases (i.e., the at least one second test case) that are tested successfully are determined as test cases to be tested, so that coverage comprehensiveness of the test cases can be improved, and accuracy of test regression of the target software can be further improved.
In some embodiments, the test cases except the at least one first test case in the test case library are distributed in N test case groups, where N is an integer greater than 1, and different test case groups are used to test different functional modules of the target software;
The second use case determining unit is specifically configured to:
and determining at least one test case in each test case group of the N test case groups as at least one second test case.
In this embodiment, at least one test case in each test case group of the N test case groups is determined as the second test case, so that the determined test case to be tested can realize the test of each functional module, and the regression test of the target software is more accurate.
In some embodiments, the second use case determining unit includes:
a third obtaining subunit, configured to obtain an expected test sub-duration and a historical test duration of a test case in each of the N test case groups, where the expected test sub-duration is a duration obtained by dividing the duration difference by the N;
and the second case determining subunit is configured to determine at least one test case in the test case group as at least one second test case based on the expected test sub-duration and the historical test duration of the test cases in each test case group.
In this embodiment, at least one test case in each test case group of the N test case groups is determined to be the second test case based on the expected test sub-time length, so that the determined second test case is distributed more uniformly in each test case group, and accuracy of regression test is further improved.
In some embodiments, the apparatus further comprises:
the second case determining module is configured to determine that all the test cases in the test case library are the test cases to be tested when the total duration of the historical test is less than or equal to the expected test duration.
In this embodiment, when the total duration of the historical test is less than or equal to the expected test duration, all the test cases in the test case library are determined to be the test cases, so that, when the time is enough, the regression test can be performed through all the test cases, and the accuracy of the regression test is optimal.
In some embodiments, the target software is software for a power domain controller.
In this embodiment, regression testing of the software of the power domain controller may be implemented.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions implementing the steps of the method as in the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method as in the first aspect.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
FIG. 1 is a flow chart of an embodiment of a regression testing method provided herein;
FIG. 2 is a schematic device diagram of an embodiment of a regression testing device provided herein; .
Fig. 3 is a schematic hardware structure of an embodiment of the electronic device provided in the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
Regression testing is typically required when software iterations (e.g., optimizations, deletions, or additions of software functions, etc.) occur. In the related art, the regression test is performed on the software by selecting all test cases from the test case library related to the software, and the number of test cases in the test case library is usually huge, so that the time for the regression test is long.
In order to shorten the time consumption in the regression testing process of software, the application provides a regression testing method, a regression testing device and electronic equipment.
Please refer to fig. 1, which is a schematic flow chart of a regression testing method provided in an embodiment of the present application, where the regression testing method is applied to an electronic device, and the electronic device may include a mobile phone, a tablet computer, a wearable device, a vehicle-mounted terminal, a server, or the like. As shown in fig. 1, the regression testing method at least includes the following steps 101 to 103.
And step 101, under the condition that a regression test request of the target software is received, responding to the regression test request, and acquiring the total historical test duration of the test case library and the expected test duration of the regression test request.
The target software may be any software that can be executed in the electronic device and realize the functions of the electronic device. For example, the target software may be a payment, instant chat, or browser, among others.
The regression test request may be received when the tester needs to perform a regression test on the target software, and may be generated according to an operation of the tester on the electronic device, for example, may be clicking a regression test control in a display interface of the electronic device, etc.; alternatively, the regression testing request may be a request sent to the electronic device by another device.
The Test Case library comprises a plurality of Test cases (Test cases), wherein the Test cases refer to descriptions of testing tasks of a specific software product, embody testing schemes, methods, technologies and strategies, and comprise testing targets, testing environments, input data, testing steps, expected results, testing scripts and the like, and finally form documents.
The total time length of the historical test is the total time length consumed by testing the target software based on each test case in the test case library. Specifically, the obtaining the total duration of the historical test of the test case library may include: acquiring historical test duration of each test case in the test case library in the history for testing the target software; and calculating the sum of the historical test time lengths of all the test cases in the test case library to obtain the total time length of the historical test.
The historical test duration of each test case can be recorded in the process that the electronic equipment tests the target software through the test case in history.
It should be noted that, in the case that the electronic device performs the excessive round-robin test on the target software through the test case in the history, the history test duration of the test case may be an average value of test durations in the multiple round regression test; alternatively, the test duration in the last round of regression test may be the same; alternatively, the test duration in each return test may be the same, and the historical test duration is the test duration in any return test.
The expected test duration may be carried in the regression test request, and the expected test duration may be preconfigured by a tester, or; the electronic device may also be calculated according to a historical test duration of the tester, for example, an average value of test durations of multiple historical regression tests before the current moment may be used as an expected test duration, and so on.
Step 102, under the condition that the total time length of the historical test is longer than the expected test time length, determining that part of test cases in the test case library are to-be-tested test cases based on the expected test time length.
In this embodiment of the present application, when the electronic device obtains the total historical test duration and the expected test duration, the electronic device compares the total historical test duration with the expected test duration to determine whether the total historical test duration is greater than the expected test duration.
The determining that a part of test cases in the test case library are test cases based on the expected test duration may be randomly selecting a part of test cases in the test case library as the test cases, where the test cases include at least one test case, and a sum of historical test durations of the test cases in the test cases is close to the expected test duration.
The sum of the historical test durations of the test cases in the test cases to be tested is close to the expected test duration, and the absolute value of the difference value of the two is smaller than or equal to the preset time tolerance t r The preset time tolerance can be set according to actual needs.
And 103, carrying out regression testing on the target software through the test case to be tested.
Under the condition that the electronic equipment determines the test cases to be tested, the electronic equipment can test the target software by adopting each test case in the test cases to be tested so as to realize regression testing of the target software.
In the embodiment of the application, the total historical test duration of the test case library and the expected test duration of the regression test request are obtained, and under the condition that the total historical test duration is greater than the expected test duration, partial test cases in the test case library are determined to be test cases based on the expected test duration, and regression test is conducted on the target software through the test cases. Therefore, a reasonable number of test cases can be selected from the test case library according to the expected test duration to carry out regression test on the target software, so that the time consumption in the process of carrying out regression test on the target software is shortened.
In some embodiments, the historical test total duration includes a test failure total duration, where the test failure total duration is a total duration consumed by at least one first test case test in testing the target software based on the test case library, the first test case is a test case that fails to test, and the at least one first test case is a portion of the test cases in the test case library.
Under the condition that the total time length of the historical test is longer than the expected test time length, determining that part of the test cases in the test case library are to-be-tested cases based on the expected test time length can include:
And under the condition that the total test failure duration is greater than or equal to the expected test duration, determining at least part of the test cases as test cases to be tested in at least one first test case.
In the embodiment, when the total test failure duration is greater than or equal to the expected test duration, at least part of test cases which fail in the history are determined to be test cases, so that the determined test cases to be tested are easier to find errors in the regression test, and the accuracy of the regression test is improved.
The first test case may be a test case in which a test failure occurs in at least one round of regression testing under the condition that multiple rounds of regression testing are performed in the history of the target software, or may also be a test case in which the number of times or probability of occurrence of the test failure is greater than a preset threshold.
The total test failure duration is the total duration consumed by the test of the at least one first test case, namely the total test failure duration is the sum of the historical test durations of the at least one first test case.
Under the condition that the total test failure duration is greater than or equal to the expected test duration, at least part of the test cases are determined to be the test cases to be tested in at least one first test case, and at least part of the test cases can be randomly selected from the at least one test cases to be the test cases to be tested.
In some embodiments, at least a portion of the test cases are determined to be test cases in at least one first test case:
acquiring the priority and the history test duration of each first test case in at least one first test case;
based on the historical test duration and the priority of each first test case in at least one first test case, M first test cases are determined to be test cases in the at least one first test case, M is a positive integer, and the priority of the M first test cases is greater than the priority of the first test cases except the M first test cases.
In the embodiment, the M first test cases are determined to be the test cases according to the historical test duration and the priority of each first test case in at least one first test case, so that the determined test cases are more suitable, and the accuracy of regression testing of the target software is further improved.
The priority of the first test case may be preconfigured, for example, in the case of building a test case, the electronic device may configure the priority for the built test case according to an instruction of a user, and so on.
In some embodiments, before the obtaining the priority of each first test case in the at least one first test case, the method further includes:
Obtaining failure rate of each first test case in multiple historical regression tests;
and determining the priority of each first test case based on the failure rate of each first test case in the multi-round historical regression test, wherein the priority is positively correlated with the failure rate.
In this embodiment, the failure rate of each first test case in the historical multi-round test is determined as the priority, and since the first test case serving as the test case has a higher priority than other test cases, the first test case with a high failure rate can be determined as the test case, thereby further improving the accuracy of test regression of the target software.
The obtaining the failure rate of each first test case in the multiple-round historical regression test may be that the electronic device obtains the identification information of the first test case in each round of historical regression test, where the identification information is used to indicate that the test of the first test case fails or succeeds, and compares the number of times that the identification information indicates that the test fails with the number of rounds of historical regression test, to obtain the failure rate of the first test case in the multiple-round historical number regression test.
The marking information can be obtained by marking each test case according to a test report in the historical regression test of the electronic equipment. For example, if the test report fails the test of the ith test case, the flag information of the ith test case may be set to 0; if the test report shows that the test of the ith test case is successful, the marking information of the ith test case can be set to be 1, and i is a positive integer.
The determining the priority of each first test case based on the failure rate of each first test case in the multi-round historical regression test may be sorting the first test cases according to the failure rate, where the serial numbers of the first test cases in the sorting are the priorities.
For example, the A first test cases in the test case library may be ranked according to the failure rate to obtain the ranked failure item test case set { TC } 1 ,TC 2 ,TC 3 ,TC 4 ,…,TC A And the serial numbers of the first test cases in the test case set of the failure item are the priorities.
Under the condition that the priority of the first test cases is determined based on the failure rate of each first test case in the multi-round historical regression test, the electronic equipment can determine M first test cases as test cases in at least one first test case.
For example, assume that the expected test time is T 0 The total time length of the history test is T total . The failure item test case set { TC ] is obtained after the sorting 1 ,TC 2 ,TC 3 ,TC 4 ,…,TC A The historical test time length of each first test case in the failure item test case set is { t }, in turn 1 ,t 2 ,t 3 ,t 4 ,…,t A In the case of { t }, if 1 ,t 2 ,t 3 ,t 4 ,…,t A Sum value (i.e. total duration of failure test) T 1 >T 0 The electronic device may select k first test cases in the failure item test case set as test cases to be tested, where the test cases are { TC } 1 ,TC 2 ,TC 3 ,TC 4 ,…,TC k And expects a test duration T 0 The following formula (1) is satisfied.
In some embodiments, in the case where the total duration of the historical test is greater than the expected test duration, determining, based on the expected test duration, that a portion of the test cases in the test case library are test cases, further includes:
under the condition that the expected test time length is longer than the total test failure time length and is shorter than the total historical test time length, determining at least one second test case in the test cases except the at least one first test case in the test case library according to the time length difference between the expected test time length and the total test failure time length;
and determining at least one first test case and at least one second test case as test cases to be tested.
In this embodiment, when the expected test time period is longer than the total test failure time period and is shorter than the total historical test time period, all test cases (i.e., the at least one first test case) and part of test cases (i.e., the at least one second test case) that are tested successfully in the test case library are determined as test cases to be tested, so that the coverage comprehensiveness of the test cases can be improved, and the accuracy of test regression of the target software can be further improved.
It should be noted that, the absolute value of the difference between the sum of the historical test durations of the at least one first test case and the at least one second test case and the expected test duration is less than or equal to the time tolerance.
According to the time difference between the expected test time and the total test failure time, at least one second test case is determined in the test cases except at least one first test case in the test case library, and the test cases which are tested successfully can be selected randomly as the second test cases according to the time difference and the historical test time of the test cases which are tested successfully.
In some embodiments, the test cases of the test case library other than the at least one first test case are distributed among N test case groups, where N is an integer greater than 1, and different test case groups are used for testing different functional modules of the target software.
The determining, in the test cases except the at least one first test case in the test case library, the at least one second test case may include:
and determining at least one test case in each test case group of the N test case groups as at least one second test case.
In this embodiment, at least one test case in each test case group of the N test case groups is determined as the second test case, so that the determined test case to be tested can realize the test of each functional module, and the regression test of the target software is more accurate.
At least one test case in each test case group of the N test case groups is determined as at least one second test case, and at least one test case may be randomly selected from each test case group of the N test case groups as the second test case.
In some embodiments, determining at least one test case in each of the N test case sets as at least one second test case includes:
acquiring expected test sub-duration and historical test duration of test cases in each of the N test case groups, wherein the expected test sub-duration is the duration obtained by dividing a duration difference by N;
and determining at least one test case in the test case group as at least one second test case based on the expected test sub-duration and the historical test duration of the test cases in each test case group.
In the embodiment, at least one test case in each test case group of the N test case groups is determined to be the second test case based on the expected test sub-time length, so that the determined second test case is distributed more uniformly in each test case group, and the accuracy of regression test is further improved.
The determining, based on the expected test sub-duration and the historical test durations of the test cases in each test case group, at least one test case in the test case group as at least one second test case may be that a sum of the historical test durations of the second test cases determined in each test case group is close to the expected test sub-duration, and a sum of the historical test durations of the second test cases determined in the N test case groups is close to the time difference.
For example, at T above 1 ≤T 0 <T total In the case of (C), the above time difference T s =T 0 -T 1 If the target software has x functional modules, that is, the test cases in the test case library are distributed in x test case groups, the expected test sub-duration is T ms =(T s /x). The electronic device can be according to T ms And the historical test duration of the test cases which are tested successfully in each test case group, and determining z second test cases { b) in the jth test case group j1 ,…,b jz J is an integer from 1 to x, z is a positive integer, i.e. the at least one second test case isAt this time, the test cases include test cases in B and test cases { t } 1 ,t 2 ,t 3 ,t 4 ,…,t A }。
In some embodiments, the method further comprises:
and under the condition that the total time length of the historical test is less than or equal to the expected test time length, determining all test cases in the test case library as test cases to be tested.
In the embodiment, when the total duration of the historical test is less than or equal to the expected test duration, all test cases in the test case library are determined to be test cases, so that regression test can be performed through all the test cases under the condition that the time is enough, and the accuracy of the regression test is optimal.
In some embodiments, the target software is software for the power domain controller, such that regression testing of the power domain controller software may be achieved.
The target software is software for a power domain controller, and the regression testing method can be realized through a regression testing tool HIL and the like.
Fig. 2 is a schematic structural diagram of a regression testing apparatus according to an embodiment of the present application. As shown in fig. 2, the regression testing apparatus 200 includes:
the duration obtaining module 201 is configured to, when receiving a regression test request of the target software, obtain, in response to the regression test request, a total historical test duration of a test case library and an expected test duration of the regression test request, where the test case library includes a plurality of test cases, and the total historical test duration is a total duration consumed for testing the target software based on each test case in the test case library;
The first case determining module 202 is configured to determine, based on the expected test duration, that a part of test cases in the test case library are to be test cases when the total historical test duration is greater than the expected test duration;
and the regression testing module 203 is used for carrying out regression testing on the target software through the test case to be tested.
In the embodiment of the application, the total historical test duration of the test case library and the expected test duration of the regression test request are obtained, and under the condition that the total historical test duration is greater than the expected test duration, partial test cases in the test case library are determined to be test cases based on the expected test duration, and regression test is conducted on the target software through the test cases. Therefore, a reasonable number of test cases can be selected from the test case library according to the expected test duration to carry out regression test on the target software, so that the time consumption in the process of carrying out regression test on the target software is shortened.
In some embodiments, the historical test total duration includes a test failure total duration, where the test failure total duration is a total duration consumed by at least one first test case test in testing the target software based on the test case library, the first test case is a test case that fails to test, and the at least one first test case is a portion of the test cases in the test case library.
The first use determination module 202 may include:
the first case determining unit is used for determining at least part of test cases as test cases to be tested in at least one first test case under the condition that the total test failure duration is greater than or equal to the expected test duration.
In the embodiment, when the total test failure duration is greater than or equal to the expected test duration, at least part of test cases which fail in the history are determined to be test cases, so that the determined test cases to be tested are easier to find errors in the regression test, and the accuracy of the regression test is improved.
In some embodiments, the first example determining unit includes:
the first acquisition subunit is used for acquiring the priority and the historical test duration of each first test case in at least one first test case;
the first case determination subunit is configured to determine, based on the historical test duration and the priority of each first test case in the at least one first test case, that M first test cases are to-be-tested cases, M is a positive integer, and the priority of the M first test cases is greater than the priority of the first test cases other than the M first test cases.
In the embodiment, the M first test cases are determined to be the test cases according to the historical test duration and the priority of each first test case in at least one first test case, so that the determined test cases are more suitable, and the accuracy of regression testing of the target software is further improved.
In some embodiments, the first example determining unit further includes:
the second acquisition subunit is used for acquiring the failure rate of each first test case in the multi-round historical regression test;
and the priority determining subunit is used for determining the priority of the first test case based on the failure rate of each first test case in the multi-round historical regression test, and the priority is positively related to the failure rate.
In this embodiment, the failure rate of each first test case in the historical multi-round test is determined as the priority, and since the first test case serving as the test case has a higher priority than other test cases, the first test case with a high failure rate can be determined as the test case, thereby further improving the accuracy of test regression of the target software.
In some embodiments, the first example determination module further comprises:
The second test case determining unit is used for determining at least one second test case in the test cases except the at least one first test case in the test case library according to the time difference between the expected test time and the total test time when the expected test time is longer than the total test failure time and is smaller than the total historical test time;
and the third case determining unit is used for determining at least one first test case and at least one second test case as test cases to be tested.
In this embodiment, when the expected test time period is longer than the total test failure time period and is shorter than the total historical test time period, all test cases (i.e., the at least one first test case) and part of test cases (i.e., the at least one second test case) that are tested successfully in the test case library are determined as test cases to be tested, so that the coverage comprehensiveness of the test cases can be improved, and the accuracy of test regression of the target software can be further improved.
In some embodiments, the test cases of the test case library other than the at least one first test case are distributed among N test case groups, where N is an integer greater than 1, and different test case groups are used for testing different functional modules of the target software.
The second use case determining unit is specifically configured to:
and determining at least one test case in each test case group of the N test case groups as at least one second test case.
In this embodiment, at least one test case in each test case group of the N test case groups is determined as the second test case, so that the determined test case to be tested can realize the test of each functional module, and the regression test of the target software is more accurate.
In some embodiments, the second use case determining unit includes:
the third obtaining subunit is configured to obtain an expected test sub-duration and a historical test duration of the test cases in each of the N test case groups, where the expected test sub-duration is a duration obtained by dividing a duration difference by N;
the second case determining subunit is configured to determine at least one test case in the test case group as at least one second test case based on the expected test sub-duration and the historical test duration of the test cases in each test case group.
In the embodiment, at least one test case in each test case group of the N test case groups is determined to be the second test case based on the expected test sub-time length, so that the determined second test case is distributed more uniformly in each test case group, and the accuracy of regression test is further improved.
In some embodiments, the apparatus 200 further comprises:
the second case determining module is used for determining that all test cases in the test case library are to-be-tested cases when the total time length of the historical test is smaller than or equal to the expected test time length.
In the embodiment, when the total duration of the historical test is less than or equal to the expected test duration, all test cases in the test case library are determined to be test cases, so that regression test can be performed through all the test cases under the condition that the time is enough, and the accuracy of the regression test is optimal.
In some embodiments, the target software is software for a power domain controller.
In this embodiment, regression testing of the software of the power domain controller may be implemented.
Other details of the regression testing apparatus according to the embodiment of the present application are similar to those of the regression testing method described above in connection with the example shown in fig. 1, and can achieve the corresponding technical effects, and for brevity, the description is omitted here.
Fig. 3 shows a schematic hardware structure of an electronic device according to an embodiment of the present application.
The electronic device may comprise a processor 301 and a memory 302 storing computer program instructions.
In particular, the processor 301 may include a central processing unit (Central Processing Unit, CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. In some examples, memory 302 may include removable or non-removable (or fixed) media, or memory 302 may be a non-volatile solid state memory. In some embodiments, the memory 302 may be internal or external to the battery device.
In some examples, memory 302 may be Read Only Memory (ROM). In one example, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
Memory 302 may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform the operations described with reference to methods in accordance with aspects of the present disclosure.
The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement the method in the embodiment shown in fig. 1, and achieves the corresponding technical effects achieved by executing the method/steps in the embodiment shown in fig. 1, which are not described herein for brevity.
In one example, the electronic device may also include a communication interface 303 and a bus 304. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected to each other by a bus 304 and perform communication with each other.
The communication interface 303 is mainly used to implement communication between each module, device, unit and/or apparatus in the embodiments of the present application.
Bus 304 includes hardware, software, or both, that couple the components of the online data flow billing device to each other. By way of example, and not limitation, the buses may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics Bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) Bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (Industry Standard Architecture, ISA) Bus, an infiniband interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a micro channel architecture (MCa) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a video electronics standards association local (VLB) Bus, or other suitable Bus, or a combination of two or more of the above. Bus 304 may include one or more buses, where appropriate. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
The electronic device can execute the regression testing method in the embodiment of the application, so that the regression testing method and the device thereof described in connection with fig. 1 and 2 are realized.
In addition, in combination with the regression testing method and the device thereof in the above embodiments, the embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium has stored thereon computer program instructions; the computer program instructions, when executed by the processor, implement the regression testing method of the above embodiments.
It should be clear that the present application is not limited to the particular arrangements and processes described above and illustrated in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be different from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus, devices, and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should 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 embodiments, and are intended to be included within the scope of the claims and description. In particular, the technical features mentioned in the respective embodiments may be combined in any manner as long as there is no structural conflict. The present application is not limited to the specific embodiments disclosed herein, but encompasses all technical solutions falling within the scope of the claims.

Claims (12)

1. A regression testing method, comprising:
under the condition that a regression test request of target software is received, responding to the regression test request, acquiring a historical test total time length of a test case library and an expected test time length of the regression test request, wherein the test case library comprises a plurality of test cases, and the historical test total time length is the total time length consumed by testing the target software based on each test case in the test case library;
Under the condition that the total historical test duration is longer than the expected test duration, determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration;
and carrying out regression testing on the target software through the test case to be tested.
2. The method of claim 1, wherein the historical test total time length comprises a test failure total time length, the test failure total time length being a total time length spent by at least one first test case test in testing the target software based on the test case library, the first test case being a test case that fails in test, the at least one first test case being a portion of test cases in the test case library;
under the condition that the total historical test duration is longer than the expected test duration, determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration comprises the following steps:
and under the condition that the total test failure time length is greater than or equal to the expected test time length, determining that at least part of the test cases are test cases in the at least one first test case.
3. The method of claim 2, wherein the determining, at the at least one first test case, that at least a portion of the test cases are test cases:
acquiring the priority and the historical test duration of each first test case in the at least one first test case;
based on the historical test duration and the priority of each first test case in the at least one first test case, determining M first test cases as the test cases in the at least one first test case, wherein M is a positive integer, and the priority of the M first test cases is greater than the priority of the first test cases except the M first test cases.
4. The method of claim 3, wherein prior to obtaining the priority of each of the at least one first test case, further comprising:
obtaining failure rate of each first test case in multiple historical regression tests;
and determining the priority of the first test cases based on the failure rate of each first test case in the multi-round historical regression test, wherein the priority is positively correlated with the failure rate.
5. The method of claim 2, wherein the determining that a portion of the test cases in the test case library are test cases to be tested based on the expected test duration if the historical test total duration is greater than the expected test duration, further comprises:
determining at least one second test case in the test cases except the at least one first test case in the test case library according to the time difference between the expected test time and the total test failure time when the expected test time is longer than the total test failure time and is shorter than the total historical test time;
and determining the at least one first test case and the at least one second test case as test cases to be tested.
6. The method of claim 5, wherein the test cases of the test case library other than the at least one first test case are distributed among N test case groups, N being an integer greater than 1, different test case groups being used to test different functional modules of the target software;
the determining at least one second test case in the test cases except the at least one first test case in the test case library comprises the following steps:
And determining at least one test case in each test case group of the N test case groups as at least one second test case.
7. The method of claim 6, wherein the determining at least one test case in each of the N test case groups as at least one second test case comprises:
acquiring expected test sub-duration and historical test duration of test cases in each test case group of the N test case groups, wherein the expected test sub-duration is the duration obtained by dividing the duration difference by the N;
and determining at least one test case in the test case group as at least one second test case based on the expected test sub-duration and the historical test duration of the test cases in each test case group.
8. The method according to claim 1, wherein the method further comprises:
and under the condition that the total time length of the historical test is smaller than or equal to the expected test time length, determining all the test cases in the test case library as the test cases to be tested.
9. The method of claim 1, wherein the target software is software for a power domain controller.
10. A regression testing apparatus, comprising:
the method comprises the steps that a time length acquisition module is used for responding to a regression test request of target software under the condition that the regression test request is received, acquiring the total historical test time length of a test case library and the expected test time length of the regression test request, wherein the test case library comprises a plurality of test cases, and the total historical test time length is the total time length consumed by testing the target software based on each test case in the test case library;
the first case determining module is used for determining that part of the test cases in the test case library are test cases to be tested based on the expected test duration under the condition that the total historical test duration is greater than the expected test duration;
and the regression testing module is used for carrying out regression testing on the target software through the test case to be tested.
11. An electronic device comprising a processor, a memory and a program or instruction 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-9.
12. A readable storage medium, characterized in that it has stored thereon a program or instructions which, when executed by a processor, implement the steps of the regression testing method according to any one of claims 1-9.
CN202211242858.XA 2022-10-11 2022-10-11 Regression testing method and device and electronic equipment Pending CN117873854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211242858.XA CN117873854A (en) 2022-10-11 2022-10-11 Regression testing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211242858.XA CN117873854A (en) 2022-10-11 2022-10-11 Regression testing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117873854A true CN117873854A (en) 2024-04-12

Family

ID=90581685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211242858.XA Pending CN117873854A (en) 2022-10-11 2022-10-11 Regression testing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117873854A (en)

Similar Documents

Publication Publication Date Title
US11108247B2 (en) Method, apparatus, device and medium for equalization control of battery packs
CN113918376B (en) Fault detection method, device, equipment and computer readable storage medium
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN105243042A (en) Data burning method and data burning apparatus
CN117192383B (en) Method, device, equipment and medium for determining service life of battery
CN109951838B (en) Method, device, equipment and medium for identifying double-card-slot and double-card user
CN117873854A (en) Regression testing method and device and electronic equipment
CN109639526A (en) Network Data Control method, apparatus, equipment and medium
CN114425787B (en) Control method and device for robot automatic test, server and storage medium
CN115225170A (en) Method and device for testing shielding effect of shielding device
CN108269004B (en) Product life analysis method and terminal equipment
CN113296996A (en) Service request processing method, related device and storage medium
CN108064069B (en) Method, medium and device for determining unique identifier of WiFi sub-network
CN115151832A (en) Battery state estimation method, device, equipment, battery system and storage medium
CN115576821B (en) Verification method and device, electronic equipment and storage medium
CN110557223A (en) Detection method and terminal for Physical Downlink Control Channel (PDCCH)
CN113496288B (en) User stability determining method, device, equipment and storage medium
CN115906189A (en) Model verification method, device, equipment and computer readable storage medium
CN115277352B (en) Network element instruction error correction method and device, electronic equipment and computer storage medium
CN118227355A (en) Periodic deviation positioning method, device, equipment, medium and vehicle
CN114547101B (en) Data quality evaluation method, device, equipment and storage medium for data center
CN114035996A (en) Problem positioning method, device, equipment and readable storage medium
CN112732322A (en) Data verification method and device, electronic equipment and computer storage medium
CN117917640A (en) Vehicle testing method, device, equipment and storage medium
CN116359728A (en) Service life assessment method, device and equipment of motor stator insulation system

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