CN113672518B - Test case construction method and related equipment - Google Patents
Test case construction method and related equipment Download PDFInfo
- Publication number
- CN113672518B CN113672518B CN202111042797.8A CN202111042797A CN113672518B CN 113672518 B CN113672518 B CN 113672518B CN 202111042797 A CN202111042797 A CN 202111042797A CN 113672518 B CN113672518 B CN 113672518B
- Authority
- CN
- China
- Prior art keywords
- resource
- functional
- tested
- test case
- product
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test 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)
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Abstract
The test case construction method and the related equipment provided by the disclosure can obtain at least one functional resource to be tested selected by a user; determining a first operation behavior corresponding to each functional resource to be tested; utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested; determining a second operation behavior corresponding to each other functional resource; and constructing a test case according to each functional resource to be tested, the first operation behavior corresponding to the functional resource and the second operation behavior corresponding to each other functional resource. According to the method and the device, through the functional resources to be tested selected by the user, other functional resources related to the functional resources to be tested are determined by utilizing the pre-built functional resource relation tree, and the operation behaviors corresponding to the functional resources are matched, so that the construction of the test cases is completed, the problem that the creation operation of the test cases is not uniform under different scenes is solved, the construction difficulty of the test cases is reduced, and the overall test efficiency is improved.
Description
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a test case construction method and related equipment.
Background
Test Case refers to the description of a Test task performed on a particular software product. Briefly, a test case is a set of test inputs, execution conditions, and expected results tailored for a particular goal to verify that a particular software requirement is met.
At present, for the test cases for realizing the same target, the creation operation needs to be performed in a front-end system and a back-end system which are independent of each other, and because the operations of creating the test cases in the front-end system and the back-end system are different, the construction difficulty of the test cases is high, and the overall test efficiency is low.
Disclosure of Invention
In view of the above problems, the present disclosure provides a test case construction method and related equipment for overcoming the above problems or at least partially solving the above problems, where the technical solutions are as follows:
a test case construction method comprises the following steps:
obtaining at least one functional resource to be tested selected by a user;
Determining a first operation behavior corresponding to each functional resource to be tested;
utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested;
determining a second operation behavior corresponding to each other functional resource;
and constructing a test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested and the second operation behavior corresponding to the other functional resources.
Optionally, the constructing a test case according to each functional resource to be tested and the corresponding first operation behavior thereof and the corresponding second operation behavior of each other functional resource includes:
And configuring and asserting part or all of the first operation behaviors and/or configuring and asserting part or all of the second operation behaviors to construct a test case.
Optionally, before the obtaining the at least one functional resource to be tested selected by the user, the test case construction method further includes:
Analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource;
and constructing a functional resource relation tree according to the resource relation among the functional resources in the product resources.
Optionally, the attribute data includes at least: resource name, resource type, resource identification, resource version, and products to which they belong.
Optionally, after the obtaining each functional resource in each product resource, the test case construction method further includes:
and respectively configuring corresponding operation behaviors for each functional resource according to the resource type of the functional resource.
Optionally, the analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource includes:
if the product resources comprise interfaces and methods of the server side, analyzing the java jar package, or analyzing the swagger file, or carrying out online scanning on swagger addresses, analyzing the product resources, and obtaining each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
Optionally, the analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource includes:
If the product resources comprise mobile terminals or WEB pages, analyzing the product resources through scanning traversal to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
A test case construction apparatus comprising: a function resource obtaining unit to be tested, a first operation behavior determining unit, other function resource determining units, a second operation behavior determining unit and a test case constructing unit,
The to-be-tested function resource obtaining unit is used for obtaining at least one to-be-tested function resource selected by a user;
the first operation behavior determining unit is used for determining a first operation behavior corresponding to each functional resource to be tested;
The other functional resource determining unit is used for respectively determining other functional resources with resource relation with each functional resource to be tested by utilizing a pre-constructed functional resource relation tree;
the second operation behavior determining unit is used for determining a second operation behavior corresponding to each other functional resource;
The test case construction unit is configured to construct a test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested, and the second operation behavior corresponding to each other functional resource.
A computer-readable storage medium having stored thereon a program which, when executed by a processor, implements the test case construction method according to any one of the preceding claims.
An electronic device comprising at least one processor, and at least one memory, bus connected to the processor; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke program instructions in the memory to execute the test case construction method according to any of the above.
By means of the technical scheme, the test case construction method and the related equipment provided by the disclosure can obtain at least one functional resource to be tested selected by a user; determining a first operation behavior corresponding to each functional resource to be tested; utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested; determining a second operation behavior corresponding to each other functional resource; and constructing a test case according to each functional resource to be tested, the first operation behavior corresponding to the functional resource and the second operation behavior corresponding to each other functional resource. According to the method and the device, through the functional resources to be tested selected by the user, other functional resources related to the functional resources to be tested are determined by utilizing the pre-built functional resource relation tree, and the operation behaviors corresponding to the functional resources are matched, so that the construction of the test cases is completed, the problem that the creation operation of the test cases is not uniform under different scenes is solved, the construction difficulty of the test cases is reduced, and the overall test efficiency is improved.
The foregoing description is merely an overview of the technical solutions of the present disclosure, and may be implemented according to the content of the specification in order to make the technical means of the present disclosure more clearly understood, and in order to make the above and other objects, features and advantages of the present disclosure more clearly understood, the following specific embodiments of the present disclosure are specifically described.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the disclosure. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a schematic flow chart of one implementation of a test case construction method provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating another implementation of a test case construction method provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a structural composition of a test case building apparatus according to an embodiment of the present disclosure;
fig. 4 shows a schematic structural composition of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be appreciated that whether front-end or back-end test cases are built, the test cases may include both test logic and test data. The embodiment of the disclosure splits the test logic into three parts, namely a tested object, test behavior and object relation.
The measured object is measured resource, which is simply called resource. The measured resources in embodiments of the present disclosure may include product resources as well as functional resources in the product resources.
The test behavior is an operational behavior generated on the resource. For example: if the resource is an interface, the operational actions may include call, mask, enable, and MOCK. If the resource is a page, the operational behavior may include clicking, inputting, and sliding.
Object relationships, also known as resource relationships. It will be appreciated that there may be resource relationships between functional resources in a product resource. Resource relationships include calling relationships, inheritance relationships, containment relationships, parent-child relationships, sibling (same parent) relationships, and blood-source (same set) relationships.
The resource relationships and test behavior were previously in close relationship. For example: the function resource a interface in the product resource A can call the function resource b interface, the function resource b interface can call the function resource c interface, and the function resource c interface can call the third party interface. If the function resource c interface is not ready, performing MOCK action on the function resource c interface when the function resource a interface is required to perform call action.
As shown in fig. 1, an implementation manner of a test case construction method provided by an embodiment of the present disclosure may include:
S100, obtaining at least one functional resource to be tested selected by a user.
The test case construction method provided by the embodiment of the disclosure can be applied to a test case construction system. The embodiment of the disclosure can obtain at least one functional resource to be tested selected by a user in the test case construction system.
Optionally, based on the method shown in fig. 1, as shown in fig. 2, another implementation of the test case construction method provided by the embodiment of the present disclosure, before step S100, the test case construction method may further include:
And S01, analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
Optionally, the attribute data includes at least: resource name, resource type, resource identification, resource version, and products to which they belong.
If the functional resource is specifically an interface, the attribute data corresponding to the functional resource may further include data such as an in-parameter type, an out-parameter type, an alias, whether the method reads and writes the database, and whether the method is associated with the middleware.
If the functional resource is a page, the attribute data corresponding to the functional resource may further include data such as page resolution, page length and width, page thumbnail, element color in the page, and page type.
Optionally, the embodiment of the present disclosure may configure, after obtaining each functional resource in each product resource, a corresponding operation behavior for each functional resource according to a resource type of the functional resource.
According to the embodiment of the disclosure, the operation behaviors corresponding to the functional resources can be configured in the test case construction system, and the automatic test platform is used for providing bottom-layer program support for the operation behaviors.
If the product resources comprise interfaces and methods of the server side, analyzing java jar packages, or swagger files, or carrying out online scanning on swagger addresses, analyzing the product resources, and obtaining each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
Specifically, the process of analyzing the java jar packet according to the embodiment of the present disclosure may include: uploading a jar packet of the tested application, and analyzing according to an AST syntax tree to obtain a resource analysis result of the whole jar packet, wherein the resource analysis result can comprise interfaces, methods, functional resources, attribute data corresponding to the functional resources and resource relations among the functional resources.
Specifically, the process of analyzing swagger files according to an embodiment of the present disclosure may include: and uploading swagger files, wherein the swagger files can be in json format. The swagger file contains interfaces and methods that are exposed to the outside. And according to the file content to be analyzed, analyzing according to a first preset analysis rule, and obtaining a related interface and a related method.
Specifically, the process of online scanning swagger addresses according to the embodiments of the present disclosure may include: and performing GET method call on the swagger address to obtain returned html format content. And analyzing the html format content according to a second preset analysis rule to obtain a related interface and a related method.
If the product resources comprise mobile terminals or WEB pages, analyzing the product resources through scanning traversal to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
Specifically, the embodiment of the disclosure can confirm the entry address of the mobile terminal or the WEB page, and obtain the target sub-page link associated with the target page according to the source code content of the target page corresponding to the entry address. And sequentially opening all target sub-page links, and if the target sub-page corresponding to any target sub-page link comprises other sub-page links, continuing to open the other sub-page links until the opened sub-page is a known page. When any page is opened, various types of elements on the page are collected and recorded. For example: buttons, drop down boxes, and labels. After all the pages of each object are scanned and traversed, the analysis of the product resources is finished.
S02, constructing a functional resource relation tree according to the resource relation among the functional resources in the product resources.
According to the test logic of the product resources, various resource relations can be formed among the functional resources in the product resources. For example: the page function resource and the page function resource can form a resource relation of an upper and lower hierarchy, and the page and the element on the page can form an inclusion relation. Through the whole carding of the test logic of the product resource, each resource relation expression data structure can be a tree-type functional resource relation tree, each node in the functional resource relation tree is a functional resource, and the connection line between the nodes represents the resource relation between the nodes.
According to the embodiment of the disclosure, the resource relation among the functional resources is defined in advance, and the corresponding operation behaviors are configured for the functional resources, so that the functional resources can be directly used for arrangement when the test case is constructed, and the corresponding operation behaviors are configured, so that the test case construction can be completed, and the unified test case creation operation in different test scenes is realized.
S200, determining a first operation behavior corresponding to each functional resource to be tested.
It can be understood that, because the operation behavior corresponding to the functional resource is already configured in the test case construction system, when the functional resource to be tested is obtained in the test case construction system, the test case construction system can directly provide the first operation behavior corresponding to the functional resource to be tested.
S300, utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested.
According to the embodiment of the disclosure, the node corresponding to the functional resource to be tested can be determined in the functional resource relation tree, and other functional resources with direct resource relation and indirect resource relation with the functional resource to be tested are determined according to the connecting line for connecting the node.
S400, determining a second operation behavior corresponding to each other functional resource.
It can be appreciated that, since the operation behaviors corresponding to the functional resources are already configured in the test case construction system, when other functional resources are obtained in the test case construction system, the test case construction system can directly provide the second operation behaviors corresponding to the other functional resources.
S500, according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested and the second operation behavior corresponding to other functional resources, a test case is constructed.
It can be understood that, in the embodiment of the present disclosure, each functional resource to be tested and other functional resources having a resource relationship with the functional resource to be tested may be laid out and built, and operation behaviors corresponding to each functional resource are configured, so as to finally construct a test case.
Optionally, embodiments of the present disclosure may configure assertions for some or all of the first operational behaviors.
Optionally, configuring assertion for part or all of the second operation behaviors to construct the test case.
According to the embodiment of the disclosure, the test case with good stability and high quality can be created by configuring assertion (assent) to part or all of operation behaviors in the test case.
The test case construction method provided by the disclosure can obtain at least one functional resource to be tested selected by a user; determining a first operation behavior corresponding to each functional resource to be tested; utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested; determining a second operation behavior corresponding to each other functional resource; and constructing a test case according to each functional resource to be tested, the first operation behavior corresponding to the functional resource and the second operation behavior corresponding to each other functional resource. According to the method and the device, through the functional resources to be tested selected by the user, other functional resources related to the functional resources to be tested are determined by utilizing the pre-built functional resource relation tree, and the operation behaviors corresponding to the functional resources are matched, so that the construction of the test cases is completed, the problem that the creation operation of the test cases is not uniform under different scenes is solved, the construction difficulty of the test cases is reduced, and the overall test efficiency is improved.
Although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the method embodiment, the embodiment of the disclosure further provides a test case construction device, where the structure of the test case construction device is shown in fig. 3, and the test case construction device may include: the function resource obtaining unit to be tested 100, the first operation behavior determining unit 200, the other function resource determining unit 300, the second operation behavior determining unit 400, and the test case constructing unit 500.
The function resource to be tested obtaining unit 100 is configured to obtain at least one function resource to be tested selected by a user.
The first operation behavior determining unit 200 is configured to determine a first operation behavior corresponding to each functional resource to be tested.
The other functional resource determining unit 300 is configured to determine other functional resources having a resource relationship with each functional resource to be tested, respectively, by using a functional resource relationship tree constructed in advance.
The second operation behavior determining unit 400 is configured to determine a second operation behavior corresponding to each other functional resource.
The test case construction unit 500 is configured to construct a test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested, and the second operation behavior corresponding to each other functional resource.
Optionally, the test case construction unit 500 is specifically configured to configure assertions for some or all of the first operation behaviors and/or configure assertions for some or all of the second operation behaviors, so as to construct a test case.
Optionally, the test case construction device provided by the embodiment of the present disclosure may further include: and the product resource analysis unit and the relation tree construction unit.
The product resource analyzing unit is configured to analyze at least one product resource before the functional resource to be tested obtaining unit 100 obtains at least one functional resource to be tested selected by a user, so as to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource.
And the relation tree construction unit is used for constructing a functional resource relation tree according to the resource relation among the functional resources in the product resources.
Optionally, the attribute data includes at least: resource name, resource type, resource identification, resource version, and products to which they belong.
Optionally, the test case construction device provided by the embodiment of the present disclosure may further include: and an operation behavior configuration unit.
And the operation behavior configuration unit is used for respectively configuring corresponding operation behaviors for each functional resource according to the resource type of the functional resource after the product resource analysis unit obtains each functional resource in each product resource.
Optionally, the product resource analysis unit is specifically configured to analyze the product resource by analyzing a java jar package, or analyzing a swagger file, or performing online scanning on a swagger address, and analyzing the product resource if the product resource includes an interface and a method of a server, so as to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource.
Optionally, the product resource analysis unit is specifically configured to analyze the product resource by scanning traversal if the product resource includes a mobile terminal or a WEB page, so as to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource.
The test case construction device provided by the disclosure can obtain at least one functional resource to be tested selected by a user; determining a first operation behavior corresponding to each functional resource to be tested; utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested; determining a second operation behavior corresponding to each other functional resource; and constructing a test case according to each functional resource to be tested, the first operation behavior corresponding to the functional resource and the second operation behavior corresponding to each other functional resource. According to the method and the device, through the functional resources to be tested selected by the user, other functional resources related to the functional resources to be tested are determined by utilizing the pre-built functional resource relation tree, and the operation behaviors corresponding to the functional resources are matched, so that the construction of the test cases is completed, the problem that the creation operation of the test cases is not uniform under different scenes is solved, the construction difficulty of the test cases is reduced, and the overall test efficiency is improved.
The specific manner in which the individual units perform the operations in relation to the apparatus of the above embodiments has been described in detail in relation to the embodiments of the method and will not be described in detail here.
The test case constructing apparatus includes a processor and a memory, the functional resource obtaining unit 100 to be tested, the first operation behavior determining unit 200, the other functional resource determining unit 300, the second operation behavior determining unit 400, the test case constructing unit 500, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can set one or more than one function resource to be tested selected by a user by adjusting kernel parameters, other function resources related to the function resource to be tested are determined by utilizing a pre-built function resource relation tree, and operation behaviors corresponding to the function resources are matched, so that the construction of the test case is completed, the problem of non-uniform creation operation of the test case under different scenes is solved, the construction difficulty of the test case is reduced, and the overall test efficiency is improved.
Embodiments of the present disclosure provide a computer-readable storage medium having a program stored thereon, which when executed by a processor, implements the test case construction method.
The embodiment of the disclosure provides a processor for running a program, wherein the program runs to execute the test case construction method.
As shown in fig. 4, an embodiment of the present disclosure provides an electronic device 1000, the electronic device 1000 comprising at least one processor 1001, and at least one memory 1002, bus 1003 connected to the processor 1001; wherein, the processor 1001 and the memory 1002 complete communication with each other through the bus 1003; the processor 1001 is configured to call program instructions in the memory 1002 to execute the test case construction method described above. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present disclosure also provides a computer program product adapted to perform a program that, when executed on an electronic device, initializes the steps of the test case construction method.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, the electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
In the description of the present disclosure, it should be understood that, if the directions or positional relationships indicated by the terms "upper", "lower", "front", "rear", "left" and "right", etc., are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the positions or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limitations of the present disclosure.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present disclosure, are intended to be included within the scope of the claims of the present disclosure.
Claims (9)
1. The test case construction method is characterized by comprising the following steps:
Analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource;
constructing a functional resource relation tree according to the resource relation among the functional resources in the product resources;
obtaining at least one functional resource to be tested selected by a user;
Determining a first operation behavior corresponding to each functional resource to be tested;
utilizing a pre-constructed functional resource relation tree to respectively determine other functional resources with resource relation with each functional resource to be tested;
determining a second operation behavior corresponding to each other functional resource;
and constructing a test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested and the second operation behavior corresponding to the other functional resources.
2. The test case construction method according to claim 1, wherein the constructing the test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested and the second operation behavior corresponding to each other functional resource includes:
And configuring and asserting part or all of the first operation behaviors and/or configuring and asserting part or all of the second operation behaviors to construct a test case.
3. The test case construction method according to claim 1, wherein the attribute data includes at least: resource name, resource type, resource identification, resource version, and products to which they belong.
4. The test case construction method according to claim 1, wherein after the obtaining each functional resource in each product resource, the test case construction method further comprises:
and respectively configuring corresponding operation behaviors for each functional resource according to the resource type of the functional resource.
5. The method of claim 1, wherein the parsing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource comprises:
if the product resources comprise interfaces and methods of the server side, analyzing the java jar package, or analyzing the swagger file, or carrying out online scanning on swagger addresses, analyzing the product resources, and obtaining each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
6. The method of claim 1, wherein the parsing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource, and a resource relationship between each functional resource comprises:
If the product resources comprise mobile terminals or WEB pages, analyzing the product resources through scanning traversal to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource.
7. A test case constructing apparatus, comprising: a product resource analysis unit, a relation tree construction unit, a functional resource obtaining unit to be tested, a first operation behavior determination unit, other functional resource determination units, a second operation behavior determination unit and a test case construction unit,
The product resource analysis unit is used for analyzing at least one product resource to obtain each functional resource in each product resource, attribute data corresponding to each functional resource and resource relation among each functional resource;
The relation tree construction unit is used for constructing a functional resource relation tree according to the resource relation among the functional resources in the product resources;
the to-be-tested function resource obtaining unit is used for obtaining at least one to-be-tested function resource selected by a user;
the first operation behavior determining unit is used for determining a first operation behavior corresponding to each functional resource to be tested;
The other functional resource determining unit is used for respectively determining other functional resources with resource relation with each functional resource to be tested by utilizing a pre-constructed functional resource relation tree;
the second operation behavior determining unit is used for determining a second operation behavior corresponding to each other functional resource;
The test case construction unit is configured to construct a test case according to each functional resource to be tested and the first operation behavior corresponding to the functional resource to be tested, and the second operation behavior corresponding to each other functional resource.
8. A computer-readable storage medium having a program stored thereon, wherein the program, when executed by a processor, implements the test case construction method according to any one of claims 1 to 6.
9. An electronic device comprising at least one processor, and at least one memory, bus connected to the processor; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke program instructions in the memory to perform the test case construction method according to any of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111042797.8A CN113672518B (en) | 2021-09-07 | 2021-09-07 | Test case construction method and related equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111042797.8A CN113672518B (en) | 2021-09-07 | 2021-09-07 | Test case construction method and related equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113672518A CN113672518A (en) | 2021-11-19 |
| CN113672518B true CN113672518B (en) | 2024-06-18 |
Family
ID=78548569
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111042797.8A Active CN113672518B (en) | 2021-09-07 | 2021-09-07 | Test case construction method and related equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113672518B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112631945A (en) * | 2020-12-30 | 2021-04-09 | 平安证券股份有限公司 | Test case generation method and device and storage medium |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8997052B2 (en) * | 2013-06-19 | 2015-03-31 | Successfactors, Inc. | Risk-based test plan construction |
| CN106326090A (en) * | 2015-06-18 | 2017-01-11 | 中兴通讯股份有限公司 | Method and device for realizing construction of test use case |
| US10169215B2 (en) * | 2016-09-26 | 2019-01-01 | Cognizant Technology Solutions India Pvt. Ltd. | Method and system for analyzing test cases for automatically generating optimized business models |
| CN107992409B (en) * | 2017-11-21 | 2020-08-21 | 平安养老保险股份有限公司 | Test case generation method and device, computer equipment and storage medium |
| CN111124867B (en) * | 2018-10-30 | 2022-12-16 | 中移(苏州)软件技术有限公司 | A kind of OpenStack test method and device |
| CN111352832B (en) * | 2020-02-24 | 2024-06-07 | 腾讯科技(成都)有限公司 | Method and device for automatically testing page |
| CN111552627A (en) * | 2020-03-16 | 2020-08-18 | 平安科技(深圳)有限公司 | User interface testing method and device, storage medium and computer equipment |
-
2021
- 2021-09-07 CN CN202111042797.8A patent/CN113672518B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112631945A (en) * | 2020-12-30 | 2021-04-09 | 平安证券股份有限公司 | Test case generation method and device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113672518A (en) | 2021-11-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113079198B (en) | Method and device for converting cloud platform interface protocol | |
| CN111399840B (en) | Module development method and device | |
| CN112416365B (en) | File conversion method, device and storage medium | |
| CN114398293B (en) | Interface test case generation method, electronic device and storage medium | |
| CN114416545B (en) | Method, device and electronic device for determining test code coverage | |
| CN117931666B (en) | System and method for testing core framework of software radio communication equipment | |
| CN112860507B (en) | Control method and device for sampling rate of distributed link tracking system | |
| CN111124870A (en) | Interface testing method and device | |
| CN112597036A (en) | Universal baffle testing method and device | |
| CN113641355A (en) | Interface document generation method, system and storage medium | |
| CN112965697A (en) | Code file generation method and device and electronic equipment | |
| CN112346981A (en) | Joint debugging test coverage rate detection method and system | |
| CN111198677B (en) | Equipment object generation method, device and equipment | |
| CN115203050A (en) | Method and device for determining dependency relationship of services | |
| CN113672518B (en) | Test case construction method and related equipment | |
| CN119201718A (en) | Automated testing method, system, equipment and medium based on Internet of Things object model | |
| CN117234916A (en) | Workflow application testing method and device, electronic equipment and storage medium | |
| CN111401020A (en) | Interface loading method and system and computing equipment | |
| CN116578287A (en) | Service processing method, intelligent terminal and storage medium | |
| CN116860636A (en) | Unit test code generation method, device, equipment and storage medium | |
| CN115878467A (en) | Interface automation test method, device, equipment and storage medium | |
| CN113377674A (en) | Log code adding method and device | |
| CN113542203A (en) | Video service DPI identification method and server | |
| CN110851750B (en) | Data acquisition method and device | |
| Mayr-Dorn et al. | Distributed tracing of OPC UA method calls |
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 |