CN109408355B - Test case obtaining method and device - Google Patents

Test case obtaining method and device Download PDF

Info

Publication number
CN109408355B
CN109408355B CN201710703776.3A CN201710703776A CN109408355B CN 109408355 B CN109408355 B CN 109408355B CN 201710703776 A CN201710703776 A CN 201710703776A CN 109408355 B CN109408355 B CN 109408355B
Authority
CN
China
Prior art keywords
version
case
test
version number
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710703776.3A
Other languages
Chinese (zh)
Other versions
CN109408355A (en
Inventor
王俊坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201710703776.3A priority Critical patent/CN109408355B/en
Publication of CN109408355A publication Critical patent/CN109408355A/en
Application granted granted Critical
Publication of CN109408355B publication Critical patent/CN109408355B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The invention provides a test case obtaining method and device. The method comprises the following steps: receiving a test case obtaining request, wherein the test case obtaining request comprises a target test module name and a target version number; searching a case version number of each test case matched with the target version number from the version number set of the target test module according to the target version number; searching initial version data of each test case and version difference data corresponding to the case version number of each test case in a database according to the case number of each test case and the searched case version number; and generating the test cases of each corresponding version according to the initial version data and the version difference data of each test case so as to perform software test. The method has low storage resource consumption, and can automatically generate the test cases of the corresponding versions according to the requirements of the testers to perform software testing, thereby reducing the workload of the testers and improving the software testing efficiency.

Description

Test case obtaining method and device
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for obtaining a test case.
Background
Software testing is used as a core link for ensuring reliability in a software development process, is of great importance to the quality of a final product, and is generally performed in the industry in a manual testing mode at present. The test method has low test case calling efficiency and low software test efficiency, and a tester needs to spend a great deal of time and energy to select the test case with a proper version from the test cases included in the test module to test the software. Meanwhile, the test method has high consumption of storage resources, and needs to consume a large amount of storage space to store the test cases of each version and the script files of the corresponding version.
Disclosure of Invention
In order to overcome the above disadvantages in the prior art, the present invention provides a method and an apparatus for obtaining test cases. The test case acquisition method has the advantages of low consumption of storage resources and high calling efficiency of the test cases, and can automatically generate the test cases of corresponding versions according to the requirements of testers so as to perform software testing, thereby reducing the workload of the testers and improving the software testing efficiency.
In terms of the test case obtaining method, a preferred embodiment of the present invention provides a test case obtaining method, which is applied to a test terminal, where the test terminal includes a database, an initial version data table and a version difference data table are stored in the database, the initial version data table is used to store initial version data corresponding to each test case, and the version difference data table is used to store version difference data between other versions of each test case and the initial version. The method comprises the following steps:
receiving a test case obtaining request, wherein the test case obtaining request comprises a target test module name and a target version number corresponding to a target test module;
searching a case version number of each test case matched with the target version number from the version number set of the target test module according to the target version number;
according to the case numbers of the test cases and the searched case version numbers, searching initial version data corresponding to the test cases and version difference data corresponding to the case version numbers of the test cases in a database;
and generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test.
For the test case obtaining apparatus, a preferred embodiment of the present invention provides a test case obtaining apparatus, which is applied to a test terminal, where the test terminal includes a database, an initial version data table and a version difference data table are stored in the database, the initial version data table is used to store initial version data corresponding to each test case, and the version difference data table is used to store version difference data between other versions of each test case and the initial version. The device comprises:
the device comprises a request receiving module, a test case obtaining module and a test case obtaining module, wherein the request receiving module is used for receiving a test case obtaining request, and the test case obtaining request comprises a target test module name and a target version number corresponding to a target test module;
the version number searching module is used for searching the case version number of each test case matched with the target version number from the version number set of the target testing module according to the target version number;
the data acquisition module is used for searching the initial version data corresponding to each test case and the version difference data corresponding to the case version number of each test case in the database according to the case number of each test case and the searched case version number;
and the case generating module is used for generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test.
Compared with the prior art, the test case acquisition method and the test case acquisition device provided by the preferred embodiment of the invention have the following beneficial effects: the test case acquisition method has the advantages of low consumption of storage resources and high calling efficiency of the test cases, and can automatically generate the test cases of corresponding versions according to the requirements of testers so as to perform software testing, thereby reducing the workload of the testers and improving the software testing efficiency. Specifically, the method searches a case version number of each test case matched with a target version number from a version number set of a target test module by receiving a test case acquisition request and according to the target version number corresponding to the target test module included in the test case acquisition request; searching initial version data corresponding to each test case and version difference data corresponding to the case version number of each test case in a database according to the case number of each test case and the searched case version number; and generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test, thereby reducing the workload of testers and improving the software test efficiency.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments are briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the claims of the present invention, and it is obvious for those skilled in the art that other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of a test terminal according to a preferred embodiment of the present invention.
Fig. 2 is a first flowchart of a test case obtaining method according to a preferred embodiment of the present invention.
Fig. 3 is a flowchart illustrating the sub-steps included in step S220 shown in fig. 2.
Fig. 4 is a second flowchart of a test case obtaining method according to a preferred embodiment of the present invention.
Fig. 5 is a flowchart illustrating the sub-steps included in step S250 shown in fig. 4.
Fig. 6 is a third flowchart illustrating a test case obtaining method according to a preferred embodiment of the present invention.
FIG. 7 is a first block diagram of the test case acquiring apparatus shown in FIG. 1 according to the preferred embodiment of the present invention.
FIG. 8 is a second block diagram of the test case acquiring apparatus shown in FIG. 1 according to the preferred embodiment of the present invention.
Fig. 9 is a third block diagram of the test case acquiring apparatus shown in fig. 1 according to the preferred embodiment of the present invention.
Icon: 10-a test terminal; 11-a database; 12-a processor; 100-test case obtaining device; 110-a request receiving module; 120-version number searching module; 130-a data acquisition module; 140-use case generation module; 150-script lookup module; 160-a data storage module; 170-relationship configuration module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that the terms "first", "second", "third", and the like are used for distinguishing descriptions only and are not intended to indicate or imply relative importance unless explicitly stated or limited otherwise. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art. Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 1 is a block diagram of a test terminal 10 according to a preferred embodiment of the invention. In the embodiment of the present invention, the test terminal 10 is used for testing software in a software development process to ensure that the quality of a finally obtained software product at least meets a qualified standard. Specifically, the test terminal 10 includes a test case obtaining device 100, a database 11, and a processor 12, where the database 11 and the processor 12 are directly or indirectly electrically connected to each other to implement data transmission or interaction. For example, the database 11 and the processor 12 may be electrically connected through one or more communication buses or signal lines.
The database 11 includes a memory for storing data, and the memory may be, but is not limited to, a random access memory, a read only memory, a programmable read only memory, an erasable programmable read only memory, an electrically erasable programmable read only memory, and the like. In this embodiment, the database 11 may store a plurality of test modules through the memory, where the test modules generally include a plurality of test cases, each test case includes corresponding initial version data and version difference data between other versions and the initial version that are different due to different test objects. In this embodiment, the database 11 may further store, by using the memory, an automation script corresponding to each test case in a state of a different version, where the automation script includes an initial script file corresponding to the test case in the state of the initial version and a script file corresponding to the test case in the state of another version. In this embodiment, the database 11 includes a memory for storing a program, and the processor 12 may execute the program after receiving the execution instruction.
The processor 12 may be an integrated circuit chip having signal processing capabilities. The processor 12 may be a general purpose processor including a central processing unit, a network processor, etc.; but may also be a digital signal processor, an application specific integrated circuit, an off-the-shelf programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The test case acquiring apparatus 100 includes at least one software function module capable of being stored in the form of software or firmware in the memory of the database 11 or being solidified in the operating system of the test terminal 10. The processor 12 may be used to execute executable modules stored in the memory, such as software functional modules and computer programs included in the test case acquiring apparatus 100. In this embodiment, the test case obtaining apparatus 100 may, when receiving a request for obtaining test cases of different versions from a tester, obtain a case version number, which is matched with a target version number, of each test case from a corresponding test module according to the target version number included in the request, obtain initial version data of each test case and version difference data corresponding to the case version number according to the case version number and a case number to which the case version number belongs, and then generate a test case, which is required by the tester and corresponds to a version, according to the initial version data and the version difference data of each test case to perform software testing. The test case obtaining device 100 only needs to spend a few storage resources to store the initial version data and the version difference data corresponding to each test case, and does not need to spend a large amount of storage resources to store different versions of each test case like the prior art, so the test case obtaining device 100 has low consumption of storage resources, can automatically generate the test cases of corresponding versions according to the requirements of testers to perform software testing, thereby reducing the workload of the testers and improving the software testing efficiency. The specific test case acquisition method is described in detail later.
Fig. 2 is a first flowchart of a test case obtaining method according to a preferred embodiment of the invention. In the embodiment of the present invention, the test case obtaining method is applied to the test terminal 10, an initial version data table and a version difference data table are stored in a database 11 in the test terminal 10, the initial version data table is used for storing initial version data corresponding to each test case, and the version difference data table is used for storing version difference data between other versions of each test case and the initial version. Each test case corresponds to an initial version data table and a version difference data table of a corresponding version. The specific flow and steps of the test case obtaining method shown in fig. 2 are described in detail below.
In the embodiment of the invention, the test case obtaining method comprises the following steps:
step S210, receiving a test case obtaining request, where the test case obtaining request includes a name of the target test module and a target version number corresponding to the target test module.
In this embodiment, the database 11 of the test terminal 10 manages a plurality of test cases stored in the database 11 by dividing a plurality of test cases having the same function point into the same set to form corresponding test modules, so that after receiving a test case obtaining request from a tester, the test terminal 10 automatically finds the corresponding test module according to the name of a target test module in the test case obtaining request, and then obtains each test case of a corresponding version number version under the test module according to the target test module to perform software testing.
Step S220, searching case version numbers of all test cases matched with the target version number from the version number set of the target test module according to the target version number.
In this embodiment, the version number set of the target test module includes all case version numbers corresponding to the test cases, and the case version numbers corresponding to the test cases may be the same or different. For example, one test module includes a test case 1, a test case 2, and a test case 3, where the case version number of the test case 1 is version 1 and version 2, the case version number of the test case 2 may be version 1, version 2, and version 3, and the case version number of the test case 3 may be version 1. Wherein, the version 1 is the initial version.
In this embodiment, the test terminal 10 obtains the version corresponding to each test case that meets the test case obtaining request and the test case corresponding to the case version number by searching the case version number that matches the target version number in the version number set of the target test module, so as to perform software testing.
Specifically, please refer to fig. 3, which is a flowchart illustrating the sub-steps included in step S220 shown in fig. 2. In the embodiment of the present invention, the step S220 may include a sub-step S221, a sub-step S222, and a sub-step S223. Wherein the substep S221, the substep S222 and the substep S223 are as follows:
and a substep S221 of searching whether a case version number identical to the target version number exists in all case version numbers corresponding to the test cases.
In this embodiment, the test terminal 10 may determine whether a case version number identical to the target version number exists in the version number set of the target test module by searching for a case version number identical to the target version number in all case version numbers corresponding to the test cases. For example, one test module includes a test case 1, a test case 2, and a test case 3, where the case version number of the test case 1 is version 1 and version 2, the case version number of the test case 2 is version 1, version 2, and version 3, and the case version number of the test case 3 is version 1, and if the target version number of the test module is version 2, it can be determined that a case version number identical to the target version number exists in the test case 1, a case version identical to the target version number exists in the test case 2, and a case version number identical to the target version number does not exist in the test case 3.
And a substep S222, acquiring a case number and the case version number of the corresponding test case.
In this embodiment, if there is a case version number that is the same as the target version number in all case version numbers of the test cases, the test terminal 10 takes the case version number as the case version number of the test case that matches the target version number, and correspondingly obtains the case number of the test case. For example, one test module includes a test case 1, a test case 2, and a test case 3, where the case version number of the test case 1 is version 1 and version 2, the case version number of the test case 2 is version 1, version 2, and version 3, and the case version number of the test case 3 is version 1, and if the target version number of the test module is version 2, the case version number of the test case 1 that matches the target version number is version 2, and the case version number of the test case 2 that matches the target version number is version 2. Wherein, 1 in the test case 1 is the case number of the test case, and 2 in the test case 2 is the case number of the test case.
And a substep S223 of using the parent version number corresponding to the target version number as the case version number of the corresponding test case according to the inheritance relationship among the case version numbers, and acquiring the corresponding case number.
In this embodiment, if there is no use case version number that is the same as the target version number in all use case version numbers of the test use cases, the test terminal 10 selects a parent version number corresponding to the target version number from the use case version numbers according to an inheritance relationship between the use case version numbers, and uses the parent version number as the use case version number of the test use case. For example, one test module includes a test case 1, a test case 2, and a test case 3, where the case version number of the test case 1 is version 1 and version 2, the case version number of the test case 2 is version 1, version 2, and version 3, the case version number of the test case 3 is version 1, and the inheritance relationship among version 1, version 2, and version 3 is: and when the parent version number of the version 3 is the version 2, and the parent version number of the version 2 is the version 1, if the target version number of the test module is the version 3, the test case 1 does not have a case version number identical to the target version number, the test case 3 does not have a case version number identical to the target version number, the case version number of the test case 1 matched with the target version number is the version 2, and the case version number of the test case 3 matched with the target version number is the version 1. Wherein, 1 in the test case 1 is the case number of the test case, and 3 in the test case 3 is the case number of the test case.
Step S230, according to the case number of each test case and the found case version number, the initial version data corresponding to each test case and the version difference data corresponding to the case version number of each test case are found in the database 11.
In this embodiment, each test case corresponds to an initial version data table for storing initial version data of the test case and a version difference data table for storing version difference data between other versions of the test case and the initial version in the database 11. The test terminal 10 may search the initial version data table corresponding to each test case and the version difference data table corresponding to the searched case version number of each test case according to the case number and the searched case version number of each test case, and extract corresponding initial version data and version difference data from the initial version data table and the version difference data table, respectively.
Step S240, generating a test case of each corresponding version in the target test module according to the initial version data and the version difference data of each test case, so as to perform a software test.
In this embodiment, the initial version data of each test case includes a test module name, an automation script name, an initial version number, an initial case step, an initial case expected result, and an initial case environment corresponding to each test case; the version difference data of each test case comprises a corresponding case version number, and a version case step, a version case expected result and a version case environment of the test case of the corresponding version corresponding to the case version number. If the version difference data has a difference from the corresponding item in the initial version data, a record will exist in the corresponding item of the version difference data, otherwise, the record is empty. Therefore, the step of generating, by the test terminal 10, the test case of each corresponding version in the target test module according to the initial version data and the version difference data of each test case includes:
and replacing corresponding contents in the initial version data according to the acquired version difference data of each test case, so as to obtain the test case of the corresponding version.
In this embodiment, if there is a null corresponding item in the version difference data, it indicates that the test case of the version corresponding to the version difference data is the same as the test case of the initial version in the corresponding item; if there is a recorded corresponding item in the version difference data, indicating that the version difference data is different from the initial version data in the corresponding item, the test terminal 10 replaces the corresponding item content in the initial version data with the recorded data in the version difference data, so as to obtain a test case of a corresponding version matched with the version difference data, so as to perform a software test, reduce the workload of a tester, and improve the software testing efficiency.
Fig. 4 is a schematic flow chart of a test case obtaining method according to a preferred embodiment of the invention. In this embodiment of the present invention, the method for obtaining a test case may further include:
step S250, according to the automated script name corresponding to each test case and the found case version number, the script file corresponding to the test case of each comparison version is found in the database 11 for software testing.
In this embodiment, one test case corresponds to one automation script, and any one version of the test case corresponds to one version of the automation script. For example, the automation script corresponding to the test case 1 is the script file 1, wherein the case version number of the test case 1 is version 1, version 2 and version 3, and the script file 1 of version 1, the script file 1 of version 2 and the script file 1 of version 3 are correspondingly present. If the version 1 is the initial version of the test case 1, the script file 1 of the version 1 is the initial script file corresponding to the test case 1, and the script file 1 is the name of the automation script corresponding to the test case 1.
In this embodiment, the database 11 includes a folder with a file name identical to that of the target test module, where the folder stores therein an initial script file corresponding to each test case and a subfolder with a file name identical to a case version number, where the subfolder stores therein script files corresponding to each test case of a corresponding version. The database 11 stores script files of different versions of each test case in the above manner.
Fig. 5 is a flowchart illustrating the sub-steps included in step S250 shown in fig. 4. In an embodiment of the present invention, the step S250 may include a sub-step S251, a sub-step S252, a sub-step S253, and a sub-step S254, where the sub-step S251, the sub-step S252, the sub-step S253, and the sub-step S254 are as follows:
in the substep S251, a folder having the same file name as the target test module name is searched for in the database 11.
In this embodiment, the test terminal 10 uses the name of the target test module in the test case obtaining request as an index, and searches the database 11 for a folder with the same file name as the name of the target test module, where the folder is used for a script file corresponding to each test case in a state of different versions.
Step S252, judging whether each case version number is an initial version number;
in this embodiment, the test terminal 10 determines whether each case version number is the initial version number by comparing the case version number of each test case matching the target version number with the initial version number.
And a substep S253 of directly extracting a corresponding initial script file from the folder according to the automatic script name of the corresponding test case, wherein the initial script file is used as the script file corresponding to the test case of each corresponding version.
In this embodiment, if the case version number is the same as the initial version number, that is, the case version number is the initial version number, the initial script file corresponding to the name of the automation script is directly extracted from the folder in which the initial script file of each test case is stored, and is used as the script file corresponding to the test case of each corresponding version. For example, when the case version numbers of the test case 1 and the test case 2 are both the initial version numbers, the script file corresponding to the test case 1 in the version state corresponding to the case version number will be the script file 1 of the version 1, and the script file corresponding to the test case 2 in the version state corresponding to the case version number will be the script file 2 of the version 1. The script file 1 and the script file 2 are respectively the automatic script names of the test case 1 and the test case 2, the script file 1 of the version 1 is an initial script file corresponding to the test case 1, and the script file 2 of the version 1 is an initial script file corresponding to the test case 2.
And a substep S254 of searching a subfolder with the same file name as the version number of the use case in the folder, and extracting a corresponding script file from the subfolder according to the automatic script name of the corresponding test case to serve as the script file corresponding to the test case of each corresponding version.
In this embodiment, if the case version number is different from the initial version number, that is, if the case version number is not the initial version number, the script file corresponding to the name of the automation script is extracted from the subfolders, which are used for storing the script files of the test cases of other versions and are identical to the case version number, stored in the folder, and is used as the script file corresponding to the test case of each corresponding version. For example, a subfolder with a file name of version 2 and a subfolder with a file name of version 3 are stored in a folder with the same file name as the target test module, wherein a script file 1 and a script file 2 are stored in the subfolder with the file name of version 2, a script file 2 is stored in the subfolder with the file name of version 3, the script file 1 in the subfolder with the file name of version 2 is an automatic script file of the test case 1 in a state that the case version number is version 2, the script file 2 in the subfolder with the file name of version 2 is an automatic script file of the test case 2 in a state that the case version number is version 2, and the script file 2 in the subfolder with the file name of version 3 is an automatic script file of the test case 2 in a state that the case version number is version 3.
Fig. 6 is a schematic flow chart of a test case obtaining method according to a preferred embodiment of the invention. In this embodiment of the present invention, the method for obtaining a test case may further include:
step S208, configuring the initial version data and the version difference data corresponding to each test case, and storing the script file of each test case of the corresponding version in the database 11.
Step S209, the inheritance relationship between the use case version numbers in the target test module is configured.
In this embodiment, the test terminal 10 may store the initial version data and the version difference data corresponding to each test case in the database 11 in the form of an initial version data table and a version difference data table, respectively, and store script files corresponding to each test case in different versions in the database 11 according to a predetermined folder. After the configuration operation of the initial version data and the version difference data corresponding to each test case and the storage operation of the script file of each test case corresponding to each version are completed, the test terminal 10 can configure the inheritance relationship between the version numbers of the cases in the target test module, and the specific inheritance relationship can be set by a tester according to the software test requirements.
Fig. 7 is a block diagram of the test case acquiring apparatus 100 shown in fig. 1 according to a preferred embodiment of the present invention. In the embodiment of the present invention, an initial version data table and a version difference data table are stored in the database 11 in the test terminal 10, the initial version data table is used for storing initial version data corresponding to each test case, and the version difference data table is used for storing version difference data between other versions of each test case and the initial version. Each test case corresponds to an initial version data table and a version difference data table of a corresponding version. The test case acquiring apparatus 100 may include: a request receiving module 110, a version number searching module 120, a data obtaining module 130 and a use case generating module 140.
The request receiving module 110 is configured to receive a test case obtaining request, where the test case obtaining request includes a name of a target test module and a target version number corresponding to the target test module.
In this embodiment, the request receiving module 110 may execute step S210 in fig. 2, and the detailed description may refer to the above detailed description of step S210.
The version number searching module 120 is configured to search, according to the target version number, a case version number of each test case that matches the target version number from the version number set of the target testing module.
In this embodiment, the manner for the version number searching module 120 to search, according to the target version number, a case version number of each test case matching the target version number from the version number set of the target test module includes:
searching whether a case version identical to the target version number exists in all case version numbers corresponding to the test cases;
if yes, acquiring a case number and a case version number of the corresponding test case;
and if not, taking the parent version number corresponding to the target version number as the case version number of the corresponding test case according to the inheritance relationship among the case version numbers, and acquiring the corresponding case number.
In this embodiment, the version number lookup module 120 may execute step S220 in fig. 2 and sub-steps S221, S222, and S223 in fig. 3, and the detailed description may refer to the above detailed description of step S220, S221, S222, and S223.
The data obtaining module 130 is configured to search, in the database 11, initial version data corresponding to each test case and version difference data corresponding to the case version number of each test case according to the case number of each test case and the searched case version number.
In this embodiment, the data obtaining module 130 may execute step S230 in fig. 2, and the detailed description may refer to the above detailed description of step S230.
The case generating module 140 is configured to generate a test case of each corresponding version in the target test module according to the initial version data and the version difference data of each test case, so as to perform a software test.
In this embodiment, the manner for the use case generating module 140 to generate the test use cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test use case includes:
and replacing corresponding contents in the initial version data according to the acquired version difference data of each test case, so as to obtain the test case of the corresponding version.
In this embodiment, the use case generating module 140 may execute step S240 in fig. 2, and the specific description may refer to the above detailed description of step S240.
Fig. 8 is a block diagram of a second example of the test case acquiring apparatus 100 shown in fig. 1 according to the preferred embodiment of the present invention. In this embodiment of the present invention, the test case obtaining apparatus 100 may further include a script searching module 150.
The script searching module 150 is configured to search, according to the automated script name corresponding to each test case and the searched case version number, a script file corresponding to each test case with the comparison version in the database 11, so as to perform a software test.
In this embodiment, the database 11 includes a folder with a file name identical to that of the target test module, where the folder stores therein an initial script file corresponding to each test case and a subfolder with a file name identical to a case version number, where the subfolder stores therein script files corresponding to each test case of a corresponding version. The method for searching the script file corresponding to the test case of each comparison version in the database 11 by the script searching module 150 according to the automatic script name corresponding to each test case and the searched case version number includes:
searching a folder with the same file name as the name of the target test module in the database 11;
judging whether the version number of each use case is an initial version number or not;
if the version number is the initial version number, directly extracting a corresponding initial script file from the folder according to the automatic script name of the corresponding test case, and using the initial script file as a script file corresponding to the test case of each corresponding version;
if the version number is not the initial version number, a subfolder with the file name being the same as the case version number is searched in the folder, and a corresponding script file is extracted from the subfolder according to the automatic script name of the corresponding test case and is used as the script file corresponding to the test case of each corresponding version.
In this embodiment, the script searching module 150 may execute step S250 in fig. 4 and sub-step S251, sub-step S252, sub-step S253, and sub-step S254 in fig. 5, and the detailed description may refer to the above detailed description of step S250, sub-step S251, sub-step S252, sub-step S253, and sub-step S254.
Fig. 9 is a block diagram of a third block diagram of the test case acquiring apparatus 100 shown in fig. 1 according to the preferred embodiment of the invention. In this embodiment of the present invention, the test case obtaining apparatus 100 may further include a data storage module 160 and a relationship configuration module 170.
The data storage module 160 is configured to configure initial version data and version difference data corresponding to each test case, and store script files of the test cases of each corresponding version in the database 11.
The relationship configuration module 170 is configured to configure an inheritance relationship between the use case version numbers in the target test module.
In summary, in the test case acquisition method and the test case acquisition device provided in the preferred embodiment of the present invention, the test case acquisition method has low storage resource consumption and high test case calling efficiency, and can automatically generate the test case of the corresponding version according to the requirement of the tester to perform the software test, thereby reducing the workload of the tester and improving the software test efficiency. Specifically, the method searches a case version number of each test case matched with a target version number from a version number set of a target test module by receiving a test case acquisition request and according to the target version number corresponding to the target test module included in the test case acquisition request; searching initial version data corresponding to each test case and version difference data corresponding to the case version number of each test case in a database according to the case number of each test case and the searched case version number; and generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test, thereby reducing the workload of testers and improving the software test efficiency.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A test case obtaining method is applied to a test terminal, the test terminal comprises a database, an initial version data table and a version difference data table are stored in the database, the initial version data table is used for storing initial version data corresponding to each test case, the version difference data table is used for storing version difference data between other versions and the initial version of each test case, and the method comprises the following steps:
receiving a test case obtaining request, wherein the test case obtaining request comprises a target test module name and a target version number corresponding to a target test module;
searching a case version number of each test case matched with the target version number from the version number set of the target test module according to the target version number;
according to the case numbers of the test cases and the searched case version numbers, searching initial version data corresponding to the test cases and version difference data corresponding to the case version numbers of the test cases in a database;
and generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test.
2. The method of claim 1, wherein the set of version numbers of the target test module includes all case version numbers corresponding to the test cases, and the step of searching for the case version number of each test case matching the target version number from the set of version numbers of the target test module according to the target version number of the target test module includes:
searching whether a case version number identical to the target version number exists in all case version numbers corresponding to the test cases;
if yes, acquiring a case number and a case version number of the corresponding test case;
and if not, taking the parent version number corresponding to the target version number as the case version number of the corresponding test case according to the inheritance relationship among the case version numbers, and acquiring the corresponding case number.
3. The method according to claim 1, wherein the step of generating the test cases of the corresponding versions in the target test module according to the initial version data and the version difference data of the test cases comprises:
and replacing corresponding contents in the initial version data according to the acquired version difference data of each test case, so as to obtain the test case of the corresponding version.
4. The method of claim 1, wherein the database further includes a folder having a same file name as a target test module name, and wherein the folder stores therein an initial script file corresponding to each test case, and a subfolder having a same file name as a case version number, and wherein the subfolder stores therein a script file corresponding to each test case of a corresponding version, the method further comprising:
and searching a script file corresponding to the test case of each comparison version in the database according to the automatic script name corresponding to each test case and the searched case version number so as to perform software test.
5. The method according to claim 4, wherein the step of searching the script file corresponding to the test case of each comparison version in the database according to the automatic script name corresponding to each test case and the searched case version number comprises:
searching a folder with the same file name as the name of the target test module in a database;
judging whether the version number of each use case is an initial version number or not;
if the version number is the initial version number, directly extracting a corresponding initial script file from the folder according to the automatic script name of the corresponding test case, and using the initial script file as a script file corresponding to the test case of each corresponding version;
if the version number is not the initial version number, a subfolder with the file name being the same as the case version number is searched in the folder, and a corresponding script file is extracted from the subfolder according to the automatic script name of the corresponding test case and is used as the script file corresponding to the test case of each corresponding version.
6. The method of claim 4, further comprising:
configuring initial version data and version difference data corresponding to each test case, and storing script files of the test cases of each corresponding version in a database;
and configuring the inheritance relationship among the use case version numbers in the target test module.
7. A test case obtaining device is applied to a test terminal, the test terminal comprises a database, an initial version data table and a version difference data table are stored in the database, the initial version data table is used for storing initial version data corresponding to each test case, the version difference data table is used for storing version difference data between other versions and the initial version of each test case, and the device comprises:
the device comprises a request receiving module, a test case obtaining module and a test case obtaining module, wherein the request receiving module is used for receiving a test case obtaining request, and the test case obtaining request comprises a target test module name and a target version number corresponding to a target test module;
the version number searching module is used for searching the case version number of each test case matched with the target version number from the version number set of the target testing module according to the target version number;
the data acquisition module is used for searching the initial version data corresponding to each test case and the version difference data corresponding to the case version number of each test case in the database according to the case number of each test case and the searched case version number;
and the case generating module is used for generating the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case so as to perform software test.
8. The apparatus of claim 7, wherein the set of version numbers of the target test module includes all case version numbers corresponding to the test cases, and the manner in which the version number lookup module looks up the case version number of each test case matching the target version number from the set of version numbers of the target test module according to the target version number of the target test module includes:
searching whether a case version number identical to the target version number exists in all case version numbers corresponding to the test cases;
if yes, acquiring a case number and a case version number of the corresponding test case;
and if not, taking the parent version number corresponding to the target version number as the case version number of the corresponding test case according to the inheritance relationship among the case version numbers, and acquiring the corresponding case number.
9. The apparatus of claim 7, wherein the manner for the case generation module to generate the test cases of each corresponding version in the target test module according to the initial version data and the version difference data of each test case comprises:
and replacing corresponding contents in the initial version data according to the acquired version difference data of each test case, so as to obtain the test case of the corresponding version.
10. The apparatus of claim 7, wherein the database further includes a folder having a same file name as a target test module name, and wherein the folder stores therein an initial script file corresponding to each test case, and a subfolder having a same file name as a case version number, and wherein the subfolder stores therein a script file corresponding to each test case of a corresponding version, the apparatus comprising:
and the script searching module is used for searching a script file corresponding to the test case of each comparison version in the database according to the automatic script name corresponding to each test case and the searched case version number so as to perform software test.
11. The apparatus of claim 10, wherein the manner for the script searching module to search the script file corresponding to the test case of each comparison version in the database according to the automatic script name corresponding to each test case and the searched case version number comprises:
searching a folder with the same file name as the name of the target test module in a database;
judging whether the version number of each use case is an initial version number or not;
if the version number is the initial version number, directly extracting a corresponding initial script file from the folder according to the automatic script name of the corresponding test case, and using the initial script file as a script file corresponding to the test case of each corresponding version;
if the version number is not the initial version number, a subfolder with the file name being the same as the case version number is searched in the folder, and a corresponding script file is extracted from the subfolder according to the automatic script name of the corresponding test case and is used as the script file corresponding to the test case of each corresponding version.
12. The apparatus of claim 10, further comprising:
the data storage module is used for configuring the initial version data and the version difference data corresponding to each test case and storing the script file of each test case with the corresponding version in the database;
and the relationship configuration module is used for configuring the inheritance relationship among the use case version numbers in the target test module.
CN201710703776.3A 2017-08-16 2017-08-16 Test case obtaining method and device Active CN109408355B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710703776.3A CN109408355B (en) 2017-08-16 2017-08-16 Test case obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710703776.3A CN109408355B (en) 2017-08-16 2017-08-16 Test case obtaining method and device

Publications (2)

Publication Number Publication Date
CN109408355A CN109408355A (en) 2019-03-01
CN109408355B true CN109408355B (en) 2022-02-22

Family

ID=65454606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710703776.3A Active CN109408355B (en) 2017-08-16 2017-08-16 Test case obtaining method and device

Country Status (1)

Country Link
CN (1) CN109408355B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287105A (en) * 2019-05-22 2019-09-27 平安普惠企业管理有限公司 Document version test method, device, equipment and readable storage medium storing program for executing
CN110908898B (en) * 2019-11-06 2023-07-21 贝壳找房(北京)科技有限公司 Method and system for generating test scheme
CN113918441B (en) * 2020-07-09 2024-10-29 福建天泉教育科技有限公司 Test method and system for verifying app version
CN112181482B (en) * 2020-09-29 2023-03-21 平安科技(深圳)有限公司 Version verification method and device, electronic equipment and storage medium
CN112612694B (en) * 2020-12-17 2024-11-29 广州橙行智动汽车科技有限公司 Data detection method and device and electronic equipment
CN113590394A (en) * 2021-07-09 2021-11-02 深圳Tcl新技术有限公司 Joint debugging test method and device, electronic equipment and storage medium
CN117806981B (en) * 2024-03-01 2024-05-07 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Method for automatically leading in test cases
CN101859273A (en) * 2009-04-07 2010-10-13 西门子(中国)有限公司 Method and device for generating test cases
CN103198010A (en) * 2012-01-06 2013-07-10 腾讯科技(深圳)有限公司 Software testing method, device and system
EP2637093A1 (en) * 2012-03-06 2013-09-11 Sap Ag Automatically checking the validity of generated test cases after test-model changes
CN103793326A (en) * 2014-01-28 2014-05-14 福建星网锐捷网络有限公司 Assembly test method and device
CN103984769A (en) * 2014-06-04 2014-08-13 成都美美臣科技有限公司 Use-case data management and storage method
CN104536889A (en) * 2014-12-26 2015-04-22 北京奇虎科技有限公司 Method and system for testing user interface, use case management platform and operating terminal
CN105528293A (en) * 2015-12-14 2016-04-27 苏州洞察云信息技术有限公司 System and method for selecting test case for regression test

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050086565A1 (en) * 2003-10-01 2005-04-21 Thompson Ryan C. System and method for generating a test case
US8893089B2 (en) * 2006-10-09 2014-11-18 Sap Se Fast business process test case composition
CN102622294B (en) * 2011-01-28 2014-12-10 国际商业机器公司 Method and method for generating test cases for different test types
WO2014053177A1 (en) * 2012-10-04 2014-04-10 Rohde & Schwarz Gmbh & Co. Kg A method and a test system for automatically configuring a tester

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Method for automatically leading in test cases
CN101859273A (en) * 2009-04-07 2010-10-13 西门子(中国)有限公司 Method and device for generating test cases
CN103198010A (en) * 2012-01-06 2013-07-10 腾讯科技(深圳)有限公司 Software testing method, device and system
EP2637093A1 (en) * 2012-03-06 2013-09-11 Sap Ag Automatically checking the validity of generated test cases after test-model changes
CN103793326A (en) * 2014-01-28 2014-05-14 福建星网锐捷网络有限公司 Assembly test method and device
CN103984769A (en) * 2014-06-04 2014-08-13 成都美美臣科技有限公司 Use-case data management and storage method
CN104536889A (en) * 2014-12-26 2015-04-22 北京奇虎科技有限公司 Method and system for testing user interface, use case management platform and operating terminal
CN105528293A (en) * 2015-12-14 2016-04-27 苏州洞察云信息技术有限公司 System and method for selecting test case for regression test

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Reducing cost in regression testing of web service;Animesh Chaturvedi;《2012 CSI Sixth International Conference on Software Engineering (CONSEG)》;20121112;第1-9页 *
Regression Test Cases Generation Based on Automatic Model Revision;Nan Ye;《2012 Sixth International Symposium on Theoretical Aspects of Software Engineering》;20120816;第127-134页 *
基于软件代码差异分析的智能模糊测试;王嘉捷等;《清华大学学报》;20131215;第53卷(第12期);第1726-1730页 *

Also Published As

Publication number Publication date
CN109408355A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109408355B (en) Test case obtaining method and device
CN110795192B (en) Language switching method and device and terminal equipment
CN106648685B (en) Intelligent terminal system application processing method and device and intelligent terminal
CN111597110B (en) Page test method and device, electronic equipment and storage medium
CN111858581B (en) Paging query method and device, storage medium and electronic equipment
CN109800119A (en) A kind of product function test method and device
CN112996020A (en) Bluetooth-based automatic testing method and device and Bluetooth testing terminal
CN110297764B (en) Vulnerability test model training method and device
CN112115063B (en) Software localization test method, device, terminal and storage medium
CN106598649A (en) Application program installation method and device, and electronic equipment
CN109446077A (en) A kind of data library test method and device
CN113051105A (en) Data processing method, device, equipment and storage medium
CN108600042B (en) WiFi test method and device for electronic equipment, storage medium and test equipment
CN107145375B (en) Kernel loading method, device, system, user terminal and storage medium
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN113341300B (en) Matrix key circuit automatic detection method, device, medium and equipment
CN115004667B (en) Information pushing method, device, electronic equipment and computer readable medium
CN113849524A (en) Data processing method and device
CN113238901A (en) Multi-device automatic testing method and device, storage medium and computer device
CN109688578B (en) Method and equipment for adapting SIM card and mobile terminal equipment
CN113901852A (en) Detection method and device for electronic equipment
CN112433778A (en) Mobile equipment page display method and device, electronic equipment and storage medium
CN107302605B (en) Configuration method and device of television proxy server, television and storage medium
CN116580748B (en) Configuration method, device, equipment and storage medium of memory chip test fixture
CN113760631A (en) Page loading duration determination method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant