CN111858288A - Test case optimization method, device and equipment and computer readable storage medium - Google Patents

Test case optimization method, device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN111858288A
CN111858288A CN201910349300.3A CN201910349300A CN111858288A CN 111858288 A CN111858288 A CN 111858288A CN 201910349300 A CN201910349300 A CN 201910349300A CN 111858288 A CN111858288 A CN 111858288A
Authority
CN
China
Prior art keywords
test
test case
application software
tested
code
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
CN201910349300.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.)
Shenzhen Sinosun Technology Co ltd
Original Assignee
Shenzhen Sinosun Technology 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 Shenzhen Sinosun Technology Co ltd filed Critical Shenzhen Sinosun Technology Co ltd
Priority to CN201910349300.3A priority Critical patent/CN111858288A/en
Publication of CN111858288A publication Critical patent/CN111858288A/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

Abstract

The invention discloses a test case optimization method, a device, equipment and a computer readable storage medium, wherein the test case optimization method comprises the following steps: when detecting that the application software carries out software testing, acquiring a code to be tested in the application software and each first test case corresponding to the application software; sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case; and if the first test cases have repeated test cases, deleting the repeated test cases. The technical problem that the efficiency of executing the test cases is continuously reduced along with the increase of the redundancy in the prior art is solved.

Description

Test case optimization method, device and equipment and computer readable storage medium
Technical Field
The invention relates to the technical field of software testing, in particular to a test case optimization method, a test case optimization device, test case optimization equipment and a computer-readable storage medium.
Background
Software testing is an indispensable important link in software engineering, and plays an important role in ensuring the correctness, integrity, safety and software quality of software. For a long time, the test cases of the software test are generally designed manually by a tester, then input programs are run, and comparison is carried out to determine whether the execution results are consistent with the expected results, so that the designed test cases have strong pertinence. With the increasing of software development functions, the number of test cases and the redundancy amount are also increased, so that the cost for maintaining the test cases is increased continuously, and the efficiency for executing the test cases is also reduced continuously with the increase of the redundancy amount. Therefore, how to improve the execution efficiency of the test case becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a test case optimization method, a test case optimization device, test case optimization equipment and a computer readable storage medium, and aims to solve the technical problem that the efficiency of executing test cases in the prior art is continuously reduced along with the increase of redundancy.
In order to achieve the above object, the present invention provides a test case optimization method, device, apparatus and computer-readable storage medium, wherein the test case optimization method includes:
when detecting that the application software carries out software testing, acquiring a code to be tested in the application software and each first test case corresponding to the application software;
sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case;
and if the first test cases have repeated test cases, deleting the repeated test cases.
Optionally, the step of sequentially applying each first test case to the code to be tested for testing, and detecting whether there is a repeated test case in each first test case includes:
determining a current test case in each first test case, and applying the current test case to the code to be tested for testing to obtain first test data corresponding to the current test case;
Acquiring historical record data corresponding to the application software, acquiring historical test data when each historical test case is applied to the code to be tested for testing from the historical record data, and comparing the first test data with each historical test data;
and if the historical test data is the same as the first test data, the first test case is a repeated test case.
Optionally, the historical test data includes a second execution order, the first test data includes a first execution order,
the step of comparing the first test data with each of the historical test data includes:
acquiring a first execution sequence of the first test case running in the code to be tested and a second execution sequence of each historical test case running in the code to be tested;
and comparing the first execution sequence with each second execution sequence, wherein if the second execution sequence is the same as the first execution sequence, the historical test data is the same as the first test data.
Optionally, the historical test data further includes a second number of execution lines, the first test data further includes a first number of execution lines,
If the first execution sequence is the same as the second execution sequence, the step of the historical test data and the first test case data comprises the following steps:
if the first execution sequence is the same as the second execution sequence, acquiring a first execution line number of the first test case running in the code to be tested and a second execution line number of each historical test case running in the code to be tested;
and comparing the first execution line number with each second execution line number, wherein if the second execution line number is the same as the first execution line number, the historical test data is the same as the first test data.
Optionally, the step of acquiring the code to be tested in the application software and each first test case corresponding to the application software when it is detected that the application software performs a software test includes:
when detecting that the application software is subjected to software testing, acquiring login account information in the application software, and comparing the login account information with preset account information in the application software;
and if the login account information is the same as the preset account information, acquiring the code to be tested in the application software and each first test case corresponding to the application software.
Optionally, after the step of comparing the login account information with the preset account information in the application software, the method includes:
and if the login account information is different from the preset account information, stopping the software testing of the application software, and outputting prompt information to remind a user that the software testing can be carried out only when the user needs to acquire the authority.
Optionally, after the step of detecting whether there is a repeated test case in each of the first test cases, the method includes:
and if the repeated test cases do not exist in the first test cases, storing the first test cases in historical record data corresponding to the application software.
In addition, to achieve the above object, the present invention further provides a test case optimization apparatus, including:
the system comprises an acquisition module, a test module and a test module, wherein the acquisition module is used for acquiring a code to be tested in application software and each first test case corresponding to the application software when detecting that the application software is subjected to software test;
the detection module is used for sequentially applying each first test case to the code to be tested for testing and detecting whether a repeated test case exists in each first test case;
And the optimization module is used for deleting the repeated test cases if the repeated test cases exist in the first test cases.
In addition, in order to realize the purpose, the invention also provides test case optimization equipment;
the test case optimization device comprises: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the computer program, when executed by the processor, implements the steps of the test case optimization method described above.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium;
the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the test case optimization method as described above.
According to the test case optimization method, the test case optimization device, the test case optimization equipment and the computer readable storage medium, when software test of application software is detected, a code to be tested in the application software and each first test case corresponding to the application software are obtained; sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case; and if the first test cases have repeated test cases, deleting the repeated test cases. When the application software is tested, the existence of the repeated test cases is determined in each first test case, and the repeated test cases are optimized, so that the redundancy of the test cases is reduced, the maintenance cost is reduced when the test cases are subsequently maintained, and each optimized first test case can be directly adopted when the application software is tested next time, so that the time cost is saved for software testing, the execution efficiency of the test cases is improved, and the technical problem that the efficiency of executing the test cases in the prior art is continuously reduced along with the increase of redundancy is solved.
Drawings
FIG. 1 is a schematic diagram of a terminal \ device structure of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a test case optimization method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a test case optimization method according to a second embodiment of the present invention;
fig. 4 is a schematic system structure diagram of an embodiment of the test case optimization device of the present invention.
The objects, features and advantages of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention is test case optimization equipment.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that turns off the display screen and/or the backlight when the terminal device is moved to the ear. Of course, the terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test case optimization program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke the test case optimizer stored in the memory 1005 and perform the following operations:
When detecting that the application software carries out software testing, acquiring a code to be tested in the application software and each first test case corresponding to the application software;
sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case;
and if the first test cases have repeated test cases, deleting the repeated test cases.
The invention provides a test case optimization method, in a first embodiment of the test case optimization method, referring to fig. 2, the test case optimization method comprises the following steps:
step S10, when detecting that the application software carries out software test, acquiring a code to be tested in the application software and each first test case corresponding to the application software;
software testing may be the process of operating a program under specified conditions to discover bugs, to measure software quality, and to evaluate whether it meets design requirements. The code to be tested may be program code in the application software that needs to be tested. A test case may be a set of test inputs, execution conditions, and expected results tailored for a particular purpose to test a certain program path or verify that a certain specific requirement is met. The first test case may be a test case to be applied when the application software performs software testing.
When detecting that a certain application software needs to be subjected to software testing, the application software needs to be analyzed first, a testing strategy is determined, and a testing plan is made. And after the test plan is approved, acquiring each first test case required to be used when the application software is tested. The method for obtaining the first test case may be that a user designs the first test case according to the test requirements and the test strategy, that is, when the pressure of the test progress is not large, the design should be detailed, and if the pressure of the progress and the cost is large, the test case should be ensured to cover the critical test requirements. In this embodiment, when it is detected that the application software needs to be subjected to a software test, a code to be tested in the application software needs to be acquired according to a requirement of the software test, and each first test case that needs to be applied when the application software is subjected to the software test is determined according to the code to be tested.
Step S20, sequentially applying each first test case to the code to be tested to perform software test, and detecting whether a repeated test case exists in each first test case;
the repeated test cases may be two or more first test cases with the same execution sequence and the same number of rows in the code to be tested, and then the first test cases are the repeated test cases. When the code to be tested and each first test case of the application software are determined, each first test case needs to be sequentially applied to the code to be tested for software testing, and whether a repeated test case exists in each first test case needs to be detected. That is, when a first test case is executed to perform software testing on the application software, the code execution sequence and the line number of the application software program are automatically recorded, and the code execution sequence and the line number of the application software program may be recorded by using an ASM + bytecodenoulli outline (ASM bytecode outline) method. When the execution sequence and the number of rows of the tested program codes with two first test cases are detected to be the same, the two first test cases can be regarded as the repeated test cases.
To assist understanding of detecting whether there is a duplicate test case in each first test case, the following description is given by way of example.
For example, taking testing a Java program as an example, the test case is as follows:
case 1, inputting a number 0 and returning whether the number is 0;
case2, input number 1, return whether 1;
case3, input number 2, return whether 1;
case4 inputs the number 10 and returns whether it is 1.
The test cases are executed and the code execution sequence and the number of lines are recorded as follows:
case1 test-like Test method 4->5->6 lines Is normal
case2 Tes type test method 4->5->8->Line 10 Is normal
case3 Test type Test method 4->5->8->Line 10 Same as case2 procedure
case4 Test type Test method 4->5->8->Line 10 Same as case2 procedure
It can be seen that the code execution sequence and the number of rows of the cases 2, 3, 4 are the same, and at this time, it can be determined that the cases 2, 3, 4 are all duplicate test cases.
And step S30, if the repeated test cases exist in the first test cases, deleting the repeated test cases.
When the repeated test cases exist in the first test cases through judgment, the repeated test cases need to be optimized, and the optimization method can be that only one test case in the repeated test cases is reserved, and other test cases are deleted, or the repeated test cases are marked to remind a user of the existence of the repeated test cases. And after each repeated test case is optimized, each optimized first test case can be directly reserved.
In addition, to assist in understanding the optimization of test cases, the following examples are provided. For example, when the test case 1 is executed, the code execution sequence of the test case 1 in the tested software program is recorded into a log or a database; and comparing the data corresponding to the test case 1 with the data corresponding to other cases during testing in a log or a database, and if the data are the same, marking the data as a repeated case to prompt a user, or directly carrying out optimized deletion.
In this embodiment, when detecting that application software performs software testing, acquiring a code to be tested in the application software and each first test case corresponding to the application software; sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case; and if the first test cases have repeated test cases, deleting the repeated test cases. When the application software is tested, the existence of the repeated test cases is determined in each first test case, and the repeated test cases are optimized, so that the redundancy of the test cases is reduced, the maintenance cost is reduced when the test cases are subsequently maintained, and each optimized first test case can be directly adopted when the application software is tested next time, so that the time cost is saved for software testing, the execution efficiency of the test cases is improved, and the technical problem that the efficiency of executing the test cases in the prior art is continuously reduced along with the increase of redundancy is solved.
Further, on the basis of the first embodiment of the present invention, a second embodiment of the test case optimization method of the present invention is provided, where this embodiment is step S20 of the first embodiment of the present invention, and the step of sequentially applying each first test case to the code to be tested to perform a test, and detecting whether there is a repeated test case in each first test case is detailed, with reference to fig. 3, including:
step S21, determining a current test case in each of the first test cases, and applying the current test case to the code to be tested for testing to obtain first test data corresponding to the current test case;
the current test case may be the first test case that is being tested at the current time. Determining the current test case which needs to be used at the current moment in each first test case, applying the current test case to the code to be tested for testing, and then acquiring the test data during testing
Step S22, obtaining historical record data corresponding to the application software, obtaining historical test data when each historical test case is applied to the code to be tested for testing from the historical record data, and comparing the first test data with each historical test data;
The historical data may be each record data, such as a test case, a code to be tested, and the like, which is reserved when the application software is tested before the current time. It should be noted that, in this embodiment, after each test is performed by using one first test case, the related data of the first test case during the test needs to be stored in the history data. After the test data corresponding to the first test case is acquired, historical record data corresponding to application software also needs to be acquired, and historical test data of the historical test software applied to the code to be tested is acquired from the historical record data. However, if it is determined that the historical test data is the same as the first test data, the first test case may be considered as a repeated test case.
Step S23, if the historical test data is the same as the first test data, the first test case is a repeated test case.
And when the historical test data is judged to be the same as the first test data, taking the first test data and the historical test data as the repeated test cases, and marking the repeated test cases.
In this embodiment, the first test data corresponding to the current test case is compared with the historical test data in the historical record data, and when the first test case is found to be the same as the historical test data, the first test case can be determined to be a repeated test case, so that the accuracy of determining the repeated test case is improved.
Specifically, the step of comparing the first test data with each of the historical test data includes:
step a, acquiring a first execution sequence of the first test case running in the code to be tested and a second execution sequence of each historical test case running in the code to be tested;
it should be noted that, in this embodiment, the historical test data includes the second execution order, and the first test data includes the first execution order.
The first execution sequence may be an execution sequence in which the code to be tested runs when the first test case is applied to the code to be tested. The second execution sequence may be an execution sequence in which the code to be tested runs when the historical test cases are applied to the code to be tested. When determining whether the first test case is a repeated test case, it is necessary to obtain a first execution sequence of the running of the code to be tested when the first test case runs in the code to be tested, and a second execution sequence of the running of the code to be tested when each historical test case runs in the code to be tested, that is, the second execution sequence is multiple.
And b, comparing the first execution sequence with each second execution sequence, wherein if the second execution sequence is the same as the first execution sequence, the historical test data is the same as the first test data.
And then comparing the first execution sequence with each second execution sequence, and when the second execution sequence is found to be the same as the first execution sequence, considering that the historical test data is the same as the first test data, that is, determining that the first test case is a repeated test case.
In this embodiment, by comparing the first execution sequence with each second execution sequence, when the second execution sequence is found to be the same as the first execution sequence, the historical test data is determined to be the same as the first test data, so that the first test case is further determined to be the repeated test case, and the accuracy of determining the repeated test case is improved.
Specifically, if the first execution sequence is the same as the second execution sequence, the step of generating the historical test data and the first test case data includes:
b1, if the first execution sequence is the same as the second execution sequence, obtaining a first execution line number of the first test case running in the code to be tested and a second execution line number of each historical test case running in the code to be tested;
It should be noted that, in this embodiment, the historical test data includes the second number of execution lines, and the first test data includes the first number of execution lines.
The first execution line number may be a line number of the code to be tested when the first test case is applied to the code to be tested. The second execution line number may be a line number of the code to be tested when the historical test case is applied to the code to be tested. When the first execution sequence and the second execution sequence are found to be the same through judgment, a first execution line number of the first test case running in the code to be tested and a second execution line number of each historical test case running in the code to be tested are also required to be obtained.
Step b2, comparing the first execution line number with each second execution line number, and if the second execution line number is the same as the first execution line number, the historical test data is the same as the first test data.
And comparing the first execution line number with each second execution line number in sequence, and when the second execution line number is the same as the first execution line number after judgment, considering that the historical test data is the same as the first test data, namely that the repeated test case exists. However, when it is determined that the second number of execution lines is not the same as the first number of execution lines, the historical test data may be considered to be different from the first test data.
In this embodiment, when the first execution sequence is the same as the second execution sequence, the first execution line number is compared with each second execution line number, and when it is determined that the second execution line number is the same as the first execution line number, it may be further determined that the historical test data is the same as the first test data, so that the first test case may be determined to be a repeated test case, and accuracy of determining the repeated test case is improved.
Further, on the basis of any one of the first to second embodiments of the present invention, a third embodiment of the test case optimization method of the present invention is provided, where in step S10 of the first embodiment of the present invention, when detecting that the application software performs a software test, the step of acquiring the code to be tested in the application software and each first test case corresponding to the software test includes:
step d, when detecting that the application software is subjected to software testing, acquiring login account information in the application software, and comparing the login account information with preset account information in the application software;
the login account information may be account information of the user logged in the application software at the current time. The preset account information may be account information set in advance by a user, where the preset account information may be one account information or multiple account information. When detecting that the application software needs to be subjected to software testing, login account information in the application software needs to be acquired, the login account information is compared with preset account information in the application software, and when the login account information is judged to be matched with the preset account information, it can be determined that the login account can be used for carrying out software testing on the application software. However, when the login account information is judged to be not matched with the preset account information, the software test of the application software is stopped.
And e, if the login account information is the same as the preset account information, acquiring the code to be tested in the application software and each first test case corresponding to the application software.
When the login account information is found to be the same as the preset account information through judgment, it can be determined that the login account can perform software testing on the application software, and at the moment, the code to be tested in the application software and each first test case to be applied when the application software performs software testing can be obtained.
In this embodiment, by comparing the login account information with the preset account information, when it is determined that the login account information is the same as the preset account information, the application software can be subjected to software testing, so that the safety of the software testing is ensured.
Specifically, after the step of comparing the login account information with the preset account information in the application software, the method includes:
and f, if the login account information is different from the preset account information, stopping the software test of the application software, and outputting prompt information to remind a user that the software test can be carried out only when the user needs to acquire the authority.
And when the login account information is judged to be different from the preset account information, stopping the software test of the application software, and outputting prompt information to remind a user that the software test can be carried out only when the user needs to acquire the relevant authority.
In this embodiment, when it is determined that the login account information is different from the preset account information, the software test of the application software can be stopped, so that a non-professional person can be prevented from performing the software test on the application software, and the safety and the accuracy of the software test are improved.
Further, after the step of detecting whether there is a repeated test case in each of the first test cases, the method includes:
and g, if the repeated test cases do not exist in the first test cases, storing the first test cases in historical record data corresponding to the application software.
When the repeated test cases do not exist in each first test case, the repeated test cases are judged and found, and each first test case can be directly stored in the historical record data corresponding to the application software, so that the first test cases can be directly adopted when the application software carries out software test next time.
In this embodiment, when it is determined that there is no repeated test case in each first test case, each first test case may be directly saved in the history data, so that the first test cases may be directly adopted when the application software performs software test next time, and the test efficiency is improved when the application software performs software test next time.
In addition, referring to fig. 4, an embodiment of the present invention further provides a test case optimization device, where the test case optimization device includes:
the system comprises an acquisition module, a test module and a test module, wherein the acquisition module is used for acquiring a code to be tested in application software and each first test case corresponding to the application software when detecting that the application software is subjected to software test;
the detection module is used for sequentially applying each first test case to the code to be tested for testing and detecting whether a repeated test case exists in each first test case;
and the optimization module is used for deleting the repeated test cases if the repeated test cases exist in the first test cases.
Optionally, the detection module is further configured to:
determining a current test case in each first test case, and applying the current test case to the code to be tested for testing to obtain first test data corresponding to the current test case;
acquiring historical record data corresponding to the application software, acquiring historical test data when each historical test case is applied to the code to be tested for testing from the historical record data, and comparing the first test data with each historical test data;
And if the historical test data is the same as the first test data, the first test case is a repeated test case.
Optionally, the historical test data includes a second execution order, the first test data includes a first execution order, and the detection module is further configured to:
acquiring a first execution sequence of the first test case running in the code to be tested and a second execution sequence of each historical test case running in the code to be tested;
and comparing the first execution sequence with each second execution sequence, wherein if the second execution sequence is the same as the first execution sequence, the historical test data is the same as the first test data.
Optionally, the historical test data further includes a second number of execution lines, the first test data further includes a first number of execution lines, and the detection module is further configured to:
if the first execution sequence is the same as the second execution sequence, acquiring a first execution line number of the first test case running in the code to be tested and a second execution line number of each historical test case running in the code to be tested;
And comparing the first execution line number with each second execution line number, wherein if the second execution line number is the same as the first execution line number, the historical test data is the same as the first test data.
Optionally, the obtaining module is further configured to:
when detecting that the application software is subjected to software testing, acquiring login account information in the application software, and comparing the login account information with preset account information in the application software;
and if the login account information is the same as the preset account information, acquiring the code to be tested in the application software and each first test case corresponding to the application software.
Optionally, the obtaining module is further configured to:
and if the login account information is different from the preset account information, stopping the software testing of the application software, and outputting prompt information to remind a user that the software testing can be carried out only when the user needs to acquire the authority.
Optionally, the test case optimizing apparatus further includes:
and if the repeated test cases do not exist in the first test cases, storing the first test cases in historical record data corresponding to the application software.
The steps implemented by each functional module of the test case optimization device may refer to each embodiment of the test case optimization method of the present invention, and are not described herein again.
The present invention also provides a terminal, including: a memory, a processor, a communication bus, and a test case optimizer stored on the memory:
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the test case optimization program to realize the steps of the test case optimization method.
The present invention also provides a computer-readable storage medium storing one or more programs, which are further executable by one or more processors for implementing the steps of the embodiments of the test case optimization method described above.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the test case optimization method described above, and is not described herein again.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A test case optimization method is characterized by comprising the following steps:
when detecting that the application software carries out software testing, acquiring a code to be tested in the application software and each first test case corresponding to the application software;
sequentially applying each first test case to the code to be tested for testing, and detecting whether a repeated test case exists in each first test case;
and if the first test cases have repeated test cases, deleting the repeated test cases.
2. The method according to claim 1, wherein the step of sequentially applying each of the first test cases to the code to be tested for testing and detecting whether there is a repeated test case in each of the first test cases comprises:
determining a current test case in each first test case, and applying the current test case to the code to be tested for testing to obtain first test data corresponding to the current test case;
acquiring historical record data corresponding to the application software, acquiring historical test data when each historical test case is applied to the code to be tested for testing from the historical record data, and comparing the first test data with each historical test data;
And if the historical test data is the same as the first test data, the first test case is a repeated test case.
3. The test case optimization method of claim 2, wherein the historical test data comprises a second execution order, the first test data comprises a first execution order,
the step of comparing the first test data with each of the historical test data includes:
acquiring a first execution sequence of the first test case running in the code to be tested and a second execution sequence of each historical test case running in the code to be tested;
and comparing the first execution sequence with each second execution sequence, wherein if the second execution sequence is the same as the first execution sequence, the historical test data is the same as the first test data.
4. The test case optimization method of claim 3, wherein the historical test data further comprises a second number of execution lines, the first test data further comprises a first number of execution lines,
if the first execution sequence is the same as the second execution sequence, the step of the historical test data and the first test case data comprises the following steps:
If the first execution sequence is the same as the second execution sequence, acquiring a first execution line number of the first test case running in the code to be tested and a second execution line number of each historical test case running in the code to be tested;
and comparing the first execution line number with each second execution line number, wherein if the second execution line number is the same as the first execution line number, the historical test data is the same as the first test data.
5. The method for optimizing test cases according to claim 1, wherein the step of acquiring the code to be tested in the application software and each first test case corresponding to the application software when detecting that the application software performs a software test includes:
when detecting that the application software is subjected to software testing, acquiring login account information in the application software, and comparing the login account information with preset account information in the application software;
and if the login account information is the same as the preset account information, acquiring the code to be tested in the application software and each first test case corresponding to the application software.
6. The test case optimization method according to claim 5, wherein after the step of comparing the login account information with the preset account information in the application software, the method comprises:
and if the login account information is different from the preset account information, stopping the software testing of the application software, and outputting prompt information to remind a user that the software testing can be carried out only when the user needs to acquire the authority.
7. The method for optimizing test cases according to claim 1, wherein after the step of detecting whether there is a duplicate test case in each of the first test cases, the method comprises:
and if the repeated test cases do not exist in the first test cases, storing the first test cases in historical record data corresponding to the application software.
8. A test case optimization device, comprising:
the system comprises an acquisition module, a test module and a test module, wherein the acquisition module is used for acquiring a code to be tested in application software and each first test case corresponding to the application software when detecting that the application software is subjected to software test;
the detection module is used for sequentially applying each first test case to the code to be tested for testing and detecting whether a repeated test case exists in each first test case;
And the optimization module is used for deleting the repeated test cases if the repeated test cases exist in the first test cases.
9. A test case optimization device, comprising: a memory, a processor, and a test case optimization program stored on the memory and executable on the processor, the test case optimization program when executed by the processor implementing the steps of the test case optimization method of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a test case optimization program which, when executed by a processor, implements the steps of the test case optimization method of any one of claims 1 to 7.
CN201910349300.3A 2019-04-25 2019-04-25 Test case optimization method, device and equipment and computer readable storage medium Pending CN111858288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910349300.3A CN111858288A (en) 2019-04-25 2019-04-25 Test case optimization method, device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910349300.3A CN111858288A (en) 2019-04-25 2019-04-25 Test case optimization method, device and equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111858288A true CN111858288A (en) 2020-10-30

Family

ID=72966103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910349300.3A Pending CN111858288A (en) 2019-04-25 2019-04-25 Test case optimization method, device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111858288A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11841790B2 (en) * 2020-12-01 2023-12-12 T-Mobile Usa, Inc. Adaptive automated testing methods and systems

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245264A1 (en) * 2013-02-28 2014-08-28 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
CN106959920A (en) * 2016-01-12 2017-07-18 维布络有限公司 The method and system optimized to the protos test suite PROTOS comprising multiple test cases
CN107622007A (en) * 2016-07-14 2018-01-23 北京京东尚科信息技术有限公司 Application testing method and device
CN107832228A (en) * 2017-11-29 2018-03-23 北京锐安科技有限公司 A kind of test case reduction method, device, equipment and storage medium
CN107894952A (en) * 2017-11-08 2018-04-10 中国平安人寿保险股份有限公司 Generation method, device, equipment and the readable storage medium storing program for executing of interface testing use-case
CN108255738A (en) * 2018-04-09 2018-07-06 平安普惠企业管理有限公司 Automated testing method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245264A1 (en) * 2013-02-28 2014-08-28 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
CN106959920A (en) * 2016-01-12 2017-07-18 维布络有限公司 The method and system optimized to the protos test suite PROTOS comprising multiple test cases
CN107622007A (en) * 2016-07-14 2018-01-23 北京京东尚科信息技术有限公司 Application testing method and device
CN107894952A (en) * 2017-11-08 2018-04-10 中国平安人寿保险股份有限公司 Generation method, device, equipment and the readable storage medium storing program for executing of interface testing use-case
CN107832228A (en) * 2017-11-29 2018-03-23 北京锐安科技有限公司 A kind of test case reduction method, device, equipment and storage medium
CN108255738A (en) * 2018-04-09 2018-07-06 平安普惠企业管理有限公司 Automated testing method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11841790B2 (en) * 2020-12-01 2023-12-12 T-Mobile Usa, Inc. Adaptive automated testing methods and systems

Similar Documents

Publication Publication Date Title
CN109684847B (en) Automatic repairing method, device, equipment and storage medium for script loopholes
CN106326116B (en) The method and apparatus of product test
CN108959067B (en) Method and device for testing search engine and computer readable storage medium
CN111045944A (en) Regression testing method, device and system and computer readable storage medium
CN107678948B (en) Test case generation method, terminal and storage medium
CN111475401A (en) Test method and related equipment
CN112052169A (en) Test management method, system, device and computer readable storage medium
CN113448862B (en) Software version testing method and device and computer equipment
CN111090592A (en) Automatic testing method of buried point, terminal and readable storage medium
US10783067B2 (en) Software quality determination apparatus, software quality determination method, and software quality determination program
US20170161181A1 (en) Testing support system, and testing support method
CN111858288A (en) Test case optimization method, device and equipment and computer readable storage medium
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN108829575B (en) Test case recommendation method, electronic device and readable storage medium
CN111061637B (en) Interface testing method, interface testing device and storage medium
CN112770108B (en) Performance test method, device and system and computer readable storage medium
JP5006824B2 (en) Test program management system
CN110688173B (en) Positioning method and device of components in cross-platform interface framework and electronic equipment
CN108805931B (en) Positioning detection method and device of AR product and computer readable storage medium
CN107861966B (en) Cache detection method, equipment and computer readable storage medium
JP6747161B2 (en) Software quality judgment method
CN113792017A (en) Method and system for checking template content imported into excel
CN112463630A (en) Version difference testing method and device, computer equipment and storage medium
CN111881052A (en) Log content processing method, device, equipment and computer readable storage medium
CN111337188A (en) Electronic pen calibration method, device, equipment and readable storage medium

Legal Events

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