CN112597026A - Test case generation method and device - Google Patents
Test case generation method and device Download PDFInfo
- Publication number
- CN112597026A CN112597026A CN202011563855.7A CN202011563855A CN112597026A CN 112597026 A CN112597026 A CN 112597026A CN 202011563855 A CN202011563855 A CN 202011563855A CN 112597026 A CN112597026 A CN 112597026A
- Authority
- CN
- China
- Prior art keywords
- operation behavior
- information
- sequence
- behavior
- test
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 169
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000006399 behavior Effects 0.000 claims abstract description 395
- 239000011159 matrix material Substances 0.000 claims description 31
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000012163 sequencing technique Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012812 general test Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Abstract
The embodiment of the application provides a test case generation method and device, which can determine a first operation behavior sequence required by realizing a test requirement on a first application platform. The first sequence of operational behaviors includes information of at least one operational behavior. The ordering of the information of the at least one operation behavior in the first operation behavior sequence represents the execution order of the at least one first operation behavior. After the first operation behavior sequence is obtained, the information of each first operation behavior in the first operation behavior sequence may be respectively converted into the information of the corresponding standard operation behavior according to the correspondence, so as to obtain the information of at least one first standard operation behavior, that is, the first standard operation behavior sequence. The corresponding relation comprises the corresponding relation between the first operation behavior information and the standard operation behavior information. After the first standard operation behavior sequence is determined, a test case may be generated according to the first standard operation behavior sequence. Therefore, the obtained test case can be suitable for different application platforms, the universality of test resources is realized, and the test efficiency is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a test case.
Background
With the development of computer technology, software tends to be large-sized, complicated, and integrated. In order to ensure that the quality of the software meets the requirements, the software can be tested before being on-line. During the testing process, the testing software can be used for simulating the actual running process of the tested software, so as to check whether the software can meet the specified requirements or figure out the difference between the expected result and the actual result, and a technician can optimize the software with problems. Currently, the user's operation can be converted into a script by screen recording software. By executing the test case, the operation of a technician can be simulated, so that the software to be tested is tested.
The multi-application platform is one of the current software development trends. The application platform refers to a device platform for running software, and the multiple application platforms refer to the realization of the same software on different application platforms, namely the release of the software with the same function on different application platforms. Because the bottom layer implementation modes of the application platforms are different, the software running on different application platforms is also different in implementation mode. Therefore, the test cases of the software of different application platforms cannot be used universally, that is, the test cases of the software cannot be used for testing the version of the software on another application platform.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for generating a test case, and aim to provide a technical scheme capable of generating test cases suitable for different application platforms.
In a first aspect, an embodiment of the present application provides a test case generation method, where the method includes:
determining a first operation behavior sequence required for realizing a test requirement on a first application platform, wherein the first operation behavior sequence comprises at least one piece of first operation behavior information, and the sequencing of the at least one piece of first operation behavior information reflects the execution sequence of the at least one piece of first operation behavior;
respectively converting the information of each first operation behavior in the first operation behavior sequence into the information of the corresponding standard operation behavior according to the corresponding relation to obtain a first standard operation behavior sequence; the correspondence comprises a correspondence between the information of the first operation behavior and the information of a standard operation behavior;
and generating a test case according to the first standard operation behavior sequence.
Optionally, the correspondence is determined by:
acquiring a second operation behavior sequence required for realizing the test requirement on a second application platform, wherein the second operation behavior sequence comprises at least one piece of second operation behavior information, and the sequencing of the at least one piece of second operation behavior information reflects the execution sequence of the at least one piece of second operation behavior;
determining the at least one second operational behavior as a standard operational behavior;
and determining the corresponding relation according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
Optionally, the first sequence of operational behaviors includes information of a first target operational behavior;
the determining the correspondence according to the information of the at least one second operation behavior and the information of the at least one first operation behavior includes:
judging whether the second operation behavior sequence comprises a second target operation behavior corresponding to the first target operation behavior;
if the second operation behavior sequence comprises a second target operation behavior, determining a relationship between the information of the first target operation behavior and the information of the second target operation behavior as the corresponding relationship;
and if the second operation behavior sequence does not comprise a second target operation behavior, determining the first target operation behavior as a standard operation behavior.
Optionally, the generating a test case according to the first standard operation behavior sequence includes:
establishing an operation behavior matrix, wherein the operation behavior matrix comprises at least two columns of operation elements;
determining the value of an operation element of a first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior;
determining values of operation elements of a second column of the operation behavior matrix according to information of each of the at least one first standard operation behavior;
and determining a test case according to the operation behavior matrix.
Optionally, the method further comprises:
acquiring a first grammar rule of a first application platform, wherein the first grammar rule is a grammar rule adopted by a test script for testing the first application platform;
and converting the test case into a first test script according to the first grammar rule, wherein the first test script is used for testing software to be tested on the first application platform.
In a second aspect, an embodiment of the present application further provides a test case generation apparatus, where the apparatus includes:
the device comprises a determining unit, a judging unit and a processing unit, wherein the determining unit is used for determining a first operation behavior sequence required by realizing a test requirement on a first application platform, the first operation behavior sequence comprises at least one piece of first operation behavior information, and the sequencing of the at least one piece of first operation behavior information reflects the execution sequence of the at least one piece of first operation behavior;
the conversion unit is used for respectively converting the information of each first operation behavior in the first operation behavior sequence into the information of the corresponding standard operation behavior according to the corresponding relation to obtain a first standard operation behavior sequence; the correspondence comprises a correspondence between the information of the first operation behavior and the information of a standard operation behavior;
and the generating unit is used for generating a test case according to the first standard operation behavior sequence.
Optionally, the apparatus further comprises a relationship determination unit;
the relationship determining unit is configured to obtain a second operation behavior sequence required for implementing the test requirement on a second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and a sequence of the information of the at least one second operation behavior reflects an execution sequence of the at least one second operation behavior; determining the at least one second operational behavior as a standard operational behavior; and determining the corresponding relation according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
Optionally, the first sequence of operational behaviors includes information of a first target operational behavior;
the relationship determining unit is configured to determine whether the second operation behavior sequence includes a second target operation behavior corresponding to the first target operation behavior; if the second operation behavior sequence comprises a second target operation behavior, determining a relationship between the information of the first target operation behavior and the information of the second target operation behavior as the corresponding relationship; and if the second operation behavior sequence does not comprise a second target operation behavior, determining the first target operation behavior as a standard operation behavior.
Optionally, the generating unit is configured to establish an operation behavior matrix, where the operation behavior matrix includes at least two columns of operation elements; determining the value of an operation element of a first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; determining values of the operation elements of the second column of the operation behavior matrix according to the information of each of the at least one first standard operation behavior.
Optionally, the apparatus further comprises a script conversion unit;
the script conversion unit is used for acquiring a first grammar rule of a first application platform, wherein the first grammar rule is a grammar rule adopted by a test script for testing the first application platform; and converting the test case into a first test script according to the first grammar rule, wherein the first test script is used for testing software to be tested on the first application platform.
In a third aspect, an embodiment of the present application further provides an apparatus, where the apparatus includes a memory and a processor, where the memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory, so that the apparatus executes the test case generation method according to the foregoing first aspect.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage mechanism is configured to store a computer program, and the computer program is configured to control a computer to execute the test case generation method according to the foregoing first aspect.
The embodiment of the application provides a test case generation method and device. When generating a test case for software to be tested running on a first application platform, a test requirement may be determined first, and a first operation behavior sequence required for implementing the test requirement on the first application platform may be determined according to the test requirement. The first sequence of operational behaviors includes information of at least one operational behavior. The ordering of the information of the at least one operation behavior in the first operation behavior sequence represents the execution order of the at least one first operation behavior. After the first operation behavior sequence is obtained, the information of each first operation behavior in the first operation behavior sequence may be respectively converted into the information of the corresponding standard operation behavior according to the correspondence, so as to obtain the information of at least one first standard operation behavior, and then the information of the at least one first standard operation behavior is sequentially arranged, so as to obtain the first standard operation behavior sequence. The corresponding relation comprises the corresponding relation between the first operation behavior information and the standard operation behavior information. After the first standard operation behavior sequence is determined, a test case may be generated according to the first standard operation behavior sequence. In this way, standard operational behavior can be performed across multiple application platforms. The method comprises the steps of converting a first operation behavior sequence for testing software to be tested running on a first application platform into a standard operation behavior sequence, which is equivalent to converting operation behaviors suitable for a certain application platform into operation behaviors suitable for a plurality of application platforms. Therefore, the obtained test case can be suitable for different application platforms, the universality of test resources is realized, and the test efficiency is improved.
Drawings
To illustrate the technical solutions in the present embodiment or the prior art more clearly, the drawings needed to be used in the description of the embodiment or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, 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 flowchart of a method of generating a test case according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a test case generation apparatus according to an embodiment of the present disclosure;
fig. 3 is another schematic structural diagram of a test case generating apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a test case generation apparatus according to an embodiment of the present application.
Detailed Description
At present, test cases can be obtained by means of screen recording and the like. Specifically, the technician may operate the software under test on the screen. The screen recording software can collect the display data on the screen and acquire the data operated and input by the technician. Therefore, by running the test case, the test software can simulate the operation behavior of the user on the operation object on the user interface and verify the result output by the software. And if the result actually output by the software is matched with the theoretical result, the test result of the software is successful.
With the popularization of software, the same software may be released with different versions on different Application platforms, for example, the same software may be released with an Application program (App) on a mobile terminal such as a mobile phone, and also has an executable (exe) file on a computer side, and meanwhile, the software may also be accessed through a web page, that is, has the implementation of a web page side. Obviously, because the bottom layer architectures of the application platforms are different, although the functions of the software on different application platforms are the same, the user interfaces and the bottom layer implementations of the software on different application platforms have certain differences, so that the test cases of different application platforms cannot be used universally.
For example. Suppose that the software M to be tested has the function a "enter interface 2 at interface 1 by operating button a". Then, when the user uses the software M to be tested on the computer side, the operation performed by the user may be "move the cursor to the position of the button a; click the left mouse button ". And when the user uses the software to be tested N of the mobile terminal, the operation performed by the user may be "clicking the position of the button a on the screen". Obviously, the software operation by the user is different due to different implementation manners of the software on different application platforms. Accordingly, the same software to be tested on other platforms cannot be tested by the test case for one application platform, and technicians are required to design different test cases for different application platforms, so that test resources are wasted, and test efficiency is reduced.
In order to provide a technical scheme capable of generating a general test case, embodiments of the present application provide a test case generation method and apparatus. The following describes test case generation provided by the embodiments of the present application from the perspective of a test platform with reference to the drawings of the specification. It should be noted that the test platform may be a software platform running on a server, or may also be a software module of test software, which is not limited in this embodiment of the present application. It should be apparent that the described embodiments are only some of the embodiments of the present application, 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 application.
Referring to fig. 1, fig. 1 is a flowchart of a method of generating a test case according to an embodiment of the present application, where the method includes:
s101: a first sequence of operational behaviors needed to fulfill a test requirement on a first application platform is determined.
When generating a test case capable of testing software to be tested on a plurality of application platforms, the test platform may first determine a first operation behavior sequence required for implementing a test requirement on a first application platform. The first application platform is an application platform for issuing software to be tested, and may be a mobile terminal, a computer terminal, or the like. The test requirement refers to a specific description of a test item that needs to be performed on the software to be tested, and may be, for example, whether a certain function of the software to be tested can work normally. The first operation behavior sequence is a set formed by information of at least one operation behavior which needs to be executed by the test platform according to an execution sequence when the software to be tested on the first application platform is tested according to a test requirement, namely the first operation behavior sequence comprises the information of at least one first operation behavior arranged according to the execution sequence.
For example. Assuming that the first application platform is a mobile terminal, the test requirement is to test whether the software M to be tested can enter the interface 2 by clicking the button a in the interface 1. Then, the first operation behavior sequence may be "trigger click operation to the position corresponding to the button a in the interface 1 → obtain interface identifier → determine whether the interface identifier is the identifier of the interface 2".
In this embodiment of the present application, the test platform may receive a first operation behavior sequence manually input by a technician, and may also analyze a test requirement through an artificial intelligence model to determine the first operation behavior sequence, which is not limited in this embodiment of the present application.
S102: and respectively converting the information of each first operation behavior in the first operation behavior sequence into the information of the corresponding standard operation behavior according to the corresponding relation to obtain a first standard operation behavior sequence.
After the first operation behavior sequence is obtained, the test platform may convert information of each first operation behavior included in the first operation behavior sequence of the corresponding relationship piece into information of a standard operation behavior corresponding to the first operation behavior, so as to obtain the first standard operation behavior sequence. Wherein the correspondence includes a correspondence between information of the first operation behavior and information of the standard operation behavior. The standard operation behavior is a standardized operation behavior, embodies the essence of the operation behavior, and is suitable for at least one application platform.
In the embodiment of the present application, the standard operation behavior may be abstracted and extracted from the operation behaviors of the plurality of application platforms by a technician, or may be determined by the test platform according to the operation behavior on the second application platform. The second application platform may be any application platform that issues software to be tested, or an application platform with higher information universality relative to other application platforms.
When determining the corresponding relationship, the test platform may first obtain a second operation behavior sequence required for implementing the test requirement on the second application platform. The second sequence of operational behaviors includes information of at least one second operational behavior arranged in an execution order. For a detailed description of the second operation behavior sequence, reference may be made to the description of step S101, which is not described herein again.
After the second operation behavior sequence is obtained, the test platform may determine, as the standard operation behavior, the second operation behavior corresponding to the information of each second operation behavior included in the second operation behavior sequence. Then, the test platform may determine a correspondence relationship according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
Specifically, the test platform may analyze the operation behaviors of the first application platform and the second application platform to determine an equivalence relationship between the operation behaviors. The testing platform can determine the equivalence relation between the operation objects of the first application platform and the second application platform and the equivalence relation between the operation actions by analyzing the software to be tested on the first application platform and the second application platform. The equivalence relation between the operation objects represents that a certain operation object on the first application platform and another operation object on the second application platform are essentially the same, and the equivalence relation between the operation actions represents that a certain operation action on the first application platform and another operation action on the second application platform are essentially the same. Of course, in the embodiment of the present application, the equivalence relation between the operation object and the operation action may also be determined and input by the skilled person.
In an actual application scenario, there may not be a second operation behavior corresponding to the first operation behavior in the second operation behavior sequence. Then, determining the standard operation behavior only according to the second operation behavior sequence may cause that the test platform cannot obtain the standard operation behavior information corresponding to each piece of the first operation behavior information in the first operation behavior sequence according to the correspondence. Then, the test platform may determine the corresponding first operational behavior as the standard operational behavior.
The first operation behavior sequence includes information of the first target operation behavior as an example. After obtaining the second operation behavior sequence, the test platform may determine whether the second operation behavior sequence includes a second target operation behavior corresponding to the first target operation behavior. If the second operation behavior sequence includes a second target operation behavior, the test platform may determine the second target operation behavior as a standard operation behavior, and then determine a corresponding relationship according to a relationship between information of the second target operation behavior and information of the first target operation behavior. If the second sequence of operational behaviors does not include information of the second target operational behavior, then the test platform may determine the first target operational behavior as the standard operational behavior. Therefore, the number of the standard operation behaviors can be gradually increased, and a test case for testing the to-be-tested software issued on the third application platform can be conveniently generated in the follow-up process.
S103: and generating a test case according to the first standard operation behavior sequence.
After determining the first standard operation behavior sequence, the test platform may generate a test case according to the first standard operation behavior. Specifically, the test platform may arrange information of at least one first standard operation behavior included in the first standard operation behavior sequence in order to obtain the test case.
In some possible implementations, the test platform may generate test cases for multiple application platforms at a time. The description will be given by taking an example in which the plurality of application platforms include a first application platform and a second application platform. When generating test cases of a first application platform and a second application platform, a test platform card maliciously establishes an operation behavior matrix in advance, the operation behavior matrix comprises at least two columns of operation elements, and each column of operation elements corresponds to one application platform. For example, a first column of operational elements may correspond to a second application platform and a second column of operational elements may correspond to the first application platform. The test platform may determine the values of the operation elements of the first column in the operation behavior matrix according to the information of each second operation behavior in the second operation behavior sequence, and determine the values of the operation elements of the second column in the operation behavior matrix according to the information of each first standard operation behavior in the first standard operation behavior sequence.
Specifically, for any one second operation behavior in the second operation behavior sequence, the test platform may determine the row number where the second operation behavior is located according to the execution sequence, so as to fill the information of the second operation behavior into the position corresponding to the first column of the operation behavior matrix. Next, the test platform may determine whether a second operation behavior sequence corresponding to the second operation behavior is included in the first standard operation behavior sequence. If so, the test platform may determine that the value of the operation element in the second column of the operation behavior matrix and the same row as the second operation behavior is the information of the second operation behavior. If not, the test platform may determine that the value of the operation element in the second column of the operation behavior matrix and the same row as the second operation behavior is 0. In this way, after traversing the first standard operation behavior sequence and the second operation behavior sequence, the value of each operation element in the operation behavior matrix can be determined, the obtained operation elements in the first column of the operation behavior matrix are test cases for testing the software to be tested issued on the second application platform, and the operation elements in the second column are test cases for testing the software to be tested issued on the first application platform.
In some possible implementation manners, the test platform may further process the test cases to obtain a test script. Specifically, the test platform may obtain a first grammar rule of the first application platform, and convert the test case obtained in step S103 into a test script according to the first grammar rule. The first grammar rule is a grammar rule adopted by a test script for testing the first application platform, and the obtained test script can test software to be tested issued on the first application platform. Therefore, the influence of the software application platform is shielded, different application platforms can use the same test case, and the test efficiency is improved.
The embodiment of the application provides a test case generation method. When generating a test case for software to be tested running on a first application platform, a test requirement may be determined first, and a first operation behavior sequence required for implementing the test requirement on the first application platform may be determined according to the test requirement. The first sequence of operational behaviors includes information of at least one operational behavior. The ordering of the information of the at least one operation behavior in the first operation behavior sequence represents the execution order of the at least one first operation behavior. After the first operation behavior sequence is obtained, the information of each first operation behavior in the first operation behavior sequence may be respectively converted into the information of the corresponding standard operation behavior according to the correspondence, so as to obtain the information of at least one first standard operation behavior, and then the information of the at least one first standard operation behavior is sequentially arranged, so as to obtain the first standard operation behavior sequence. The corresponding relation comprises the corresponding relation between the first operation behavior information and the standard operation behavior information. After the first standard operation behavior sequence is determined, a test case may be generated according to the first standard operation behavior sequence. In this way, standard operational behavior can be performed across multiple application platforms. The method comprises the steps of converting a first operation behavior sequence for testing software to be tested running on a first application platform into a standard operation behavior sequence, which is equivalent to converting operation behaviors suitable for a certain application platform into operation behaviors suitable for a plurality of application platforms. Therefore, the obtained test case can be suitable for different application platforms, the universality of test resources is realized, and the test efficiency is improved.
The foregoing provides some specific implementation manners of the test case generation method for the embodiments of the present application, and based on this, the present application also provides a corresponding apparatus. The above-mentioned device provided by the embodiments of the present application will be described in terms of functional modularity.
Referring to fig. 2, a schematic structural diagram of a test case generating apparatus 200 includes:
a determining unit 210, configured to determine a first operation behavior sequence required for implementing a test requirement on a first application platform, where the first operation behavior sequence includes information of at least one first operation behavior, and a sequence of the information of the at least one first operation behavior reflects an execution order of the at least one first operation behavior.
A converting unit 220, configured to convert information of each first operation behavior in the first operation behavior sequence into information of a corresponding standard operation behavior according to the corresponding relationship, so as to obtain a first standard operation behavior sequence; the correspondence includes a correspondence between information of the first operation behavior and information of a standard operation behavior.
A generating unit 230, configured to generate a test case according to the first standard operation behavior sequence.
The embodiment of the application provides a test case generation device. When generating a test case for software to be tested running on a first application platform, a test requirement may be determined first, and a first operation behavior sequence required for implementing the test requirement on the first application platform may be determined according to the test requirement. The first sequence of operational behaviors includes information of at least one operational behavior. The ordering of the information of the at least one operation behavior in the first operation behavior sequence represents the execution order of the at least one first operation behavior. After the first operation behavior sequence is obtained, the information of each first operation behavior in the first operation behavior sequence may be respectively converted into the information of the corresponding standard operation behavior according to the correspondence, so as to obtain the information of at least one first standard operation behavior, and then the information of the at least one first standard operation behavior is sequentially arranged, so as to obtain the first standard operation behavior sequence. The corresponding relation comprises the corresponding relation between the first operation behavior information and the standard operation behavior information. After the first standard operation behavior sequence is determined, a test case may be generated according to the first standard operation behavior sequence. In this way, standard operational behavior can be performed across multiple application platforms. The method comprises the steps of converting a first operation behavior sequence for testing software to be tested running on a first application platform into a standard operation behavior sequence, which is equivalent to converting operation behaviors suitable for a certain application platform into operation behaviors suitable for a plurality of application platforms. Therefore, the obtained test case can be suitable for different application platforms, the universality of test resources is realized, and the test efficiency is improved.
Optionally, referring to fig. 3, on the basis of the embodiment shown in fig. 2, the apparatus 200 further includes a relationship determining unit 240.
The relationship determining unit 240 is configured to obtain a second operation behavior sequence required for implementing the test requirement on a second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and a sequence of the information of the at least one second operation behavior reflects an execution order of the at least one second operation behavior; determining the at least one second operational behavior as a standard operational behavior; and determining the corresponding relation according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
Optionally, in some possible implementations, the first sequence of operational behaviors includes information of a first target operational behavior.
The relationship determining unit 240 is configured to determine whether the second operation behavior sequence includes a second target operation behavior corresponding to the first target operation behavior; if the second operation behavior sequence comprises a second target operation behavior, determining a relationship between the information of the first target operation behavior and the information of the second target operation behavior as the corresponding relationship; and if the second operation behavior sequence does not comprise a second target operation behavior, determining the first target operation behavior as a standard operation behavior.
Optionally, in some possible implementations, the generating unit 230 is configured to establish an operation behavior matrix, where the operation behavior matrix includes at least two columns of operation elements; determining the value of an operation element of a first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; determining values of the operation elements of the second column of the operation behavior matrix according to the information of each of the at least one first standard operation behavior.
Optionally, referring to fig. 4, on the basis of the embodiment shown in fig. 2, the apparatus further includes a script conversion unit 250.
The script conversion unit 250 is configured to obtain a first syntax rule of a first application platform, where the first syntax rule is a syntax rule adopted by a test script for testing the first application platform; and converting the test case into a first test script according to the first grammar rule, wherein the first test script is used for testing software to be tested on the first application platform.
In the embodiments of the present application, the names "first" and "second" in the names "first operation behavior" and "second operation behavior" are only used for name identification, and do not represent first and second in sequence.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only an exemplary embodiment of the present application, and is not intended to limit the scope of the present application.
Claims (10)
1. A test case generation method, the method comprising:
determining a first operation behavior sequence required for realizing a test requirement on a first application platform, wherein the first operation behavior sequence comprises at least one piece of first operation behavior information, and the sequencing of the at least one piece of first operation behavior information reflects the execution sequence of the at least one piece of first operation behavior;
respectively converting the information of each first operation behavior in the first operation behavior sequence into the information of the corresponding standard operation behavior according to the corresponding relation to obtain a first standard operation behavior sequence; the correspondence comprises a correspondence between the information of the first operation behavior and the information of a standard operation behavior;
and generating a test case according to the first standard operation behavior sequence.
2. The method of claim 1, wherein the correspondence is determined by:
acquiring a second operation behavior sequence required for realizing the test requirement on a second application platform, wherein the second operation behavior sequence comprises at least one piece of second operation behavior information, and the sequencing of the at least one piece of second operation behavior information reflects the execution sequence of the at least one piece of second operation behavior;
determining the at least one second operational behavior as a standard operational behavior;
and determining the corresponding relation according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
3. The method of claim 2, wherein the first sequence of operational behaviors includes information of a first target operational behavior;
the determining the correspondence according to the information of the at least one second operation behavior and the information of the at least one first operation behavior includes:
judging whether the second operation behavior sequence comprises a second target operation behavior corresponding to the first target operation behavior;
if the second operation behavior sequence comprises a second target operation behavior, determining a relationship between the information of the first target operation behavior and the information of the second target operation behavior as the corresponding relationship;
and if the second operation behavior sequence does not comprise a second target operation behavior, determining the first target operation behavior as a standard operation behavior.
4. The method of claim 3, wherein generating test cases according to the first sequence of standard operational behaviors comprises:
establishing an operation behavior matrix, wherein the operation behavior matrix comprises at least two columns of operation elements;
determining the value of an operation element of a first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior;
determining values of operation elements of a second column of the operation behavior matrix according to information of each of the at least one first standard operation behavior;
and determining a test case according to the operation behavior matrix.
5. The method of claim 1, further comprising:
acquiring a first grammar rule of a first application platform, wherein the first grammar rule is a grammar rule adopted by a test script for testing the first application platform;
and converting the test case into a first test script according to the first grammar rule, wherein the first test script is used for testing software to be tested on the first application platform.
6. A test case generation apparatus, the apparatus comprising:
the device comprises a determining unit, a judging unit and a processing unit, wherein the determining unit is used for determining a first operation behavior sequence required by realizing a test requirement on a first application platform, the first operation behavior sequence comprises at least one piece of first operation behavior information, and the sequencing of the at least one piece of first operation behavior information reflects the execution sequence of the at least one piece of first operation behavior;
the conversion unit is used for respectively converting the information of each first operation behavior in the first operation behavior sequence into the information of the corresponding standard operation behavior according to the corresponding relation to obtain a first standard operation behavior sequence; the correspondence comprises a correspondence between the information of the first operation behavior and the information of a standard operation behavior;
and the generating unit is used for generating a test case according to the first standard operation behavior sequence.
7. The apparatus according to claim 6, wherein the apparatus further comprises a relationship determination unit;
the relationship determining unit is configured to obtain a second operation behavior sequence required for implementing the test requirement on a second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and a sequence of the information of the at least one second operation behavior reflects an execution sequence of the at least one second operation behavior; determining the at least one second operational behavior as a standard operational behavior; and determining the corresponding relation according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.
8. The apparatus of claim 7, wherein the first sequence of operational behaviors comprises information of a first target operational behavior;
the relationship determining unit is configured to determine whether the second operation behavior sequence includes a second target operation behavior corresponding to the first target operation behavior; if the second operation behavior sequence comprises a second target operation behavior, determining a relationship between the information of the first target operation behavior and the information of the second target operation behavior as the corresponding relationship; and if the second operation behavior sequence does not comprise a second target operation behavior, determining the first target operation behavior as a standard operation behavior.
9. The method of claim 8,
the generating unit is used for establishing an operation behavior matrix, and the operation behavior matrix comprises at least two columns of operation elements; determining the value of an operation element of a first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; determining values of the operation elements of the second column of the operation behavior matrix according to the information of each of the at least one first standard operation behavior.
10. The apparatus of claim 6, further comprising a script conversion unit;
the script conversion unit is used for acquiring a first grammar rule of a first application platform, wherein the first grammar rule is a grammar rule adopted by a test script for testing the first application platform; and converting the test case into a first test script according to the first grammar rule, wherein the first test script is used for testing software to be tested on the first application platform.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011563855.7A CN112597026A (en) | 2020-12-25 | 2020-12-25 | Test case generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011563855.7A CN112597026A (en) | 2020-12-25 | 2020-12-25 | Test case generation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112597026A true CN112597026A (en) | 2021-04-02 |
Family
ID=75202207
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011563855.7A Pending CN112597026A (en) | 2020-12-25 | 2020-12-25 | Test case generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112597026A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6957439B1 (en) * | 2000-05-09 | 2005-10-18 | International Business Machines Corporation | Method, system, and program for mapping objects in different language formats |
CN106649125A (en) * | 2016-12-28 | 2017-05-10 | 上海携程国际旅行社有限公司 | Method and frame system for establishing multi-platform-supporting automatic testing script |
CN107451060A (en) * | 2017-08-01 | 2017-12-08 | 安徽善金科技股份有限公司 | A kind of across mobile terminal automated test frame system |
CN108614774A (en) * | 2018-04-24 | 2018-10-02 | 百度在线网络技术(北京)有限公司 | Automated testing method and device |
-
2020
- 2020-12-25 CN CN202011563855.7A patent/CN112597026A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6957439B1 (en) * | 2000-05-09 | 2005-10-18 | International Business Machines Corporation | Method, system, and program for mapping objects in different language formats |
CN106649125A (en) * | 2016-12-28 | 2017-05-10 | 上海携程国际旅行社有限公司 | Method and frame system for establishing multi-platform-supporting automatic testing script |
CN107451060A (en) * | 2017-08-01 | 2017-12-08 | 安徽善金科技股份有限公司 | A kind of across mobile terminal automated test frame system |
CN108614774A (en) * | 2018-04-24 | 2018-10-02 | 百度在线网络技术(北京)有限公司 | Automated testing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9465718B2 (en) | Filter generation for load testing managed environments | |
CN105389256B (en) | A kind of unit test method and system | |
CN111124919A (en) | User interface testing method, device, equipment and storage medium | |
CN110825618A (en) | Method and related device for generating test case | |
CN114546738B (en) | Universal test method, system, terminal and storage medium for server | |
CN110944048A (en) | Service logic configuration method and device | |
CN109977012B (en) | Joint debugging test method, device, equipment and computer readable storage medium of system | |
CN110659870A (en) | Business audit test method, device, equipment and storage medium | |
GB2587432A (en) | System and method for software architecture redesign | |
CN112749083A (en) | Test script generation method and device | |
CN110955409B (en) | Method and device for creating resources on cloud platform | |
CN115658529A (en) | Automatic testing method for user page and related equipment | |
CN112214405A (en) | Software testing method and device, electronic equipment and readable storage medium | |
CN112231206A (en) | Script editing method for application program test, computer readable storage medium and test platform | |
CN112395182A (en) | Automatic testing method, device, equipment and computer readable storage medium | |
CN117493188A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN112306857A (en) | Method and apparatus for testing applications | |
CN116719736A (en) | Test case generation method and device for testing software interface | |
CN110609786A (en) | Software testing method and device, computer equipment and storage medium | |
CN116841543A (en) | Development method for dynamically generating cross-platform multi-terminal application based on Flutter | |
CN112597026A (en) | Test case generation method and device | |
CN111427770B (en) | Resource testing method and related equipment | |
CN113986263A (en) | Code automation test method, device, electronic equipment and storage medium | |
CN113626307A (en) | Data verification method and device based on K8S container platform | |
CN113608996B (en) | Mirror image compiling test method, system, device 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 |