A test case generation method and device

By converting the operation behavior sequence on the application platform into a standard operation behavior sequence, test cases suitable for multiple application platforms are generated, which solves the problem of non-universal test cases on different platforms and realizes the universality and efficiency improvement of test resources.

CN112597026BActive Publication Date: 2024-09-17AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011563855.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-09-17
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

Due to the different underlying implementation methods of software on different application platforms, the test cases cannot be universal, causing technicians to design different test cases for each platform, which wastes testing resources and reduces testing efficiency.

Method used

By determining the operation behavior sequence required to implement the test requirements on the first application platform, and converting it into a standard operation behavior sequence according to the corresponding relationship, test cases suitable for multiple application platforms are generated. The method includes determining the operation behavior sequence, converting it into standard operation behavior, and establishing an operation behavior matrix to generate general test cases.

Benefits of technology

It realizes the cross-platform universality of test cases, improves testing efficiency, reduces the waste of testing resources, and ensures the testing consistency of software on different application platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597026B
    Figure CN112597026B
Patent Text Reader

Abstract

The embodiment of the present application provides a test case generation method and device, which can first determine the first operation behavior sequence required to implement the test requirements on the first application platform. The first operation behavior sequence includes information of at least one operation behavior. The order of the information of the at least one operation behavior in the first operation behavior sequence reflects the execution order of at least one first operation behavior. After obtaining the first operation behavior sequence, the information of each first operation behavior in the first operation behavior sequence can be converted into the information of the corresponding standard operation behavior according to the corresponding relationship, and the information of at least one first standard operation behavior, that is, the first standard operation behavior sequence, can be obtained. Among them, the corresponding relationship includes the corresponding relationship between the first operation behavior information and the standard operation behavior information. After determining the first standard operation behavior sequence, a test case can be generated according to the first standard operation behavior sequence. In this way, the obtained test case can be applicable to different application platforms, realizes the universality of test resources, and improves test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a test case generation method and device. Background Art

[0002] With the development of computer technology, software tends to be large-scale, complex and integrated. In order to ensure that the quality of the software meets the requirements, the software can be tested before it goes online. During the test process, the test software can be used to simulate the actual operation process of the tested software to verify whether the software can meet the specified requirements or to clarify the difference between the expected results and the actual results, so that the technicians can optimize the software with problems. At present, the user's operation can be converted into a script through screen recording software. By executing the test case, the technician's operation can be simulated to test the software to be tested.

[0003] Multi-application platformization is one of the current trends in software development. Application platform refers to the device platform that runs the software. Multi-application platform refers to the same software being implemented on different application platforms, that is, releasing software with the same functions on different application platforms. Since the underlying implementation methods of each application platform are different, the software running on different application platforms is also different in implementation methods. Therefore, the test cases of software on different application platforms cannot be universal, that is, the test cases of software cannot be used to test the version of the software on another application platform. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a test case generation method and device, aiming to provide a technical solution capable of generating test cases applicable to different application platforms.

[0005] In a first aspect, an embodiment of the present application provides a test case generation method, the method comprising:

[0006] Determine a first operation behavior sequence required to implement the test requirement on the first application platform, the first operation behavior sequence includes information of at least one first operation behavior, and the order of the information of the at least one first operation behavior reflects the execution order of the at least one first operation behavior;

[0007] 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 relationship to obtain a first standard operation behavior sequence; the corresponding relationship includes the corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior;

[0008] Generate a test case according to the first standard operation behavior sequence.

[0009] Optionally, the corresponding relationship is determined by the following method:

[0010] Acquire a second operation behavior sequence required to implement the test requirement on the second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and the order of the information of the at least one second operation behavior reflects the execution order of the at least one second operation behavior;

[0011] determining the at least one second operating behavior as a standard operating behavior;

[0012] The corresponding relationship is determined according to the information of the at least one second operation behavior and the information of the at least one first operation behavior.

[0013] Optionally, the first operation behavior sequence includes information of a first target operation behavior;

[0014] The determining the corresponding relationship according to the information of the at least one second operation behavior and the information of the at least one first operation behavior comprises:

[0015] Determining whether the second operation behavior sequence includes a second target operation behavior corresponding to the first target operation behavior;

[0016] If the second operation behavior sequence includes 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;

[0017] If the second operation behavior sequence does not include a second target operation behavior, the first target operation behavior is determined as a standard operation behavior.

[0018] Optionally, generating a test case according to the first standard operation behavior sequence includes:

[0019] Establishing an operation behavior matrix, wherein the operation behavior matrix includes at least two columns of operation elements;

[0020] Determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior;

[0021] Determine the value of the operation element in the second column of the operation behavior matrix according to the information of each first standard operation behavior in the at least one first standard operation behavior;

[0022] Determine test cases based on the operational behavior matrix.

[0023] Optionally, the method further comprises:

[0024] Acquire a first grammatical rule of a first application platform, where the first grammatical rule is a grammatical rule used by a test script for testing the first application platform;

[0025] The test case is converted into a first test script according to the first grammatical rule, and the first test script is used to test the software to be tested on the first application platform.

[0026] In a second aspect, an embodiment of the present application further provides a test case generating device, the device comprising:

[0027] A determination unit, configured to determine a first operation behavior sequence required to implement a test requirement on a first application platform, wherein the first operation behavior sequence includes information of at least one first operation behavior, and the order of the information of the at least one first operation behavior reflects the execution order of the at least one first operation behavior;

[0028] a conversion unit, configured to convert the information of each first operation behavior in the first operation behavior sequence into information of a corresponding standard operation behavior according to a corresponding relationship, so as to obtain a first standard operation behavior sequence; the corresponding relationship includes a corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior;

[0029] A generating unit is used to generate a test case according to the first standard operation behavior sequence.

[0030] Optionally, the device further comprises a relationship determination unit;

[0031] The relationship determination unit is used to obtain a second operation behavior sequence required to implement the test requirement on a second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and the order of the information of the at least one second operation behavior reflects the execution order of the at least one second operation behavior; determine the at least one second operation behavior as a standard operation behavior; and determine the corresponding relationship based on the information of the at least one second operation behavior and the information of the at least one first operation behavior.

[0032] Optionally, the first operation behavior sequence includes information of a first target operation behavior;

[0033] The relationship determination unit is used 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 includes the second target operation behavior, the relationship between the information of the first target operation behavior and the information of the second target operation behavior is determined as the corresponding relationship; if the second operation behavior sequence does not include the second target operation behavior, the first target operation behavior is determined as the standard operation behavior.

[0034] Optionally, the generating unit is used to establish an operation behavior matrix, the operation behavior matrix comprising at least two columns of operation elements; determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; and determine the value of the operation element in the second column of the operation behavior matrix according to the information of each first standard operation behavior in the at least one first standard operation behavior.

[0035] Optionally, the device further comprises a script conversion unit;

[0036] The script conversion unit is used to obtain a first grammatical rule of a first application platform, where the first grammatical rule is a grammatical rule adopted by a test script for testing the first application platform; and convert the test case into a first test script according to the first grammatical rule, where the first test script is used to test the software to be tested on the first application platform.

[0037] In a third aspect, an embodiment of the present application further provides a device, comprising a memory and a processor, wherein the memory is used to store instructions, and the processor is used to run the instructions stored in the memory so that the device executes the test case generation method described in the first aspect above.

[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to control a computer to execute the test case generation method described in the first aspect.

[0039] The embodiment of the present application provides a test case generation method and device. When generating a test case for the software to be tested running on the first application platform, the test requirements can be determined first, and the first operation behavior sequence required to implement the test requirements on the first application platform can be determined according to the test requirements. The first operation behavior sequence includes information of at least one operation behavior. The order of the information of the at least one operation behavior in the first operation behavior sequence reflects the execution order of the at least one first operation behavior. After obtaining the first operation behavior sequence, the information of each first operation behavior in the first operation behavior sequence can be converted into the information of the corresponding standard operation behavior according to the corresponding relationship, and the information of at least one first standard operation behavior is obtained, and then the at least one first standard operation behavior information is arranged in order to obtain the first standard operation behavior sequence. Among them, the corresponding relationship includes the corresponding relationship between the first operation behavior information and the standard operation behavior information. After determining the first standard operation behavior sequence, a test case can be generated according to the first standard operation behavior sequence. In this way, the standard operation behavior can be executed on multiple application platforms. Converting the first operation behavior sequence for testing the software to be tested running on the first application platform into a standard operation behavior sequence is equivalent to converting the operation behavior applicable to a certain application platform into the operation behavior applicable to multiple application platforms. In this way, the obtained test cases can be applicable to different application platforms, realizing the universality of test resources and improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A method flow chart of a test case generation method provided in an embodiment of the present application;

[0042] Figure 2 A schematic diagram of the structure of a test case generation device provided in an embodiment of the present application;

[0043] Figure 3 Another structural schematic diagram of the test case generation device provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of another structure of the test case generating device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0045] At present, test cases can be obtained by means of screen recording and the like. Specifically, the technician can operate the software to be tested on the screen. The screen recording software can collect the display data on the screen and obtain the technician's operation and input data. In this way, by running the test case, the test software can simulate the user's operation behavior on the operation object on the user interface and verify the results output by the software. If the actual output result of the software matches the theoretical result, it means that the test result of the software is a successful test.

[0046] With the popularization of software, the same software may have different versions released on different application platforms. For example, the same software may have an application (Application, App) released on mobile terminals such as mobile phones, and an executable (executable, exe) file on the computer. At the same time, the software can also be accessed through a web page, that is, it has a web-side implementation. Obviously, due to the different underlying architectures of the application platforms, although the software on different application platforms has the same functions, there are certain differences in their user interfaces and underlying implementations, resulting in the inability of test cases on different application platforms to be universal.

[0047] Let's take an example. Suppose the software to be tested M has function A "enter interface 2 by operating button a in interface 1". Then, when the user uses the software to be tested M on the computer, the user's operation may be "move the cursor to the position of button a; click the left mouse button". And when the user uses the software to be tested N on the mobile terminal, the user's operation may be "click the position of button a on the screen". Obviously, due to the different implementation methods of software on different application platforms, users' operations on the software are also different. Accordingly, the test case for one application platform cannot test the same software to be tested on other platforms, and technicians are required to design different test cases for different application platforms, which wastes test resources and reduces test efficiency.

[0048] In order to provide a technical solution that can generate a general test case, the embodiment of the present application provides a test case generation method and device. The following is combined with the accompanying drawings of the specification to illustrate the test case generation provided by the embodiment of the present application from the perspective of the test platform. It should be noted that the test platform can be a software platform running on a server, or it can be a software module of the test software, and the embodiment of the present application is not limited to this. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] See also Figure 1 , Figure 1The method flow chart of the test case generation method provided in the embodiment of the present application includes:

[0050] S101: Determine a first operation behavior sequence required to implement a test requirement on a first application platform.

[0051] When generating test cases that can test the software to be tested on multiple application platforms, the test platform can first determine the first operation behavior sequence required to implement the test requirements on the first application platform. Among them, the first application platform is the application platform on which the software to be tested is released, for example, it can be a mobile terminal, a computer terminal and other platforms. Test requirements refer to the specific description of the test items that need to be performed on the software to be tested, for example, it can be to test whether a certain function of the software to be tested can work normally. The first operation behavior sequence is a set of information on at least one operation behavior that the test platform needs to perform when testing the software to be tested on the first application platform according to the test requirements, which is composed of the execution order, that is, the first operation behavior sequence includes information on at least one first operation behavior arranged in the execution order.

[0052] For example, suppose the first application platform is a mobile terminal, and the test requirement is to test whether the software M to be tested can enter interface 2 by clicking button a in the middle of interface 1. Then, the first operation behavior sequence can be "trigger a click operation on the position corresponding to button a in interface 1 → obtain the interface identifier → determine whether the interface identifier is the identifier of interface 2".

[0053] In an embodiment of the present application, the test platform can receive a first operation behavior sequence manually input by a technician, or it can analyze the test requirements through an artificial intelligence model to determine the first operation behavior sequence. The embodiment of the present application is not limited to this.

[0054] S102: Convert the information of each first operation behavior in the first operation behavior sequence into information of the corresponding standard operation behavior according to the corresponding relationship to obtain a first standard operation behavior sequence.

[0055] After obtaining the first operation behavior sequence, the test platform can convert the information of each first operation behavior included in the first operation behavior sequence into the information of the standard operation behavior corresponding to the first operation behavior according to the corresponding relationship, thereby obtaining the first standard operation behavior sequence. The corresponding relationship includes the corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior. The standard operation behavior is a standardized operation behavior that embodies the essence of the operation behavior and is applicable to at least one application platform.

[0056] In the embodiment of the present application, the standard operation behavior can be abstracted and extracted by technicians from the operation behaviors of multiple application platforms, or can be determined by the test platform based on the operation behavior on the second application platform. The second application platform can be any application platform that publishes the software to be tested, or an application platform with higher universality of information on the operation behavior of other application platforms.

[0057] When determining the corresponding relationship, the test platform can first obtain the second operation behavior sequence required to implement the test requirement on the second application platform. The second operation behavior sequence includes information of at least one second operation behavior arranged in an execution order. For a specific description of the second operation behavior sequence, please refer to the description of step S101, which will not be repeated here.

[0058] After acquiring the second operation behavior sequence, the test platform can determine the second operation behavior corresponding to each second operation behavior information included in the second operation behavior sequence as the standard operation behavior. Then, the test platform can determine the corresponding relationship based on the information of at least one second operation behavior and the information of at least one first operation behavior.

[0059] Specifically, the test platform can analyze the operation behaviors of the first application platform and the second application platform to determine the equivalent relationship between the operation behaviors. The test platform can determine the equivalent relationship between the operation objects of the first application platform and the second application platform and the equivalent relationship between the operation actions by analyzing the software to be tested on the first application platform and the second application platform. Among them, the equivalent relationship between the operation objects means 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 equivalent relationship between the operation actions means 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 equivalent relationship between the operation objects and the operation actions can also be determined and input by a technician.

[0060] In actual application scenarios, 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 based on the second operation behavior sequence may cause the test platform to be unable to determine the standard operation behavior information corresponding to each first operation behavior information in the first operation behavior sequence according to the corresponding relationship. Then, the test platform can determine the corresponding first operation behavior as the standard operation behavior.

[0061] Take the example that the first operation behavior sequence includes the information of the first target operation behavior. After obtaining the second operation behavior sequence, the test platform can determine whether the second operation behavior sequence includes the second target operation behavior corresponding to the first target operation behavior. If the second operation behavior sequence includes the second target operation behavior, the test platform can determine the second target operation behavior as the standard operation behavior, and then determine the corresponding relationship based on the relationship between the information of the second target operation behavior and the information of the first target operation behavior. If the second operation behavior sequence does not include the information of the second target operation behavior, then the test platform can determine the first target operation behavior as the standard operation behavior. In this way, the number of standard operation behaviors can be gradually expanded, which is convenient for the subsequent generation of test cases for testing the software to be tested published on the third application platform.

[0062] S103: Generate a test case according to the first standard operation behavior sequence.

[0063] After determining the first standard operation behavior sequence, the test platform can generate a test case according to the first standard operation behavior. Specifically, the test platform can arrange the information of at least one first standard operation behavior included in the first standard operation behavior sequence in order to obtain a test case.

[0064] In some possible implementations, the test platform can generate test cases for multiple application platforms at one time. Take the multiple application platforms including the first application platform and the second application platform as an example for illustration. When generating test cases for the first application platform and the second application platform, the test platform first establishes an operation behavior matrix, which includes at least two columns of operation elements, and each column of operation elements corresponds to an application platform. For example, the first column of operation elements can correspond to the second application platform, and the second column of operation elements can correspond to the first application platform. Then the test platform can determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the second operation behavior sequence, and determine the value of the operation element in the second column of the operation behavior matrix according to the information of each first standard operation behavior in the first standard operation behavior sequence.

[0065] Specifically, for any second operation behavior in the second operation behavior sequence, the test platform can determine the number of rows where the second operation behavior is located according to the execution order, so as to fill the information of the second operation behavior into the position corresponding to the first column of the operation behavior matrix. Then, the test platform can determine whether the first standard operation behavior sequence includes the second operation behavior sequence corresponding to the second operation behavior. If included, the test platform can determine that the value of the operation element in the second column of the operation behavior matrix that is in the same row as the second operation behavior is the information of the second operation behavior. If not included, the test platform can determine that the value of the operation element in the second column of the operation behavior matrix that is in 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, and the operation element in the first column of the obtained operation behavior matrix is ​​a test case for testing the software to be tested published on the second application platform, and the operation element in the second column is a test case for testing the software to be tested published on the first application platform.

[0066] In some possible implementations, the test platform can further process the test case to obtain a test script. Specifically, the test platform can obtain the 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. Among them, the first grammar rule is the grammar rule adopted by the test script for testing the first application platform, so the obtained test script can test the software to be tested published on the first application platform. In this way, the influence of the software application platform is shielded, so that different application platforms can use the same test case, thereby improving the test efficiency.

[0067] The embodiment of the present application provides a test case generation method. When generating a test case for the software to be tested running on the first application platform, the test requirements can be determined first, and the first operation behavior sequence required to implement the test requirements on the first application platform can be determined according to the test requirements. The first operation behavior sequence includes information of at least one operation behavior. The order of the information of the at least one operation behavior in the first operation behavior sequence reflects the execution order of the at least one first operation behavior. After obtaining the first operation behavior sequence, the information of each first operation behavior in the first operation behavior sequence can be converted into the information of the corresponding standard operation behavior according to the corresponding relationship, and the information of at least one first standard operation behavior is obtained, and then the at least one first standard operation behavior information is arranged in order to obtain the first standard operation behavior sequence. Among them, the corresponding relationship includes the corresponding relationship between the first operation behavior information and the standard operation behavior information. After determining the first standard operation behavior sequence, a test case can be generated according to the first standard operation behavior sequence. In this way, the standard operation behavior can be executed on multiple application platforms. Converting the first operation behavior sequence for testing the software to be tested running on the first application platform into a standard operation behavior sequence is equivalent to converting the operation behavior applicable to a certain application platform into the operation behavior applicable to multiple application platforms. In this way, the obtained test cases can be applicable to different application platforms, realizing the universality of test resources and improving test efficiency.

[0068] The above are some specific implementations of the test case generation method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The above device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.

[0069] See also Figure 2 The schematic diagram of the structure of the test case generating device shown in FIG. 200 includes:

[0070] The determination unit 210 is used to determine a first operation behavior sequence required to implement the test requirements on the first application platform, wherein the first operation behavior sequence includes information of at least one first operation behavior, and the order of the information of the at least one first operation behavior reflects the execution order of the at least one first operation behavior.

[0071] The conversion unit 220 is used to convert 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 relationship, so as to obtain a first standard operation behavior sequence; the corresponding relationship includes the corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior.

[0072] The generating unit 230 is used to generate a test case according to the first standard operation behavior sequence.

[0073] The embodiment of the present application provides a test case generation device. When generating a test case for the software to be tested running on the first application platform, the test requirements can be determined first, and the first operation behavior sequence required to implement the test requirements on the first application platform can be determined according to the test requirements. The first operation behavior sequence includes information of at least one operation behavior. The order of the information of the at least one operation behavior in the first operation behavior sequence reflects the execution order of the at least one first operation behavior. After obtaining the first operation behavior sequence, the information of each first operation behavior in the first operation behavior sequence can be converted into the information of the corresponding standard operation behavior according to the corresponding relationship, and the information of at least one first standard operation behavior is obtained, and then the at least one first standard operation behavior information is arranged in order to obtain the first standard operation behavior sequence. Among them, the corresponding relationship includes the corresponding relationship between the first operation behavior information and the standard operation behavior information. After determining the first standard operation behavior sequence, a test case can be generated according to the first standard operation behavior sequence. In this way, the standard operation behavior can be executed on multiple application platforms. Converting the first operation behavior sequence for testing the software to be tested running on the first application platform into a standard operation behavior sequence is equivalent to converting the operation behavior applicable to a certain application platform into the operation behavior applicable to multiple application platforms. In this way, the obtained test cases can be applicable to different application platforms, realizing the universality of test resources and improving test efficiency.

[0074] Alternatively, see Figure 3 ,exist Figure 2 On the basis of the illustrated embodiment, the device 200 further includes a relationship determining unit 240 .

[0075] The relationship determination unit 240 is used to obtain a second operation behavior sequence required to implement the test requirement on the second application platform, the second operation behavior sequence includes information of at least one second operation behavior, and the order of the information of the at least one second operation behavior reflects the execution order of the at least one second operation behavior; determine the at least one second operation behavior as a standard operation behavior; and determine the corresponding relationship based on the information of the at least one second operation behavior and the information of the at least one first operation behavior.

[0076] Optionally, in some possible implementations, the first operation behavior sequence includes information of a first target operation behavior.

[0077] The relationship determination unit 240 is used 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 includes the second target operation behavior, the relationship between the information of the first target operation behavior and the information of the second target operation behavior is determined as the corresponding relationship; if the second operation behavior sequence does not include the second target operation behavior, the first target operation behavior is determined as the standard operation behavior.

[0078] Optionally, in some possible implementations, the generating unit 230 is used to establish an operation behavior matrix, the operation behavior matrix comprising at least two columns of operation elements; determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; determine the value of the operation element in the second column of the operation behavior matrix according to the information of each first standard operation behavior in the at least one first standard operation behavior.

[0079] Alternatively, see Figure 4 ,exist Figure 2 Based on the illustrated embodiment, the device further includes a script conversion unit 250 .

[0080] The script conversion unit 250 is used to obtain a first grammatical rule of a first application platform, where the first grammatical rule is a grammatical rule adopted by a test script for testing the first application platform; and convert the test case into a first test script according to the first grammatical rule, where the first test script is used to test the software to be tested on the first application platform.

[0081] The "first" and "second" in the names of "first operation behavior" and "second operation behavior" mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.

[0082] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0083] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0084] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A test case generation method, It is characterized in that The method comprises: Determine a first operation behavior sequence required to implement the test requirement on the first application platform, the first operation behavior sequence includes information of at least one first operation behavior, and the order of the information of the at least one first operation behavior reflects the execution order of the at least one first operation behavior; 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 relationship to obtain a first standard operation behavior sequence; the corresponding relationship includes the corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior; Generate a test case according to the first standard operation behavior sequence; The corresponding relationship is determined by the following method: Acquire a second operation behavior sequence required to implement the test requirement on a second application platform, where the second operation behavior sequence includes information of at least one second operation behavior, and the order of the information of the at least one second operation behavior reflects the execution order of the at least one second operation behavior, and the universality of the second application platform is higher than the universality of the first application platform; determining the at least one second operating behavior as a standard operating behavior; Determining the corresponding relationship according to the information of the at least one second operation behavior and the information of the at least one first operation behavior; The first operation behavior sequence includes information of a first target operation behavior; The determining the corresponding relationship according to the information of the at least one second operation behavior and the information of the at least one first operation behavior comprises: Determining 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, 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; If the second operation behavior sequence does not include a second target operation behavior, the first target operation behavior is determined as a standard operation behavior.

2. The method according to claim 1, It is characterized in that Generating a test case according to the first standard operation behavior sequence includes: Establishing an operation behavior matrix, wherein the operation behavior matrix includes at least two columns of operation elements; Determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; Determine the value of the operation element in the second column of the operation behavior matrix according to the information of each first standard operation behavior in the at least one first standard operation behavior; Determine test cases based on the operational behavior matrix.

3. The method according to claim 1, It is characterized in that The method further comprises: Acquire a first grammatical rule of a first application platform, where the first grammatical rule is a grammatical rule used by a test script for testing the first application platform; The test case is converted into a first test script according to the first grammatical rule, and the first test script is used to test the software to be tested on the first application platform.

4. A test case generating device, It is characterized in that The device comprises: A determination unit, configured to determine a first operation behavior sequence required to implement a test requirement on a first application platform, wherein the first operation behavior sequence includes information of at least one first operation behavior, and the order of the information of the at least one first operation behavior reflects the execution order of the at least one first operation behavior; a conversion unit, configured to convert the information of each first operation behavior in the first operation behavior sequence into information of a corresponding standard operation behavior according to a corresponding relationship, so as to obtain a first standard operation behavior sequence; the corresponding relationship includes a corresponding relationship between the information of the first operation behavior and the information of the standard operation behavior; A generating unit, configured to generate a test case according to the first standard operation behavior sequence; The apparatus further comprises a relationship determination unit; The relationship determination unit is used to obtain a second operation behavior sequence required to implement the test requirement on the second application platform, the second operation behavior sequence includes information of at least one second operation behavior, and the order of the information of the at least one second operation behavior reflects the execution order of the at least one second operation behavior; determine the at least one second operation behavior as a standard operation behavior; determine the corresponding relationship according to the information of the at least one second operation behavior and the information of the at least one first operation behavior, and the universality of the second application platform is higher than the universality of the first application platform; The first operation behavior sequence includes information of a first target operation behavior; The relationship determination unit is used 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 includes the second target operation behavior, the relationship between the information of the first target operation behavior and the information of the second target operation behavior is determined as the corresponding relationship; if the second operation behavior sequence does not include the second target operation behavior, the first target operation behavior is determined as the standard operation behavior.

5. The device according to claim 4, It is characterized in that The generating unit is used to establish an operation behavior matrix, wherein the operation behavior matrix includes at least two columns of operation elements; Determine the value of the operation element in the first column of the operation behavior matrix according to the information of each second operation behavior in the at least one second operation behavior; The value of the operation element in the second column of the operation behavior matrix is ​​determined according to the information of each first standard operation behavior in the at least one first standard operation behavior.

6. The device according to claim 4, It is characterized in that The device also includes a script conversion unit; The script conversion unit is used to obtain a first grammatical rule of a first application platform, where the first grammatical rule is a grammatical rule adopted by a test script for testing the first application platform; and convert the test case into a first test script according to the first grammatical rule, where the first test script is used to test the software to be tested on the first application platform.