CN115391220A - Test case generation method, device and equipment - Google Patents

Test case generation method, device and equipment Download PDF

Info

Publication number
CN115391220A
CN115391220A CN202211112192.6A CN202211112192A CN115391220A CN 115391220 A CN115391220 A CN 115391220A CN 202211112192 A CN202211112192 A CN 202211112192A CN 115391220 A CN115391220 A CN 115391220A
Authority
CN
China
Prior art keywords
test
scene
scenes
test case
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211112192.6A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Aich Technology Co Ltd
Original Assignee
Chengdu Aich 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 Chengdu Aich Technology Co Ltd filed Critical Chengdu Aich Technology Co Ltd
Priority to CN202211112192.6A priority Critical patent/CN115391220A/en
Publication of CN115391220A publication Critical patent/CN115391220A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

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 discloses a test case generation method, a test case generation device and test case generation equipment, relates to the field of software design, and is used for solving the problems that test points are not completely covered and test point omission is difficult to find in the prior art. The method comprises the following steps: acquiring a thought guide graph template, and inputting corresponding test points and test scenes into a first-level sub-node of the thought guide graph template; decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; generating an initial test case based on the test point set; and if the design scene of the initial test case does not cover all the test points and the test scene in the standard file, supplementing a new design scene based on the standard file and the historical experience data until all the test points and the test scene are covered, and generating a target test case. All scenes and test points covered by the test cases can be quickly determined, the logic is strong, the omitted test scenes can be easily found and timely supplemented, and therefore the scene coverage rate of the test cases is improved.

Description

Test case generation method, device and equipment
Technical Field
The invention relates to the technical field of software design, in particular to a test case generation method, a test case generation device and test case generation equipment.
Background
With the continuous development of the internet technology, more and more software is developed, and how to carry out efficient and valuable tests under the rapid iteration rhythm is a great challenge to the tests to ensure that the service functions are normal. In addition, the software scale and complexity are rapidly increased, and the application of automatic testing is more and more extensive. Automated testing is a testing behavior executed by a machine, however, a large number of test cases are generally required to be used in the process of automated testing, and different test cases are often required in different business scenarios. Therefore, it is very important for generating test cases. A Test Case (Test Case) is a set of Test inputs, execution conditions, and expected results tailored for a particular target to verify whether a particular software requirement is met.
The requirement of users on the quality of software is higher and higher, the tolerance to software defects in the using process is lower and lower, the defects in the software are reduced, the user experience is improved, and the core competitiveness of each product is formed. The software testing is an essential link for ensuring the software quality, so that the software testing quality is improved, and the testing omission is reduced, so that the software quality is effectively improved, and the problem which needs to be solved urgently at present is solved.
Therefore, it is desirable to provide a more reliable test case generation scheme.
Disclosure of Invention
The invention aims to provide a test case generation method, a test case generation device and test case generation equipment, which are used for solving the problems that test points are not completely covered and test point omission is difficult to find in the prior art.
In order to achieve the above purpose, the invention provides the following technical scheme:
in a first aspect, the present invention provides a test case generating method, including:
acquiring a thought guide graph template, and inputting test points and test scenes corresponding to the thought guide graph template into a primary sub-node of the thought guide graph template; the test scenes at least comprise functional test scenes;
decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
generating an initial test case based on the test point set;
and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and the test scenes are covered, and generating a target test case.
Optionally, if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on a standard file and historical experience data until all the preset test points and test scenes are covered, and before generating a target test case, the method further includes:
judging whether the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises test scenes needing to be covered; the historical experience data at least comprises historical application scene data of related users;
if the design scene in the initial test case covers all the test points in the software specification and all the test scenes in the standard file, supplementing the design scene based on historical experience data until all the preset test points and the preset test scenes are covered, and generating a target test case;
and if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data, determining the initial test case as the target test case.
Optionally, the test scenario at least includes a test mode scenario and an application field scenario; the test mode scenario includes: the system comprises a function test scene, a compatibility test scene, a safety test scene, a long-term test scene and an upper and lower electric test scene.
Optionally, if the design scene of the initial test case does not cover all the test points and the test scene, based on historical experience data, supplementing a new design scene until all the preset test points and the preset test scene are covered, and generating a target test case, specifically including:
after a new design scene is added in the mind map template, outputting the mind map branches to generate a target test case; one said mind map branch corresponding to one said test scenario;
and storing the test scene in the mind map into a test case table according to the format of the target test case.
Optionally, decomposing each test point into a test point set with a single attribute according to a preset decomposition rule, specifically including:
and for any test scene, decomposing the test points according to the functional dimension until the decomposed small test points correspond to the object with the minimum dimension.
Optionally, before generating an initial test case based on the test point set, the method further includes:
selecting a corresponding design method of the black box test case, constructing test data, combing the test steps and determining an expected result.
In a second aspect, the present invention provides a test case generation apparatus, including:
the thinking guide map template acquisition module is used for acquiring a thinking guide map template and inputting test points and test scenes corresponding to the thinking guide map template into a primary sub-node of the thinking guide map template; the test scenes at least comprise functional test scenes;
the test point decomposition module is used for decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
the initial test case generating module is used for generating an initial test case based on the test point set;
and the target case generation module is used for supplementing a new design scene based on a standard file and historical experience data if the design scene of the initial test case does not cover all the preset test points and the preset test scene, and generating a target test case until all the preset test points and the preset test scene are covered.
Optionally, the apparatus further includes:
the judging module is used for judging whether the design scene in the initial test case covers all the test points in the software specification and all the test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises test scenes needing to be covered; the historical experience data at least comprises historical application scene data of related users;
the design scene supplement module is used for supplementing a design scene based on historical experience data if the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file;
and the target test case determining module is used for determining the initial test case as the target test case if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data.
In a third aspect, the present invention provides a test case generating device, including:
a communication unit/communication interface for obtaining a mind map template;
the processing unit/processor is used for inputting test points and test scenes corresponding to the mind map template into a primary sub-node of the mind map template; the test scenes at least comprise functional test scenes;
decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
generating an initial test case based on the test point set;
and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and the test scenes are covered, and generating a target test case.
In a fourth aspect, the present invention provides a computer storage medium, where instructions are stored, and when the instructions are executed, the method for generating test cases is implemented.
Compared with the prior art, the invention provides a test case generation method, a test case generation device and test case generation equipment. The method comprises the steps of obtaining a thought guide graph template, and inputting test points and test scenes corresponding to the thought guide graph template into a first-level sub-node of the thought guide graph template; decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; generating an initial test case based on the test point set; and if the design scene of the initial test case does not cover all the test points and the test scene in the standard file, supplementing a new design scene based on the standard file and the historical experience data until all the test points and the test scene are covered, and generating a target test case. The test case is generated based on the mind map template, and after the test points are decomposed, each small test point corresponds to one test scene, so that all scenes and test points covered by the test case can be quickly determined, the logic is strong, the omitted test scenes can be easily found and timely supplemented, the scene coverage rate of the test case is improved, the development cycle of the test case is shortened, and the software quality is fundamentally improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic flow diagram of a test case generation method provided by the present invention;
FIG. 2 is a schematic diagram of a thinking guide diagram template in the test case generation method provided by the present invention;
FIG. 3 is a diagram illustrating a mind map corresponding to the test case generation method provided by the present invention;
FIG. 4 is a schematic structural diagram of a test case generating device according to the present invention;
fig. 5 is a schematic structural diagram of a test case generating device provided in the present invention.
Detailed Description
In order to facilitate clear description of technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. For example, the first threshold and the second threshold are only used for distinguishing different thresholds, and the sequence order of the thresholds is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It is to be understood that the terms "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a alone, A and B together, and B alone, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b combination, a and c combination, b and c combination, or a, b and c combination, wherein a, b and c can be single or multiple.
In the prior art, in the test process of the APP software, to improve the use experience of the APP software, a test case needs to be designed separately for the actual use scene of a user, but under the condition that a specific application scene is unknown, a tester simulates the use process of the user according to personal experience, the designed scene test case cannot necessarily perform comprehensive analysis on an event stream, so that the designed case is incomplete, inaccurate or omits key high-frequency behaviors, and the test scheme is inaccurate; the design level of the test case is often in great relation with the working experience of the test personnel, and the coverage rate of the test case is difficult to guarantee under the condition that the experience of the test designer is insufficient.
In view of the above, the present invention provides a test case generation scheme. The problems that the test points of the black box test case are not completely covered, the logic is not clear, and the test points are difficult to find and omit in evaluation can be solved, the development period of the test case is shortened, and the compiling and evaluation efficiency of the test case is improved.
Next, the scheme provided by the embodiments of the present specification will be described with reference to the accompanying drawings:
fig. 1 is a schematic flow diagram of a test case generation method provided by the present invention, and as shown in fig. 1, the flow may include the following steps:
step 110: acquiring a thought guide diagram template, and inputting test points and test scenes corresponding to the thought guide diagram template into a primary sub-node of the thought guide diagram template; the test scenarios at least comprise functional test scenarios.
The Mind Map (The Mind Map), also known as Mind Map, brain Map and brain agitation Map, is an effective graph for expressing divergent thinking. May be an operation process of building branch nodes around a central topic. The method is an effective graphic thinking tool for expressing divergent thinking, is simple and efficient, and is a practical thinking tool. The mind map has many common display formats, such as logic map, tree group map, fishbone map, etc.
The test scenes at least comprise a test mode scene and an application field scene; the test mode scenario may include: the software testing method and the software testing system have the advantages that functional testing scenes, compatibility testing scenes, safety testing scenes, long-term testing scenes, power-on and power-off testing scenes and the like are considered, namely, multiple scenes are considered in the scheme, and even whether the scenes of compatibility testing, safety testing, long-term testing and the like are involved or not is considered, so that the testing cases with high scene coverage rate are designed for the scenes capable of covering different testing scenes and the scenes in the specific application field, and the software quality is improved.
Further, the mind map template may be described in conjunction with FIG. 2:
FIG. 2 is a schematic diagram of a thinking guide diagram template in the test case generation method provided by the present invention. As shown in fig. 2, taking an Eflash start test as an example, the test content is a test of three different start modes of the Eflash, and according to a thought guide diagram template, a corresponding test point, a user scenario, a function test, a compatibility test, a safety test, a long-term test, an electrical power-up and power-down test, and the like are found in the specification. The test point may be a specific user requirement, the ORDR in fig. 2 may represent the test point, and the ORDR in fig. 2 supports three startup modes, which are: the user scene can include SRAM, FLASH and BOOTROM: "start from sram during debugging", "start from embedded device", and "start from flash, boot flash behavior"; besides the ORDR and the user scene, the thinking guide diagram template can also input the scenes of a starting mode, an upper and lower electric test, a long-term test, a safety test, a compatibility test and the like.
Step 120: decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; and each small test point in the test point set corresponds to one test scene.
Each test point is decomposed into smaller test points under functional test until decomposed into a single attribute. The decomposition rule may be a preset dimension of the test scenario, a classification of actual use requirements, and the like, and specifically, a preset decomposition rule may be set according to the actual use scenario, for example: and decomposing each test point according to user requirements or product functions in documents such as software development guides, user manuals and the like. A single attribute may be understood as decomposing a test point into small test points of minimum dimension, for example: the test points used for the interface test are divided into test points corresponding to the interfaces first and then the test points are divided into test points corresponding to the parameters continuously when the test points are divided. The dimensions are expressed as: interface-parameters. The test points are decomposed into small test points corresponding to the minimum dimension (i.e. parameters).
Step 130: and generating an initial test case based on the test point set.
The initial test case may be generated based on the test point and the test scenario corresponding to the module in the software specification initially recorded in the first-level child node. That is, the initial test case may be a test case that requires test verification. In practical applications, ideally, if the initially recorded test points and the test scenario are detailed enough, the initial test case can be used as the target test case. However, in practical application, the initial test case may not cover all test scenarios, and the missing test scenarios can be determined intuitively through the thought-guiding diagram, so that the test scenarios can be supplemented and completed in time, as in step 140.
Step 140: and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and test scenes are covered, and generating a target test case.
And checking whether the design scene for testing covers all test points and test scenes in the software specification and is supplemented. In step 140, all the preset test points may be all the test points in the software specification, and the preset test scenario may be a test scenario in a standard file or a corresponding test scenario in historical experience data, where more specifically, the standard file may be a software development guide, a user manual, a guidance document, and the like, which are acquired in advance. The historical experience data may be historical experience data of a developer or an expert, and may include: the test case review standard, the test scene contained in the historical test case and the like.
On the basis of the initial test case, the test scene can be supplemented based on the standard file and the historical experience data, so that the scene coverage rate of the test case is improved.
The method in fig. 1 includes acquiring a thought chart template, and inputting test points and test scenes corresponding to the thought chart template into first-level sub-nodes of the thought chart template; decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; generating an initial test case based on the test point set; and if the design scene of the initial test case does not cover all the test points and the test scene in the standard file, supplementing a new design scene based on the standard file and the historical experience data until all the test points and the test scene are covered, and generating a target test case. The test case is generated based on the thinking guide diagram template, and after the test points are decomposed, each small test point corresponds to one test scene, so that all scenes and test points covered by the test case can be quickly determined, the logic is strong, the omitted test scenes are easy to find and timely supplemented, the scene coverage rate of the test case is improved, the development period of the test case is shortened, and the software quality is fundamentally improved.
Based on the method of fig. 1, the embodiments of the present specification also provide some specific implementations of the method, which are described below.
In a specific application process, when judging whether the test scene of the initial case covers the preset test point and the test scene, the judgment can be performed based on the standard file. Then, the judgment is continued based on the historical experience data, and next, a specific judgment process is explained:
if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on a standard file and historical experience data until all the preset test points and test scenes are covered, and before generating a target test case, the method may further include:
judging whether the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises a test scene to be covered; the historical experience data at least comprises historical application scene data of related users;
if the design scene in the initial test case covers all the test points in the software specification and all the test scenes in the standard file, supplementing the design scene based on historical experience data until all the preset test points and the preset test scenes are covered, and generating a target test case;
and if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data, determining the initial test case as the target test case.
In the implementation process, the design scenario is supplemented based on the standard file, and the standard file can be supplemented with a test scenario which is not covered by a test scenario corresponding to the initial test case, that is, the test scenario corresponding to the initial test case does not exist, but the test scenario existing in the standard file is supplemented into the mind map to form a new test case. In the same idea, the design scenario is supplemented based on the historical experience data, and the supplemented test scenario may be a test scenario not covered by the test scenario corresponding to the initial test case in the historical experience data, that is, the test scenario corresponding to the initial test case does not exist, but the test scenario existing in the historical experience data is supplemented to the mind map to form a new test case.
And if the standard file and the historical experience data both have test scenes which are not covered by the test scenes corresponding to the initial test cases, adding the test scenes which are not covered in the standard file and the historical experience data to the thinking guide graph to form a new test case.
If the test scene corresponding to the initial test case covers all the test scenes in the standard file and the historical experience data and covers all the test points in the software specification, the initial test case can be used as a target test case.
By the implementation method, the test scene can be supplemented and perfected based on the standard file and the historical experience data, so that the scene coverage rate of the test case is improved.
By adopting the scheme of the application, when the test case is generated based on the thinking guide diagram template, the following can be explained by combining the graph 3:
fig. 3 is a schematic diagram of a mind map corresponding to the test case generation method provided by the present invention. As shown in fig. 3, taking the Eflash boot test as an example, the test contents are the tests of three different boot modes of the Eflash. Specific configurations can be illustrated with reference to table 1:
TABLE 1 Start configuration Table
BOOT0(PAD) BOOT[1:0](OPTB) BOOT_SEL(OPTB) RDP BOOT FROM
0 xxb 0:from PAD 0/1 Main memory
1 1xb 0:from PAD 0/1 Boot memory
1 0xb 0:from PAD 0/1 SRAM
x x0b 1:from optionbyte 0/1 Main memory
x 11b 1:from optionbyte 0/1 Boot memory
x 01b 1:from optionbyte 0/1 SRAM
x xxb x 2 Main memory
The user scene can include: "start from sram during debugging", "start from embedded device", and "start from flash, boot flash behavior"; in addition to the ORDR and the user scenes, the thinking guide diagram template can also be used for entering scenes such as a starting mode, a power-on and power-off test, a long-term test, a safety test, a compatibility test and the like. Under the startup function test, with reference to table 1 and fig. 3, three startup modes may be included: SRAM boot, FLASH boot, and BOOTROM boot. Wherein, under SRAM startup:
BOOT0 (PAD) =1, BOOT 2 [1 ] (OPTB) =2, BOOT _sel (OPTB) bit =0, rdp =0/1, BOOT success.
BOOT0 (PAD) =0, BOOT 2 [1 ] (OPTB) =1, BOOT_sel (OPTB) bit =0, rdp =0/1, BOOT success;
and (4) setting the starting from the FLASH and the starting from the SRAM to be successful when the FLASH is empty and the SRAM is not empty.
Under FLASH startup:
BOOT0 (PAD) =0, BOOT 2 [1 ] (OPTB) =0, BOOT_sel (OPTB) bit =0, rdp =0/1, BOOT success;
BOOT0 (PAD) =1, BOOT 2 [1 ] (OPTB) =0, BOOT_sel (OPTB) bit =1, rdp =0/1, BOOT success;
BOOT0 (PAD) =1, BOOT 2 [1 ] (OPTB) =3, BOOT _sel (OPTB) bit =1, rdp =2, BOOT success.
BOOTROM starts up:
BOOT0 (PAD) =1, BOOT 2 [1 ] (OPTB) =2, BOOT_sel (OPTB) bit =0, rdp =0/1, BOOT success;
BOOT0 (PAD) =1, BOOT 2 [1 ] (OPTB) =3, BOOT _sel (OPTB) bit =1, rdp =0/1, BOOT success.
In the above-mentioned startup functional modes, each startup mode corresponds to corresponding configuration information. Besides the scenario of initiating the functional test, the mind map also includes other scenarios, such as: in the power-on and power-off test scene, power is off and then on in the starting process, normal starting can be carried out again, and abnormity such as starting failure does not occur. And in the long-term test, after standing for a long time, the test can be started normally again. The security test scenario is mainly applied to read-write protection.
In embodiments of the present description, each test point is decomposed into smaller test points under functional testing until decomposed into a single attribute. Specifically, in this embodiment, the test data can be decomposed into smaller test points according to the specification, user manual, and other data, an applicable black box test case method can be selected, test data can be constructed, test steps can be combed, and an expected result can be written. The black box test case method may include: the method includes an equivalence class division method, a boundary value analysis method, an error estimation method, a causal graph method, a decision table driving method, an orthogonal test design method, a functional graph method, a scene method and the like.
And designing specific test data according to the decomposed test points and relevant information in the user manual, and writing an expected result. And checking whether the design scene for testing covers all test points and test scenes in the software specification and supplementing.
Specifically, according to the decomposed test points and relevant information in the user manual, whether all specifications are covered or not is checked, then specific test data is designed, and expected results are written. Consider whether scenarios involving compatibility testing, security testing, long-term testing, etc. In particular, relevant scenarios that require replenishment may be determined based on historical empirical data of a developer or other expert. After the test case is generated, the test case can be evaluated, and the test case scene can be perfected and supplemented, specifically, automatic evaluation can be performed based on historical experience data of related personnel such as SE, development and the like during evaluation, and the corresponding related personnel such as SE, development and the like can also be found for evaluation, and the related test case scene can be perfected according to the evaluation result. Finally, generating a target test case according to the output mind map branches, specifically, after a new design scene is added in the mind map template, outputting the mind map branches to generate the target test case; one said mind map branch corresponding to one said test scenario; and storing the test scene in the mind map into a test case table according to the format of the target test case. For example: the SRAM start in the start-up functional test of fig. 3 may correspond to a branch, which corresponds to an SRAM start-up test scenario.
In the embodiment, the design of the thinking guide diagram is combined and the black box test case is generated, so that the problems that no logic exists in the design of the black box test case and the test scene is easy to omit in the prior art are solved. The scene coverage rate of the test cases is improved, the development period of the test cases is shortened, the compiling and reviewing efficiency of the test cases is improved, and therefore the software quality is fundamentally improved.
Based on the same idea, the present invention further provides a test case generating apparatus, as shown in fig. 4, the apparatus may include:
the thinking guide diagram template obtaining module 410 is configured to obtain a thinking guide diagram template, and record test points and test scenes corresponding to the thinking guide diagram template in a first-level child node of the thinking guide diagram template; the test scenes at least comprise functional test scenes;
the test point decomposition module 420 is configured to decompose each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
an initial test case generating module 430, configured to generate an initial test case based on the test point set;
and a target case generation module 440, configured to, if the design scene of the initial test case does not cover all preset test points and test scenes, supplement a new design scene based on a standard file and historical experience data until all preset test points and test scenes are covered, and generate a target test case.
Based on the device in fig. 4, some specific implementation units may also be included:
optionally, the apparatus may further include:
the judging module is used for judging whether the design scene in the initial test case covers all the test points in the software specification and all the test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises a test scene to be covered; the historical experience data at least comprises historical application scene data of related users;
a design scene supplement module, configured to supplement a design scene based on historical experience data until all preset test points and test scenes are covered and a target test case is generated if the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file;
and the target test case determining module is used for determining the initial test case as a target test case if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data.
Optionally, the test scenario may at least include a test mode scenario and an application field scenario; the test mode scenario may include: the system comprises a function test scene, a compatibility test scene, a safety test scene, a long-term test scene and an upper and lower electric test scene.
Optionally, the target use case generating module 440 may specifically include:
the target test case generation unit is used for outputting the thinking guide diagram branches to generate a target test case after a new design scene is added in the thinking guide diagram template; one said mind map branch corresponding to one said test scenario;
and the test scene storage unit is used for storing the test scene in the mind map into a test case table according to the format of the target test case.
Optionally, the test point decomposition module 420 may specifically include:
and the test point decomposition unit is used for decomposing the test points according to the functional dimension for any test scene until the decomposed small test points correspond to the object with the minimum dimension.
Optionally, the apparatus may be further configured to: selecting a corresponding black box test case design method, constructing test data, combing the test steps and determining an expected result.
Based on the same idea, the embodiments of the present specification further provide a test case generation device. As shown in fig. 5. The method can comprise the following steps:
a communication unit/communication interface for obtaining a mind map template;
the processing unit/processor is used for inputting test points and test scenes corresponding to the mind map template into a primary sub-node of the mind map template; the test scenes at least comprise functional test scenes;
decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
generating an initial test case based on the test point set;
and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and the test scenes are covered, and generating a target test case.
As shown in fig. 5, the terminal device may further include a communication line. The communication link may include a path for transmitting information between the aforementioned components.
Optionally, as shown in fig. 5, the terminal device may further include a memory. The memory is used for storing computer-executable instructions for implementing the inventive arrangements and is controlled by the processor for execution. The processor is used for executing the computer execution instructions stored in the memory, thereby realizing the method provided by the embodiment of the invention.
As shown in fig. 5, the memory may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to. The memory may be separate and coupled to the processor via a communication link. The memory may also be integrated with the processor.
Optionally, the computer execution instruction in the embodiment of the present invention may also be referred to as an application program code, which is not specifically limited in the embodiment of the present invention.
In one implementation, as shown in FIG. 5, a processor may include one or more CPUs, such as CPU0 and CPU1 in FIG. 5, for example.
In one embodiment, as shown in fig. 5, the terminal device may include a plurality of processors, such as the processor in fig. 5. Each of these processors may be a single core processor or a multi-core processor.
Based on the same idea, embodiments of the present specification further provide a computer storage medium corresponding to the foregoing embodiments, where the computer storage medium stores instructions, and when the instructions are executed, the method in the foregoing embodiments is implemented.
The above description mainly introduces the scheme provided by the embodiment of the present invention from the perspective of interaction between the modules. It is understood that each module, in order to implement the above functions, includes a corresponding hardware structure and/or software unit for performing each function. Those of skill in the art will readily appreciate that the present invention can be implemented in hardware or a combination of hardware and computer software, with the exemplary elements and algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The embodiment of the present invention may perform the division of the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The processor in this specification may also have the function of a memory. The memory is used for storing computer-executable instructions for implementing the inventive arrangements and is controlled for execution by the processor. The processor is used for executing the computer execution instructions stored in the memory, thereby realizing the method provided by the embodiment of the invention.
The memory may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be separate and coupled to the processor via a communication link. The memory may also be integral to the processor.
Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in this embodiment of the present invention.
The method disclosed by the embodiment of the invention can be applied to a processor or realized by the processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor may be a general purpose processor, a Digital Signal Processor (DSP), an ASIC, an FPGA (field-programmable gate array) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
In one possible implementation, a computer-readable storage medium is provided, in which instructions are stored, and when executed, are used to implement the method in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the procedures or functions described in the embodiments of the present invention are performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, a terminal, a user device, or other programmable apparatus. The computer program or instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The usable medium may be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape; or optical media such as Digital Video Disks (DVDs); it may also be a semiconductor medium, such as a Solid State Drive (SSD).
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A test case generation method is characterized by comprising the following steps:
acquiring a thought guide diagram template, and inputting test points and test scenes corresponding to the thought guide diagram template into a primary sub-node of the thought guide diagram template; the test scenes at least comprise functional test scenes;
decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
generating an initial test case based on the test point set;
and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and the test scenes are covered, and generating a target test case.
2. The method of claim 1, wherein if the design scenario of the initial test case does not cover all of the preset test points and test scenarios, supplementing a new design scenario based on a standard file and historical experience data until all of the preset test points and test scenarios are covered and before generating a target test case, further comprising:
judging whether the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises test scenes needing to be covered; the historical experience data at least comprises historical application scene data of related users;
if the design scene in the initial test case covers all the test points in the software specification and all the test scenes in the standard file, supplementing the design scene based on historical experience data until all the preset test points and the preset test scenes are covered, and generating a target test case;
and if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data, determining the initial test case as the target test case.
3. The method of claim 1, wherein the test scenarios comprise at least a test mode scenario and an application domain scenario; the test mode scenario includes: the system comprises a function test scene, a compatibility test scene, a safety test scene, a long-term test scene and an upper and lower electric test scene.
4. The method according to claim 1, wherein if the design scenario of the initial test case does not cover all the preset test points and test scenarios, supplementing a new design scenario based on a standard file and historical experience data until all the preset test points and the preset test scenarios are covered, and generating a target test case specifically comprises:
after a new design scene is added in the mind map template, outputting the mind map branches to generate a target test case; one said mind map branch corresponding to one said test scenario;
and storing the test scene in the mind map into a test case table according to the format of the target test case.
5. The method of claim 2, wherein decomposing each test point into a set of test points with a single attribute according to a preset decomposition rule specifically comprises:
and for any test scene, decomposing the test points according to the functional dimension until the decomposed small test points correspond to the object with the minimum dimension.
6. The method of claim 1, wherein before generating an initial test case based on the set of test points, further comprising:
selecting a corresponding black box test case design method, constructing test data, combing the test steps and determining an expected result.
7. A test case generation apparatus, comprising:
the thinking guide map template acquisition module is used for acquiring a thinking guide map template and inputting test points and test scenes corresponding to the thinking guide map template into a primary sub-node of the thinking guide map template; the test scenes at least comprise functional test scenes;
the test point decomposition module is used for decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
the initial test case generation module is used for generating an initial test case based on the test point set;
and the target case generation module is used for supplementing a new design scene based on a standard file and historical experience data if the design scene of the initial test case does not cover all the preset test points and the test scene until all the preset test points and the test scene are covered, and generating a target test case.
8. The apparatus of claim 7, further comprising:
the judging module is used for judging whether the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file; the standard file is a file acquired in advance, and at least comprises a test scene to be covered; the historical experience data at least comprises historical application scene data of related users;
the design scene supplement module is used for supplementing a design scene based on historical experience data if the design scene in the initial test case covers all test points in the software specification and all test scenes in the standard file;
and the target test case determining module is used for determining the initial test case as a target test case if the design scene in the initial test case can cover all the test points in the software specification and can also cover all the test scenes in the standard file and the historical experience data.
9. A test case generation apparatus, characterized by comprising:
a communication unit/communication interface for obtaining a mind map template;
the processing unit/processor is used for inputting test points and test scenes corresponding to the mind map template into a primary sub-node of the mind map template; the test scenes at least comprise functional test scenes;
decomposing each test point into a test point set with a single attribute according to a preset decomposition rule; each small test point in the test point set corresponds to a test scene;
generating an initial test case based on the test point set;
and if the design scene of the initial test case does not cover all the preset test points and test scenes, supplementing a new design scene based on the standard file and the historical experience data until all the preset test points and the test scenes are covered, and generating a target test case.
10. A computer storage medium having instructions stored therein, wherein the instructions, when executed, implement the test case generation method of any one of claims 1 to 6.
CN202211112192.6A 2022-09-13 2022-09-13 Test case generation method, device and equipment Pending CN115391220A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211112192.6A CN115391220A (en) 2022-09-13 2022-09-13 Test case generation method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211112192.6A CN115391220A (en) 2022-09-13 2022-09-13 Test case generation method, device and equipment

Publications (1)

Publication Number Publication Date
CN115391220A true CN115391220A (en) 2022-11-25

Family

ID=84126846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211112192.6A Pending CN115391220A (en) 2022-09-13 2022-09-13 Test case generation method, device and equipment

Country Status (1)

Country Link
CN (1) CN115391220A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840715A (en) * 2023-02-27 2023-03-24 北京徐工汉云技术有限公司 Software test management method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840715A (en) * 2023-02-27 2023-03-24 北京徐工汉云技术有限公司 Software test management method, device and storage medium

Similar Documents

Publication Publication Date Title
US8819642B2 (en) Method and system for generating and processing black box test cases
CN109871326B (en) Script recording method and device
US9747190B2 (en) Analysis system, analysis method, and computer program product
US7904843B2 (en) Systematic generation of scenarios from specification sheet
CN104246714A (en) Software defect verification
CN111158656B (en) Test code generation method and device based on fruit tree method
CN110554962A (en) Regression testing process covering method, server and computer readable storage medium
CN111382070A (en) Compatibility testing method and device, storage medium and computer equipment
CN112882930B (en) Automatic test method and device, storage medium and electronic equipment
CN109344074B (en) Cross-platform automatic testing method and system
CN110597704B (en) Pressure test method, device, server and medium for application program
CN115080398A (en) Automatic interface test system and method
CN105512562B (en) Vulnerability mining method and device and electronic equipment
CN115658529A (en) Automatic testing method for user page and related equipment
CN115391220A (en) Test case generation method, device and equipment
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN111143228B (en) Test code generation method and device based on decision table method
CN112860587A (en) UI automatic test method and device
CN112084108A (en) Test script generation method and device and related components
CN111767210A (en) Policy testing method and device, computer equipment and storage medium
CN115470152A (en) Test code generation method, test code generation device, and storage medium
CN113672509A (en) Automatic testing method, device, testing platform and storage medium
CN114020604A (en) Workflow-based automatic testing method and device
CN113051262A (en) Data quality inspection 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