CN114168472A - Use case execution method and device, electronic equipment and computer readable storage medium - Google Patents

Use case execution method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114168472A
CN114168472A CN202111496738.8A CN202111496738A CN114168472A CN 114168472 A CN114168472 A CN 114168472A CN 202111496738 A CN202111496738 A CN 202111496738A CN 114168472 A CN114168472 A CN 114168472A
Authority
CN
China
Prior art keywords
test case
tested
determining
test
case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111496738.8A
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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202111496738.8A priority Critical patent/CN114168472A/en
Publication of CN114168472A publication Critical patent/CN114168472A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a use case execution method, a use case execution device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: acquiring a plurality of requirements to be tested of target software and a plurality of test cases corresponding to each requirement to be tested; determining the number of the test cases related to the requirements to be tested aiming at each test case; determining the case priority of each test case according to the related quantity of each test case; and executing each test case in sequence according to the priority of each case. The software testing efficiency is improved after the test cases are executed according to the sequence of execution by acquiring the plurality of requirements to be tested of the software to be tested and the plurality of test cases corresponding to each requirement to be tested and determining the sequence of execution of each test case according to the range of involvement of each test case.

Description

Use case execution method and device, electronic equipment and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a use case execution method and device, electronic equipment and a computer readable storage medium.
Background
With the rapid development of computer technology, the types of software products are more and more, and the development and iteration processes of each software product need to execute test cases to ensure the stability and safety of the software product.
The establishment of the test cases is designed based on requirements, each requirement can correspond to a plurality of test cases, each test case can cover a plurality of requirements, at present, the execution sequence of the test cases mainly depends on the experience or habit of testers, but the test efficiency is low due to the mode.
Disclosure of Invention
The embodiment of the application provides a use case execution method and device, an electronic device and a computer readable storage medium, and the test efficiency of a software product can be improved.
In a first aspect, an embodiment of the present application provides a use case execution method, including:
acquiring a plurality of requirements to be tested of target software and a plurality of test cases corresponding to each requirement to be tested;
determining the number of the test cases related to the to-be-tested requirements aiming at each test case;
determining the case priority of each test case according to the related quantity of each test case;
and executing each test case in sequence according to the priority of each case.
In a second aspect, an embodiment of the present application further provides a use case execution apparatus, including:
the acquisition module is used for acquiring a plurality of requirements to be tested of the target software and a plurality of test cases corresponding to each requirement to be tested;
the quantity determining module is used for determining the related quantity of the test cases related to the to-be-tested requirements aiming at each test case;
the priority determining module is used for determining the case priority of each test case according to the related quantity of each test case;
and the execution module is used for sequentially executing each test case according to the priority of each case.
Wherein, in some embodiments of the present application, the priority determining module comprises:
the first determining unit is used for determining the initial priority of each test case according to the related quantity of each test case;
the second determining unit is used for determining the test case with the largest number in all the test cases in the first test case set as a target test case, and transferring the target test case and the initial priority of the target test case into the second test case set;
a third determining unit, configured to determine a plurality of requirements to be tested related to the target test case, and determine a plurality of test cases to be debugged related to any requirement to be tested in the plurality of requirements to be tested from the first test case set;
the adjusting unit is used for reducing the initial priority of the test case to be debugged aiming at each test case to be debugged so as to update the initial priority of each test case in the first test case set;
the circulating unit is used for returning and executing the test cases with the largest number in the test cases in the first test case set to determine the test case with the largest number as a target test case, and transferring the target test case into the second test case set until the first test case set does not contain any test case;
and a fourth determining unit, configured to determine the initial priority of each test case in the second test case set as a case priority of each test case.
Wherein, in some embodiments of the present application, the apparatus further includes a priority execution probability determination unit, which includes:
the processing subunit is used for carrying out normalization processing on the case priority of each test case according to the case priority of each test case to obtain the execution probability of each test case;
the first determining subunit is used for determining the historical preferential execution probability of each test case in the historical iteration version of the target software;
and a second determining subunit, configured to determine, for each test case, a current priority execution probability of the test case in a current iteration version according to the execution probability of the test case and a first weight of the execution probability, and a historical priority execution probability of the test case and a second weight of the historical priority execution probability, where a sum of the first weight and the second weight is 1.
Wherein, the execution module includes:
and sequentially executing each test case according to the current preferential execution probability of each test case.
Wherein, in some embodiments of the present application, the priority determining module further comprises:
the initial priority determining unit is used for determining the initial priority of each test case according to the related quantity of each test case;
the updating unit is used for determining the importance degree of the demand to be tested according to each demand to be tested, and updating the initial priorities of a plurality of test cases corresponding to the demand to be tested according to the importance degree to obtain the updated priority of each test case;
and a fifth determining unit, configured to determine, for each test case, the updated priority of the test case as a case priority of the test case.
Wherein, in some embodiments of the present application, the updating unit includes:
the third determining subunit is configured to determine a demand priority of the demand to be tested according to the functional feature corresponding to the demand to be tested;
the fourth determining subunit is configured to determine a function block to which the requirement to be measured belongs, and determine a quantity of the requirements of the requirement to be measured corresponding to the function block;
a fifth determining subunit, configured to determine the number of demands as a demand association degree of the demand to be measured;
and the sixth determining subunit is configured to determine the importance degree of the demand to be tested according to the demand priority of the demand to be tested, the demand association degree, and a preset demand development difficulty.
In some embodiments of the present application, the target software includes a plurality of versions of iterative development software, the importance level includes a current importance level, and the updating unit includes:
a seventh determining subunit, configured to determine a functional problem that is generated after each test case in the historical iteration version of the target software is executed;
the eighth determining subunit is configured to determine a requirement to be tested corresponding to each functional problem, and determine a current problem importance degree of each functional problem in the current iteration version and a historical problem importance degree of each functional problem in the historical iteration version;
and the ninth determining subunit is used for determining the current importance degree of the to-be-detected requirement in the current iteration version according to the plurality of functional problems corresponding to the to-be-detected requirement, the current problem importance degree and the historical problem importance degree corresponding to each functional problem, and the historical importance degree of the to-be-detected requirement in the historical iteration version.
In this embodiment, the apparatus further includes a relationship matrix establishing unit, where the relationship matrix establishing unit includes:
the set determining subunit is used for determining a set of the requirements to be tested and a set of test cases according to the plurality of requirements to be tested and the plurality of test cases corresponding to each requirement to be tested;
and the establishing subunit is used for establishing a relation matrix between the demand set to be tested and the test case set according to the plurality of test cases corresponding to each demand to be tested.
Wherein the quantity determining module comprises:
the requirement determining unit is used for determining a plurality of requirements to be tested related to the test case according to the relation matrix;
the statistical unit is used for counting the number of the demands to be measured;
a quantity determining unit, configured to determine the required quantity as a related quantity of the test cases.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the use-case execution method when executing the computer program.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the use case execution method are implemented.
According to the software testing method and device, the plurality of requirements to be tested of the software to be tested and the plurality of test cases corresponding to each requirement to be tested are obtained, the sequential execution sequence of each test case is determined according to the related range of each test case, after each test case is executed according to the sequential execution sequence, the software testing efficiency is improved, the related range of the test cases corresponds to the number of requirements to be tested covered by the test cases in the testing process, and the efficiency of full coverage of the requirements to be tested is improved through the prior execution of the test cases which cover more requirements to be tested.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a use case execution method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a use case execution method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a use case execution device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the application provides a use case execution method and device, electronic equipment and a computer readable storage medium. Specifically, the embodiment of the present application provides a use case execution apparatus suitable for an electronic device, where the electronic device includes a computer, a personal notebook, and other mobile terminals.
Referring to fig. 1, taking the mobile terminal as an example to execute the case execution method, the specific execution process is as follows:
the mobile terminal 10 receives a plurality of requirements to be tested for the target software and a plurality of test cases corresponding to each requirement to be tested, then, the mobile terminal 10 determines the number of requirements to be tested covered by each test case, determines the case priority of each test case according to the number, and then, sequentially executes each test case according to the case priority of each test case.
In the embodiment of the present application, the requirement to be tested corresponds to a functional module to be tested in software to be tested, for example, a test requirement is established for a certain module in the software. The test case is compiled according to the requirement to be tested, and the test of the functional module corresponding to the requirement to be tested can be realized through the execution of the test case.
In the embodiment of the application, each requirement to be tested corresponds to a plurality of test cases, and each test case can cover a plurality of requirements to be tested, so that the test cases covering more requirements to be tested can be preferentially executed according to the coverage range of the test cases, and the efficiency of the whole coverage of each requirement to be tested, namely the efficiency of software testing, is improved.
The software testing method and the software testing device have the advantages that the multiple requirements to be tested of the software to be tested and the multiple test cases corresponding to the multiple requirements to be tested are obtained, the sequential execution sequence of the test cases is determined according to the related range of the test cases, the efficiency of software testing is improved after the test cases are executed according to the sequential execution sequence, the related range of the test cases corresponds to the number of the requirements to be tested covered by the test cases in the testing process, and the efficiency of full coverage of the requirements to be tested is improved through the preferential execution of the test cases which cover more requirements to be tested.
The following are detailed below. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a use case execution method according to an embodiment of the present application. The specific flow of the use case execution method can be as follows:
101. and acquiring a plurality of requirements to be tested of the target software and a plurality of test cases corresponding to each requirement to be tested.
In the embodiment of the application, the target software is software which is written and developed in the mobile terminal and needs to be subjected to version update testing.
In the embodiment of the application, the requirement to be tested corresponds to a functional module to be tested in the target software, for example, the requirement to be tested is obtained for a certain functional module to be tested.
The Test Case (Test Case) is a description of a Test task performed on a specific software product, and embodies a Test scheme, a method, a technology and a strategy. The contents of the test object, the test environment, the input data, the test steps, the expected results, the test scripts and the like are included, and finally, a document is formed. Simply considered, a test case is a set of test inputs, execution conditions, and expected results tailored for a particular purpose to verify whether a particular software requirement is met.
In the embodiment of the application, the Test Case (Test Case) is a Test Case compiled and established according to the requirement to be tested. Each requirement to be tested can correspond to a plurality of test cases, and the test range of each test case can cover a plurality of requirements to be tested.
In the embodiment of the application, the execution sequence of each test case is mainly determined according to the coverage of the test case, so that the test cases corresponding to each requirement to be tested and each requirement to be tested are acquired, and the coverage of each test case is conveniently determined.
102. And determining the number of the test cases related to the to-be-tested requirements for each test case.
In the embodiment of the present application, the to-be-tested requirements related to the test cases refer to the to-be-tested requirements that can be completed when the test cases are executed, that is, the same to-be-tested requirement can be tested by a plurality of test cases.
The number of the to-be-tested requirements which can be completed after each test case is executed can be determined by determining the number of the to-be-tested requirements related to the test cases.
In this embodiment of the present application, each requirement to be tested corresponding to each test case may be determined according to a corresponding relationship between the requirement to be tested and the test case, that is, optionally, in some embodiments of the present application, before the step "determining the number of the test cases related to the requirement to be tested", the method further includes:
determining a demand set to be tested and a test case set according to the plurality of demands to be tested and the plurality of test cases corresponding to each demand to be tested;
and establishing a relation matrix of the demand set to be tested and the test case set according to the plurality of test cases corresponding to each demand to be tested.
In the embodiment of the present application, the relationship matrix is a matrix of a coverage relationship between the test cases and the requirements to be tested in the requirement set to be tested and the test case set. For example, a set of requirements to be tested of the software to be tested is R ═ { R1, R2,. ry }, a set of test cases is C ═ { C1, C2,. cx }, each use case covers at least one requirement, each requirement corresponds to at least one use case, and thus a relationship matrix of the two is established:
Figure BDA0003400990920000071
wherein, the original priority TCP of each use case can be obtained according to the relation matrix, namely the matrix DxyThe sum of the elements of each row in (1).
The relationship matrix (matrix of a relationship) is a kind of description of a relationship, that is, for a certain relationship between two sets, a number matrix that can clearly indicate whether any element of the two sets has the relationship.
Accordingly, according to the matrixThe set of the requirements to be tested covered by each row of test cases can be obtained
Figure BDA0003400990920000072
Wherein by determining
Figure BDA0003400990920000073
The number of requirements to be tested in the test case design may be obtained, that is, optionally, in some embodiments of the present application, the step "determining the number of the test cases related to the requirements to be tested" includes:
determining a plurality of requirements to be tested related to the test case according to the relation matrix;
counting the number of the demands of the plurality of demands to be measured;
and determining the required quantity as the related quantity of the test cases.
The relation matrix can be used for acquiring a plurality of requirements to be tested related to each test case, and the related quantity of the requirements to be tested related to each test case can be acquired through counting the quantity of the plurality of requirements to be tested.
103. And determining the case priority of each test case according to the related number of the test cases.
The embodiment of the application aims to improve the test efficiency of software, so that the execution sequence of each test case can be determined according to the related quantity of each test case during the execution of the test cases, namely the test cases with larger quantity are related, and the quantity of the residual requirements to be tested of the software can be reduced to the greatest extent after the execution, so that the case priority ranking determination is carried out on each test case according to the related quantity, and the software test efficiency can be improved.
Each test case can possibly relate to the same or partially same requirements to be tested, and therefore in the embodiment of the application, repeated test cases can be filtered or the priority of the part of test cases can be reduced, so that the efficiency of the software requirement to be tested, which can be comprehensively tested, is improved. That is, optionally, in some embodiments of the present application, the step "determining a case priority for each test case according to the number of involved test cases" includes:
determining the initial priority of each test case according to the related number of each test case;
determining the test case with the largest number in all the test cases in the first test case set as a target test case, and moving the target test case and the initial priority of the target test case into a second test case set;
determining a plurality of requirements to be tested related to the target test case, and determining a plurality of test cases to be debugged related to any requirement to be tested in the plurality of requirements to be tested from the first test case set;
for each test case to be debugged, reducing the initial priority of the test case to be debugged to update the initial priority of each test case in the first test case set;
returning to execute the test cases with the largest number in the test cases in the first test case set to determine the test case with the largest number as a target test case, and transferring the target test case into a second test case set until the first test case set does not contain any test case;
and determining the initial priority of each test case in the second test case set as the case priority of each test case.
After the first test case with the largest number is selected through the initial priority of each test case, because the test case can relate to the same or partially same requirements to be tested as other test cases, after the first test case is determined, the priority of the test case covering the same or partially same requirements to be tested as the first test case can be reduced, namely, other test cases which do not cover the same or partially same requirements to be tested as the first test case are promoted, wherein the priority of the test case is adjusted through the mode, so that each requirement to be tested can be tested as fast as possible, and the software testing efficiency is improved.
In the embodiment of the application, the first test case with the largest number is the test case with the largest priority TCP in the test case set, and the purpose of full coverage of the test requirement can be achieved as soon as possible by testing the test case with the largest priority TCP with the priority, that is, the test case with the largest priority TCP is selected as a local optimal solution (if a plurality of optimal solutions exist, one of the optimal solutions is selected randomly); after the local optimal solution is obtained each time, the test case is removed from the test case set, and the priority of the test case covering the same requirement to be tested as the test case is reduced, for example, the priority TCP of each test case in the test case set C is respectively obtained; carrying out priority sequencing on the test cases in the step C for multiple times, and sequentially placing the test cases in the step C' after finding out the local optimal solution each time; and after finding the local optimal solution each time, removing the local optimal solution in the step C, and reducing the priority of the test case covering the same requirement as the local optimal solution. And finally outputting a case set C' with the priority sorted from big to small.
In this embodiment of the present application, the execution order of each test case may also be determined according to the priority execution probability of each test case, that is, optionally, in some embodiments of the present application, after the step "determining the initial priority of each test case in the second set of test cases as the case priority of each test case", the method further includes:
according to the case priority of each test case, carrying out normalization processing on the case priority of each test case to obtain the execution probability of each test case;
determining the historical preferential execution probability of each test case in the historical iteration version of the target software;
and for each test case, determining the current preferential execution probability of the test case in the current iteration version according to the execution probability of the test case and the first weight of the execution probability, and the historical preferential execution probability of the test case and the second weight of the historical preferential execution probability, wherein the sum of the first weight and the second weight is 1.
The execution probability of the preferential execution corresponding to each test case is obtained through the normalization processing of the priority of each test case in the current iteration version of the software, namely the higher the priority of the test case is, the higher the probability of the preferential execution is.
The method comprises the steps of obtaining a historical prior execution probability of a test case in a software historical iteration version, determining the prior execution probability of the current case comprehensively by combining the historical prior execution probability of the test case in the software historical iteration version, and enabling the execution sequence of each test case in the current iteration version to be more accurate.
The normalization processing of the test case priority TCP comprises the following steps:
Figure BDA0003400990920000101
correspondingly, considering the influence of the previous version on the current test, calculating to obtain the test case priority execution probability P of the current v-th test:
Figure BDA0003400990920000102
after the priority execution probability of each test case is determined, the step of performing sequential execution on each test case according to the priority of each case comprises the following steps:
and sequentially executing each test case according to the current preferential execution probability of each test case.
The execution of the test cases is performed in sequence according to the execution probability, so that the execution diversity of the test cases is increased, and the accuracy of software testing is improved.
In this embodiment of the present application, the case priority of each test case may also be determined according to the importance degree of each demand to be tested, that is, optionally, in some embodiments of the present application, the step "determining the case priority of each test case according to the number of each test case" includes:
determining the initial priority of each test case according to the related number of each test case;
aiming at each demand to be tested, determining the importance degree of the demand to be tested, and updating the initial priorities of a plurality of test cases corresponding to the demand to be tested according to the importance degree to obtain the updated priority of each test case;
and aiming at each test case, determining the updated priority of the test case as the case priority of the test case.
The test cases are compiled and established based on the requirements to be tested, so that when the importance degree of the requirements to be tested is higher, the priority of the test cases can be correspondingly improved, and the test cases with the requirements to be tested and higher importance degree can be preferentially executed.
Wherein, in this application embodiment, the importance degree of the demand that awaits measuring can be confirmed according to the priority of demand that awaits measuring self, the development degree of difficulty of the functional module that the demand that awaits measuring corresponds and the degree of association of demand that awaits measuring and other demands, promptly, optionally, in some embodiments of this application, step "confirm the importance degree of demand that awaits measuring", include:
determining the demand priority of the demand to be tested according to the functional characteristics corresponding to the demand to be tested;
determining a function block to which the demand to be measured belongs, and determining the demand quantity of the demand to be measured corresponding to the function block;
determining the quantity of the demands as the demand relevance of the demands to be tested;
and determining the importance degree of the demand to be tested according to the demand priority, the demand association degree and the preset demand development difficulty of the demand to be tested.
The requirement priority of the requirement to be tested can be customized according to project requirements, and the requirement development difficulty of the requirement to be tested can also be determined according to evaluation of developers.
In the embodiment of the present application, the requirement association degree of the requirements to be tested includes the number of the requirements to be tested belonging to the same functional block, for example, the requirement to be tested a1 belongs to the functional block a, where the functional block a corresponds to a plurality of requirements to be tested, which are respectively the requirements to be tested a1, a2, a3, and a4, and accordingly, the requirement association degree of the requirements to be tested is 4.
The importance degree of the demand to be tested can be comprehensively determined by considering the functional characteristics of the demand to be tested and the use frequency (demand association degree) of the demand to be tested in the software product. The higher the development difficulty of the functional module corresponding to the demand to be tested is, the higher the probability of the code having problems is, the higher the code accuracy is, and the higher the importance of the corresponding functional module is.
For example, according to the priority RP of the demand to be measured, the development difficulty RT of the demand to be measured, and the correlation RC between the demands to be measured, the importance FRP of the demand to be measured is determined as:
FRPr=ω1*RPr2*RTr3*RCr
wherein, RPrAnd RTrThe method is characterized in that assignment definition is carried out according to actual experience of engineering application, and RCrThe sum of the number of the demands of the function block which belongs to the same function block as r, and the definition of the size of the function block determines the calculation granularity of the importance degree of the demands; omega1、ω2And ω3The sum of (1) is assigned according to the actual situation.
In the embodiment of the present application, the importance of the requirement to be tested may also be determined according to a test result of the requirement to be tested in the historical iterative version, for example, when a logic problem of code execution is found in the historical version test of the requirement to be tested, the importance of the requirement to be tested is correspondingly high in the current version test of software. That is, optionally, in some embodiments of the present application, the target software includes multi-version iterative development software, the importance level includes a current importance level, and the step "determining the importance level of the demand to be tested" includes:
determining functional problems generated after each test case of the target software in the historical iteration version is executed;
determining a requirement to be tested corresponding to each functional problem, and determining the current problem importance degree of each functional problem in the current iteration version and the historical problem importance degree of each functional problem in the historical iteration version;
and aiming at each demand to be tested, determining the current importance degree of the demand to be tested in the current iteration version according to a plurality of function problems corresponding to the demand to be tested, the current problem importance degree and the historical problem importance degree corresponding to each function problem, and the historical importance degree of the demand to be tested in the historical iteration version.
In the embodiment of the application, the importance degree of the historical problem of the functional problem of the previous version and the importance degree of the current problem of the functional problem of the current version are considered, so that the importance degree of the requirement to be tested of each version can be adjusted in real time according to the importance degree of the corresponding functional problem, and the accuracy of obtaining the importance degree of the requirement to be tested of each version is improved.
The calculation method of the importance degree FRP of the demand to be measured is as follows:
FRPr=ω1*RPr2*RTr3*RCr
therefore, for the same requirement to be measured, the corresponding original importance degree FRP is the same before and after, and the adjustment degrees FDP of the importance degrees of different versionsvThen the adjustment can be made according to the importance degree of the problem in the previous and next versions, that is, the importance degree adjustment degree FDP corresponding to the current version VvThe functional problems corresponding to the current version can be solved according to the requirements to be testedAnd weighting the importance degrees, adding the importance degrees, and subtracting the importance degree value of the functional problem corresponding to the requirement to be tested in the previous V-1 test to obtain the importance degree value.
The FDP is calculated mainly to adjust the importance TCP of the corresponding test case by updating the requirement importance FRP. It should be emphasized that, after a problem is detected but not repaired, related test cases need to be removed according to the unrepaired state of the problem, and then the remaining cases are prioritized, that is, the test cases corresponding to the unrepaired problem do not need to be tested. Therefore, when the test cases are sequenced according to the local optimal solution, the corresponding test cases can be removed according to the problem repairing condition, and the sequencing and the execution of the part of test cases are avoided.
In this embodiment of the present application, the test case corresponding to the problem may be determined according to the relationship matrix between the problem and the test case, that is, optionally, in this embodiment of the present application, the execution result of each test case may be obtained by executing the test case, that is, some functional problem sets D ═ D1, D2.. dk } may be obtained, and then, the relationship matrix W between the test case and the functional problem may be established according to the correspondence between the test case and the functional problemxzAnd establishing a ternary relation matrix A of the demand to be tested, the test case and the function problem according to the corresponding relation of the demand to be tested and the test casexyz
Figure BDA0003400990920000131
Therefore, the ternary relation matrix A of the requirement to be tested, the test case and the function problem can be obtainedxyzDetermining the to-be-tested requirements corresponding to the functional problems, and determining the test cases corresponding to the functional problems according to the relation matrix of the test cases and the functional problems.
104. And executing each test case in sequence according to the priority of each case.
By determining the priority of each test case, the efficiency of software testing can be improved after each test case is sequentially executed according to the priority of each test case.
The software testing method and the software testing device have the advantages that the multiple requirements to be tested of the software to be tested and the multiple test cases corresponding to the multiple requirements to be tested are obtained, the sequential execution sequence of the test cases is determined according to the related range of the test cases, the efficiency of software testing is improved after the test cases are executed according to the sequential execution sequence, the related range of the test cases corresponds to the number of the requirements to be tested covered by the test cases in the testing process, and the efficiency of full coverage of the requirements to be tested is improved through the preferential execution of the test cases which cover more requirements to be tested.
In order to better implement the use case execution method of the application, the application also provides a use case execution device based on the use case execution method. The terms are the same as those in the above example execution method, and specific implementation details may refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a use case execution device provided in the present application, where the use case execution device is applied to a mobile terminal, and specifically includes:
the obtaining module 201 is configured to obtain a plurality of requirements to be tested of the target software and a plurality of test cases corresponding to each requirement to be tested.
A quantity determining module 202, configured to determine, for each test case, a related quantity of the test case related to the to-be-tested demand.
In some embodiments of the present application, the apparatus further includes a relationship matrix establishing unit, where the relationship matrix establishing unit includes:
the set determining subunit is used for determining a set of the requirements to be tested and a set of test cases according to the plurality of requirements to be tested and the plurality of test cases corresponding to each requirement to be tested;
and the establishing subunit is used for establishing a relation matrix between the demand set to be tested and the test case set according to the plurality of test cases corresponding to each demand to be tested.
Wherein the quantity determining module 202 comprises:
the requirement determining unit is used for determining a plurality of requirements to be tested related to the test case according to the relation matrix;
the statistical unit is used for counting the number of the demands to be measured;
a quantity determining unit, configured to determine the required quantity as a related quantity of the test cases.
A priority determining module 203, configured to determine a case priority of each test case according to the number of the test cases involved.
Wherein the priority determining module 203 comprises:
the first determining unit is used for determining the initial priority of each test case according to the related quantity of each test case;
the second determining unit is used for determining the test case with the largest number in all the test cases in the first test case set as a target test case, and transferring the target test case and the initial priority of the target test case into the second test case set;
a third determining unit, configured to determine a plurality of requirements to be tested related to the target test case, and determine a plurality of test cases to be debugged related to any requirement to be tested in the plurality of requirements to be tested from the first test case set;
the adjusting unit is used for reducing the initial priority of the test case to be debugged aiming at each test case to be debugged so as to update the initial priority of each test case in the first test case set;
the circulating unit is used for returning and executing the test cases with the largest number in the test cases in the first test case set to determine the test case with the largest number as a target test case, and transferring the target test case into the second test case set until the first test case set does not contain any test case;
and a fourth determining unit, configured to determine the initial priority of each test case in the second test case set as a case priority of each test case.
Wherein, in some embodiments of the present application, the apparatus further includes a priority execution probability determination unit, which includes:
the processing subunit is used for carrying out normalization processing on the case priority of each test case according to the case priority of each test case to obtain the execution probability of each test case;
the first determining subunit is used for determining the historical preferential execution probability of each test case in the historical iteration version of the target software;
and a second determining subunit, configured to determine, for each test case, a current priority execution probability of the test case in a current iteration version according to the execution probability of the test case and a first weight of the execution probability, and a historical priority execution probability of the test case and a second weight of the historical priority execution probability, where a sum of the first weight and the second weight is 1.
Wherein, in some embodiments of the present application, the priority determining module further comprises:
the initial priority determining unit is used for determining the initial priority of each test case according to the related quantity of each test case;
the updating unit is used for determining the importance degree of the demand to be tested according to each demand to be tested, and updating the initial priorities of a plurality of test cases corresponding to the demand to be tested according to the importance degree to obtain the updated priority of each test case;
and a fifth determining unit, configured to determine, for each test case, the updated priority of the test case as a case priority of the test case.
Wherein, in some embodiments of the present application, the updating unit includes:
the third determining subunit is configured to determine a demand priority of the demand to be tested according to the functional feature corresponding to the demand to be tested;
the fourth determining subunit is configured to determine a function block to which the requirement to be measured belongs, and determine a quantity of the requirements of the requirement to be measured corresponding to the function block;
a fifth determining subunit, configured to determine the number of demands as a demand association degree of the demand to be measured;
and the sixth determining subunit is configured to determine the importance degree of the demand to be tested according to the demand priority of the demand to be tested, the demand association degree, and a preset demand development difficulty.
In some embodiments of the present application, the target software includes a plurality of versions of iterative development software, the importance level includes a current importance level, and the updating unit includes:
a seventh determining subunit, configured to determine a functional problem that is generated after each test case in the historical iteration version of the target software is executed;
the eighth determining subunit is configured to determine a requirement to be tested corresponding to each functional problem, and determine a current problem importance degree of each functional problem in the current iteration version and a historical problem importance degree of each functional problem in the historical iteration version;
and the ninth determining subunit is used for determining the current importance degree of the to-be-detected requirement in the current iteration version according to the plurality of functional problems corresponding to the to-be-detected requirement, the current problem importance degree and the historical problem importance degree corresponding to each functional problem, and the historical importance degree of the to-be-detected requirement in the historical iteration version.
And the execution module 204 is configured to sequentially execute each test case according to the priority of each use case.
Wherein, the execution module 204 includes:
and sequentially executing each test case according to the current preferential execution probability of each test case.
In the embodiment of the application, the obtaining module 201 obtains a plurality of requirements to be tested of software to be tested and a plurality of test cases corresponding to each requirement to be tested, then, the quantity determining module 202 determines the design quantity of the requirements to be tested of the design of the test cases for each test case, then, the priority determining module 203 determines the case priority of each test case according to the design quantity of each test case, and finally, the executing module 204 sequentially executes each test case according to the case priority.
According to the software testing method and device, the plurality of requirements to be tested of the software to be tested and the plurality of test cases corresponding to each requirement to be tested are obtained, the sequential execution sequence of each test case is determined according to the related range of each test case, after each test case is executed according to the sequential execution sequence, the software testing efficiency is improved, the related range of the test cases corresponds to the number of requirements to be tested covered by the test cases in the testing process, and the efficiency of full coverage of the requirements to be tested is improved through the prior execution of the test cases which cover more requirements to be tested.
In addition, the present application also provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of the electronic device related to the present application, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing the steps in any of the use case execution methods provided by this application.
According to the software testing method and device, the plurality of requirements to be tested of the software to be tested and the plurality of test cases corresponding to each requirement to be tested are obtained, the sequential execution sequence of each test case is determined according to the related range of each test case, after each test case is executed according to the sequential execution sequence, the software testing efficiency is improved, the related range of the test cases corresponds to the number of requirements to be tested covered by the test cases in the testing process, and the efficiency of full coverage of the requirements to be tested is improved through the prior execution of the test cases which cover more requirements to be tested.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, on which a computer program is stored, the computer program being capable of being loaded by a processor to execute the steps in any of the use case execution methods provided by the present application.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute steps in any data processing method provided by the present application, beneficial effects that can be achieved by any use case execution method provided by the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The above detailed description is provided for a method, an apparatus, an electronic device and a storage medium for executing a use case provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for executing a use case, comprising:
acquiring a plurality of requirements to be tested of target software and a plurality of test cases corresponding to each requirement to be tested;
determining the number of the test cases related to the to-be-tested requirements aiming at each test case;
determining the case priority of each test case according to the related quantity of each test case;
and executing each test case in sequence according to the priority of each case.
2. The method of claim 1, wherein determining the case priority for each test case according to the number of involved test cases comprises:
determining the initial priority of each test case according to the related number of each test case;
determining the test case with the largest number in all the test cases in the first test case set as a target test case, and moving the target test case and the initial priority of the target test case into a second test case set;
determining a plurality of requirements to be tested related to the target test case, and determining a plurality of test cases to be debugged related to any requirement to be tested in the plurality of requirements to be tested from the first test case set;
for each test case to be debugged, reducing the initial priority of the test case to be debugged to update the initial priority of each test case in the first test case set;
returning to execute the test cases with the largest number in the test cases in the first test case set to determine the test case with the largest number as a target test case, and transferring the target test case into a second test case set until the first test case set does not contain any test case;
and determining the initial priority of each test case in the second test case set as the case priority of each test case.
3. The method of claim 2, wherein after determining the initial priority of each test case in the second set of test cases as the case priority of each test case, the method further comprises:
according to the case priority of each test case, carrying out normalization processing on the case priority of each test case to obtain the execution probability of each test case;
determining the historical preferential execution probability of each test case in the historical iteration version of the target software;
for each test case, determining the current preferential execution probability of the test case in the current iteration version according to the execution probability of the test case and the first weight of the execution probability, and the historical preferential execution probability of the test case and the second weight of the historical preferential execution probability, wherein the sum of the first weight and the second weight is 1;
the executing of the test cases sequentially according to the case priorities includes:
and sequentially executing each test case according to the current preferential execution probability of each test case.
4. The method of claim 1, wherein determining the case priority for each test case according to the number of involved test cases comprises:
determining the initial priority of each test case according to the related number of each test case;
aiming at each demand to be tested, determining the importance degree of the demand to be tested, and updating the initial priorities of a plurality of test cases corresponding to the demand to be tested according to the importance degree to obtain the updated priority of each test case;
and aiming at each test case, determining the updated priority of the test case as the case priority of the test case.
5. The method of claim 4, wherein said determining the importance of the demand to be tested comprises:
determining the demand priority of the demand to be tested according to the functional characteristics corresponding to the demand to be tested;
determining a function block to which the demand to be measured belongs, and determining the demand quantity of the demand to be measured corresponding to the function block;
determining the quantity of the demands as the demand relevance of the demands to be tested;
and determining the importance degree of the demand to be tested according to the demand priority, the demand association degree and the preset demand development difficulty of the demand to be tested.
6. The method of claim 4, wherein the target software comprises multi-version iterative development software, the importance level comprises a current importance level, and the determining the importance level of the demand to be tested comprises:
determining functional problems generated after each test case of the target software in the historical iteration version is executed;
determining a requirement to be tested corresponding to each functional problem, and determining the current problem importance degree of each functional problem in the current iteration version and the historical problem importance degree of each functional problem in the historical iteration version;
and aiming at each demand to be tested, determining the current importance degree of the demand to be tested in the current iteration version according to a plurality of function problems corresponding to the demand to be tested, the current problem importance degree and the historical problem importance degree corresponding to each function problem, and the historical importance degree of the demand to be tested in the historical iteration version.
7. The method of claim 1, wherein prior to determining that the test case relates to the number of under test requirements, the method further comprises:
determining a demand set to be tested and a test case set according to the plurality of demands to be tested and the plurality of test cases corresponding to each demand to be tested;
establishing a relation matrix of the demand set to be tested and the test case set according to a plurality of test cases corresponding to each demand to be tested;
the determining the number of the test cases related to the to-be-tested demand comprises:
determining a plurality of requirements to be tested related to the test case according to the relation matrix;
counting the number of the demands of the plurality of demands to be measured;
and determining the required quantity as the related quantity of the test cases.
8. A use case execution apparatus, comprising:
the acquisition module is used for acquiring a plurality of requirements to be tested of the target software and a plurality of test cases corresponding to each requirement to be tested;
the quantity determining module is used for determining the related quantity of the test cases related to the to-be-tested requirements aiming at each test case;
the priority determining module is used for determining the case priority of each test case according to the related quantity of each test case;
and the execution module is used for sequentially executing each test case according to the priority of each case.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the use case execution method according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the use case execution method according to any one of claims 1 to 7.
CN202111496738.8A 2021-12-09 2021-12-09 Use case execution method and device, electronic equipment and computer readable storage medium Pending CN114168472A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111496738.8A CN114168472A (en) 2021-12-09 2021-12-09 Use case execution method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111496738.8A CN114168472A (en) 2021-12-09 2021-12-09 Use case execution method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114168472A true CN114168472A (en) 2022-03-11

Family

ID=80484949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111496738.8A Pending CN114168472A (en) 2021-12-09 2021-12-09 Use case execution method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114168472A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063376A (en) * 2011-02-16 2011-05-18 哈尔滨工程大学 Test case selection method
CN106844197A (en) * 2016-12-26 2017-06-13 重庆邮电大学 Uniformity test use-case strategy dispatching method based on algebraic reconstruction technique feedback control
CN109101431A (en) * 2018-09-26 2018-12-28 深圳壹账通智能科技有限公司 A kind of testing case management, computer readable storage medium and terminal device
CN109344048A (en) * 2018-08-17 2019-02-15 中国平安人寿保险股份有限公司 A kind of test method, storage medium and server
CN111274126A (en) * 2020-01-14 2020-06-12 华为技术有限公司 Test case screening method, device and medium
CN113220598A (en) * 2021-06-21 2021-08-06 中国农业银行股份有限公司 System test method, apparatus, device, medium, and program product
CN113568833A (en) * 2021-07-28 2021-10-29 深圳Tcl新技术有限公司 Test case determination method and device, computer equipment and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063376A (en) * 2011-02-16 2011-05-18 哈尔滨工程大学 Test case selection method
CN106844197A (en) * 2016-12-26 2017-06-13 重庆邮电大学 Uniformity test use-case strategy dispatching method based on algebraic reconstruction technique feedback control
CN109344048A (en) * 2018-08-17 2019-02-15 中国平安人寿保险股份有限公司 A kind of test method, storage medium and server
CN109101431A (en) * 2018-09-26 2018-12-28 深圳壹账通智能科技有限公司 A kind of testing case management, computer readable storage medium and terminal device
CN111274126A (en) * 2020-01-14 2020-06-12 华为技术有限公司 Test case screening method, device and medium
CN113220598A (en) * 2021-06-21 2021-08-06 中国农业银行股份有限公司 System test method, apparatus, device, medium, and program product
CN113568833A (en) * 2021-07-28 2021-10-29 深圳Tcl新技术有限公司 Test case determination method and device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN113448787B (en) Wafer abnormity analysis method and device, electronic equipment and readable storage medium
CN109669436B (en) Test case generation method and device based on functional requirements of electric automobile
CN112257848B (en) Method for determining logic core layout, model training method, electronic device and medium
CN112700006A (en) Network architecture searching method, device, electronic equipment and medium
WO2022095847A1 (en) System upgrading method and apparatus, device, and storage medium
CN115794570A (en) Pressure testing method, device, equipment and computer readable storage medium
CN115224751A (en) Method and device for acquiring remaining battery charging time, electronic equipment and medium
CN111581101A (en) Software model testing method, device, equipment and medium
CN111383704B (en) Built-in self-test circuit of memory and test method for memory
CN114168472A (en) Use case execution method and device, electronic equipment and computer readable storage medium
CN116626504A (en) Power battery performance determining method, apparatus, computer device and storage medium
CN116302344A (en) Method and system for batch generation of hardware simulation automation process
CN113485848B (en) Deep neural network deployment method and device, computer equipment and storage medium
CN115757172A (en) Test execution method and device, storage medium and computer equipment
US8554522B2 (en) Detection of design redundancy
CN115185833A (en) Abnormal code processing method and device, computer equipment and storage medium
CN114896105A (en) Reliability evaluation method, device, equipment and medium for electronic equipment
CN110177006B (en) Node testing method and device based on interface prediction model
CN113792875A (en) Performance test method, device, equipment and medium of distributed communication library
CN117561502A (en) Method and device for determining failure reason
CN108269004B (en) Product life analysis method and terminal equipment
CN110716830B (en) Pressure measuring machine selection method and device, electronic equipment and storage medium
CN112669893B (en) Method, system, device and equipment for determining read voltage to be used
CN112597717B (en) IP verification method and device and electronic equipment
CN110413464B (en) Configuration table item testing method and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220311