CN115185830A - Test unit-based case generation method, device, equipment and storage medium - Google Patents

Test unit-based case generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115185830A
CN115185830A CN202210731748.3A CN202210731748A CN115185830A CN 115185830 A CN115185830 A CN 115185830A CN 202210731748 A CN202210731748 A CN 202210731748A CN 115185830 A CN115185830 A CN 115185830A
Authority
CN
China
Prior art keywords
test
fault
basic
case
units
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
CN202210731748.3A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210731748.3A priority Critical patent/CN115185830A/en
Publication of CN115185830A publication Critical patent/CN115185830A/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

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)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a test unit-based case generation method, a test unit-based case generation device, test unit-based equipment and a storage medium, wherein the method comprises the following steps: acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases; classifying a plurality of test faults to obtain a plurality of test fault groups; determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases; and determining a target test case of each test fault in each test fault group according to the plurality of basic test units. The method and the device can enrich the constituent units of the test cases and improve the comprehensiveness and accuracy of the constructed content items of the test cases.

Description

Test unit-based case generation method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a test unit-based case generation method, device, apparatus, and storage medium.
Background
As the business scale of the internet industry is continuously enlarged, the system design is more and more complex, and in the system design process, the system is usually detected by using a test case, where the test case is a test model of a set of test input, execution conditions and expected results identified for a specific target. The test case of the existing system to be tested is usually generated based on a single test fault, and the test case generated in the mode has the problems of incomplete and inaccurate constructed content items.
Disclosure of Invention
The embodiment of the application provides a test unit-based case generation method, a test unit-based case generation device, test unit-based equipment and a storage medium, so that the composition units of test cases can be enriched, and the comprehensiveness and accuracy of the constructed content items of the test cases can be improved.
In one aspect, the present application provides a test unit-based case generation method, including:
acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases;
classifying the plurality of test faults to obtain a plurality of test fault groups;
determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
In some embodiments of the present application, the system under test includes a plurality of functional modules, a plurality of test faults with a plurality of functional modules correspond, it is right a plurality of test faults are classified, obtain a plurality of test fault groups, include:
acquiring a functional module corresponding to each test fault, and determining the type of each test fault according to the functional module;
and classifying the plurality of test faults according to the type of each test fault to obtain a plurality of test fault groups.
In some embodiments of the present application, the determining a plurality of basic test cells of each test failure group of the test failure groups based on the test failure groups and the initial test cases comprises:
generating a basic test case of each test fault group in the test fault groups based on the test fault groups and the initial test cases;
and splitting the basic test case to obtain a plurality of basic test units of each test fault group.
In some embodiments of the present application, the generating a basic test case for each of the plurality of test failure groups based on the plurality of test failure groups and the plurality of initial test cases includes:
classifying the initial test cases based on the test fault groups to obtain a plurality of test case sets, wherein the test case sets correspond to the test fault groups one by one;
and combining the initial test cases of the test case set corresponding to each test failure group in the plurality of test failure groups to generate the basic test case of each test failure group.
In some embodiments of the present application, the splitting the basic test case to obtain a plurality of basic test units of each test fault group includes:
analyzing the basic test case to obtain a plurality of attribute fields of the basic test case;
and splitting the basic test case according to the plurality of attribute fields to obtain a plurality of basic test units of each test fault group.
In some embodiments of the present application, the determining, according to the plurality of basic test units, a target test case of each test failure in each test failure group includes:
inputting the attribute field corresponding to each basic test unit in the plurality of basic test units into a matching degree prediction model, and outputting the target matching degree of the attribute field and each test fault in each test fault group through the matching degree prediction model;
and determining the target test case of each test fault according to the target matching degree.
In some embodiments of the present application, the determining the target test case of each test fault according to the target matching degree includes:
screening a plurality of target test units of each test fault from the plurality of basic test units according to the target matching degree;
and combining the target test units to obtain the target test case of each test fault.
In another aspect, the present application provides a test cell-based use case generating apparatus, including:
the system comprises a data acquisition unit, a data processing unit and a data processing unit, wherein the data acquisition unit is used for acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, and the test faults correspond to the initial test cases one by one;
the fault classification unit is used for classifying the test faults to obtain a plurality of test fault groups;
the first determining unit is used for determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and the second determining unit is used for determining the target test case of each test fault in each test fault group according to the plurality of basic test units.
In another aspect, the present application further provides a computer device, including:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps in the test unit based use case generation method of any of the first aspects.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is loaded by a processor to execute the steps in the test unit-based use case generation method according to any one of the first aspect.
According to the method and the device, a plurality of initial test cases are integrated based on a plurality of test fault groups, a plurality of basic test units of each test fault group are determined, a target test case of each test fault is reconstructed based on the plurality of basic test units, the composition units of the test cases can be enriched, and the comprehensiveness and accuracy of the constructed content items of the test cases are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic view of a scenario of a test unit-based use case generation system according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an embodiment of a test unit based use case generation method provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an embodiment of a test unit-based use case generating apparatus provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of an embodiment of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
It should be noted that, since the method in the embodiment of the present application is executed in a computer device, processing objects of each computer device all exist in the form of data or information, for example, time, which is substantially time information, and it is understood that, in the subsequent embodiments, if size, number, position, and the like are mentioned, corresponding data exist so as to be processed by the computer device, and details are not described herein.
Embodiments of the present application provide a method, an apparatus, a device, and a storage medium for generating a case based on a test unit, which are described in detail below.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a test unit based use case generating system according to an embodiment of the present application, where the test unit based use case generating system may include a computer device 100, and a test unit based use case generating apparatus, such as the computer device in fig. 1, is integrated in the computer device 100.
In the embodiment of the present application, the computer device 100 is mainly used for acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, where the test faults and the initial test cases correspond to each other one by one; classifying the plurality of test faults to obtain a plurality of test fault groups; determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases; and determining the target test case of each test fault in each test fault group according to the plurality of basic test units, so that the composition units of the test cases can be enriched, and the comprehensiveness and the accuracy of the constructed content items of the test cases can be improved.
In this embodiment, the computer device 100 may be an independent server, or may be a server network or a server cluster composed of servers, for example, the computer device 100 described in this embodiment includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud server composed of a plurality of servers. Among them, the Cloud server is constituted by a large number of computers or web servers based on Cloud Computing (Cloud Computing).
It will be appreciated that the computer device 100 used in the embodiments of the present application may be a device that includes both receiving and transmitting hardware, i.e., a device having receiving and transmitting hardware capable of performing two-way communications over a two-way communications link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific computer device 100 may specifically be a desktop terminal or a mobile terminal, and the computer device 100 may also specifically be one of a mobile phone, a tablet computer, a notebook computer, and the like.
Those skilled in the art will understand that the application environment shown in fig. 1 is only one application scenario related to the present application, and does not constitute a limitation on the application scenario of the present application, and that other application environments may further include more or less computer devices than those shown in fig. 1, for example, only 1 computer device is shown in fig. 1, and it is understood that the test unit based use case generating system may further include one or more other services, which are not limited herein.
In addition, as shown in fig. 1, the test unit based use case generating system may further include a memory 200 for storing data, such as a plurality of test failures, e.g., a test failure a, a test failure B, a test failure C, etc., such as an initial test case corresponding to each test failure of the plurality of test failures, e.g., an initial test case a corresponding to the test failure a, an initial test case B corresponding to the test failure B, and an initial test case C corresponding to the test failure C.
It should be noted that the scenario diagram of the test unit-based use case generating system shown in fig. 1 is merely an example, and the test unit-based use case generating system and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application.
First, an embodiment of the present application provides a test unit-based use case generating method, where an execution subject of the test unit-based use case generating method is a test unit-based use case generating device, and the test unit-based use case generating device is applied to a computer device, and the test unit-based use case generating method includes: acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases; classifying the plurality of test faults to obtain a plurality of test fault groups; determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases; and determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
As shown in fig. 2, a schematic flowchart of an embodiment of a test unit based use case generating method in the embodiment of the present application is shown, where the test unit based use case generating method includes:
s100, obtaining a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases.
The system to be tested is a business system to be tested, for example, the system to be tested may be a bank loan business system, a bank credit card business system, a bank deposit and withdrawal business system, etc., a plurality of test faults are faults that may occur in the system to be tested, and a plurality of initial test cases are test cases respectively generated based on the plurality of test faults, that is, the plurality of test faults correspond to the plurality of initial test cases one to one. For example, the plurality of test faults include a test fault a, a test fault B, and a test fault C, and the plurality of initial test cases include an initial test case a corresponding to the test fault a, an initial test case B corresponding to the test fault B, and an initial test case C corresponding to the test fault C, and the initial test case a is set based on the test fault a, the initial test case B is set based on the test fault B, and the initial test case C is set based on the test fault C.
Considering that the initial test cases are respectively set based on the test faults, the initial test cases have the problems of incomplete and inaccurate constructed content items, and if the system to be tested is tested based on the initial test cases, incomplete test is easily caused. In this embodiment, after a plurality of initial test cases are respectively set based on a plurality of test faults of the system to be tested, the plurality of test faults and the plurality of initial test cases are obtained, so that test case reconstruction is performed based on the plurality of test faults and the plurality of initial test cases in subsequent steps.
S200, classifying the plurality of test faults to obtain a plurality of test fault groups.
Each of the plurality of test fault groups includes a plurality of test faults, and the types of the plurality of test faults included in each test fault group are the same, for example, the plurality of test fault groups includes a test fault group a, a test fault group B, and a test fault group C, where the test fault group a includes a test fault a, a test fault B, and a test fault C, the test fault group B includes a test fault D, a test fault E, and a test fault F, and the test fault group C includes a test fault M, a test fault I, and a test fault J, then the test fault a, the test fault B, and the test fault C are the same type of test fault, the test fault D, the test fault E, and the test fault F are the same type of test fault, and the test fault M, the test fault I, and the test fault J are the same type of test fault.
Considering that the initial test cases corresponding to the same type of test faults can be combined, after the multiple test faults and the multiple initial test cases of the system to be tested are obtained, the multiple test faults are classified, the test faults of the same type are divided into the same test fault group, the multiple test fault groups are obtained, and the test cases are reconstructed on the basis of the multiple test fault groups and the multiple initial test cases in the subsequent step.
In one embodiment, step S200 includes:
s210, acquiring a functional module corresponding to each test fault, and determining the type of each test fault according to the functional module;
s220, classifying the plurality of test faults according to the type of each test fault to obtain a plurality of test fault groups.
The system to be tested comprises a plurality of functional modules, and a plurality of test faults correspond to the functional modules, for example, the test fault A corresponds to the functional module A, the test fault B corresponds to the functional module B, and the test fault C corresponds to the functional module C. When classifying a plurality of test faults, the method first obtains the functional module corresponding to each test fault, determines the type of each test fault according to the functional module corresponding to each test fault, then classifies the plurality of test faults according to the type of each test fault, classifies the test faults of the same type into the same test fault group, and obtains a plurality of test fault groups. For example, functional module a and functional module B both belong to type a, then test failure a and test failure B both belong to type a, and test failure a and test failure B are grouped into the same test failure group.
S300, determining a plurality of basic test units of each test fault group in the test fault groups based on the test fault groups and the initial test cases.
The plurality of basic test units are test data units obtained by integrating a plurality of initial test cases based on test failure groups, and each test failure group corresponds to the plurality of basic test units. After obtaining the plurality of test fault groups, the present embodiment integrates the plurality of initial test cases based on the plurality of test fault groups to obtain a plurality of basic test units corresponding to each test fault group in the plurality of test fault groups, so that a target test case of each test fault is reconstructed based on the plurality of basic test units in the subsequent step.
In one embodiment, step S300 includes:
s310, generating a basic test case of each test fault group in the test fault groups based on the test fault groups and the initial test cases;
s320, splitting the basic test case to obtain a plurality of basic test units of each test fault group.
The basic test case is a combined test case obtained by combining a plurality of initial test cases based on a plurality of test fault groups, and a plurality of basic test units of each test fault group are obtained by splitting the basic test case of each test fault group. When determining the plurality of basic test units of each test fault group, the embodiment first combines the plurality of initial test cases based on the plurality of test fault groups to obtain the basic test case of each test fault group in the plurality of test fault groups, then splits the basic test case of each test fault group, and splits the basic test case of each test fault group into the plurality of basic test units. For example, the basic test case a of the test failure group a is split to obtain a basic test unit a, a basic test unit B, and a basic test unit C.
In one embodiment, step S310 includes:
s311, classifying the initial test cases based on the test fault groups to obtain a plurality of test case sets, wherein the test case sets correspond to the test fault groups one by one;
s312, combining the initial test cases of the test case set corresponding to each test failure group in the plurality of test failure groups to generate a basic test case of each test failure group.
The test case set is a set composed of initial test cases corresponding to the test faults in each test fault group, for example, the test fault group a is composed of a test fault a, a test fault B and a test fault C, the test fault a corresponds to the initial test case a, the test fault B corresponds to the initial test case B, and the test fault C corresponds to the initial test case C, and then the test case set a corresponding to the test fault group a is a test case set composed of the initial test case a, the initial test case B and the initial test case C.
When generating the basic test case of each test fault group in the plurality of test fault groups, the embodiment first classifies the plurality of initial test cases based on the plurality of test fault groups to obtain a plurality of test case sets, wherein the plurality of test case sets correspond to the plurality of test fault groups one to one, and then combines the initial test cases of the test case sets corresponding to each test fault group in the plurality of test fault groups to generate the basic test case of each test fault group. For example, the test fault group a corresponds to the test case set a, the test case set a is composed of an initial test case a, an initial test case B, and an initial test case C, and the basic test case a of the test fault group a can be generated by combining the initial test case a, the initial test case B, and the initial test case C.
In one embodiment, step S320 includes:
s321, analyzing the basic test case to obtain a plurality of attribute fields of the basic test case;
s322, splitting the basic test case according to the plurality of attribute fields to obtain a plurality of basic test units of each test fault group.
The plurality of attribute fields are analyzed from the basic test case, and when the basic test case is split to obtain the plurality of basic test units of each test fault group, the basic test case is firstly analyzed to obtain the plurality of attribute fields of the basic test case, and then the basic test case is split according to the plurality of attribute fields to obtain the plurality of basic test units of each test fault group.
S400, determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
The target test case is a test case of each test fault group reconstructed according to a plurality of basic test units, and after a plurality of basic test units of each test fault group in a plurality of test fault groups are determined, the target test case of each test fault in each test fault group is determined according to the plurality of basic test units, and the test case reconstruction is performed based on the plurality of basic test units, so that the composition units of the test cases can be enriched, the comprehensiveness and accuracy of the construction content items of the test cases are improved, and further, the comprehensiveness of the test of the system to be tested is improved.
In one embodiment, step S400 includes:
s410, inputting the attribute field corresponding to each basic test unit in the plurality of basic test units into a matching degree prediction model, and outputting the target matching degree of the attribute field and each test fault in each test fault group through the matching degree prediction model;
and S420, determining the target test case of each test fault according to the target matching degree.
The method includes the steps of splitting a basic test case according to a plurality of attribute fields, obtaining a plurality of basic test units of each test fault group corresponding to the plurality of attribute fields, inputting the attribute field corresponding to each basic test unit in the plurality of basic test units into a matching degree prediction model after the plurality of basic test units of each test fault group are obtained, outputting the target matching degree of the attribute field and each test fault through the matching degree prediction model, and determining the target test case of each test fault according to the target matching degree. The matching degree prediction model is obtained by training a preset network model based on a preset training sample set, and the preset network model may be a deep learning model or a machine learning model, for example, a Convolutional Neural Network (CNN), a deconvolution Neural network (De-Convolutional Neural network, DN), or the like. According to the method and the device, the target test case of each test fault is determined based on the matching degree prediction model, and the generation speed of the target test case can be increased. For example, the basic test unit a corresponds to the attribute field a, the attribute field a is input into the matching degree prediction model, and the matching degree prediction model can output the target matching degree of the attribute field a and the basic test unit a, the target matching degree of the attribute field a and the basic test unit B, and the target matching degree of the attribute field a and the basic test unit C.
The training sample set comprises a plurality of training fields and the real matching degree of each training field in the training sample set and each test fault, when a preset network model is trained, the training fields in the training sample set are firstly input into the preset network model, the prediction matching degree of each training field and each test fault is output through the preset network model, then the loss value is determined according to the prediction matching degree, the real matching degree and the loss function of the preset network model, when the loss value does not meet the preset condition, the model parameters of the preset network model are corrected according to the preset parameter learning rate, the step of outputting the prediction matching degree of each training field and each test fault through the preset network model is continuously executed until the loss value meets the preset condition, and therefore the matching degree prediction model is obtained. The loss value meeting the preset condition may be that the loss value is smaller than a preset first threshold, or that a difference between the loss values obtained in two times before and after the loss value is smaller than a preset second threshold.
In one embodiment, step S420 includes:
s421, screening a plurality of target test units of each test fault from the plurality of basic test units according to the target matching degree;
s422, combining the target test units to obtain the target test case of each test fault.
The target test units are basic test units screened from the multiple basic test units according to the target matching degree, and when the target test case of each test fault is determined according to the target matching degree, firstly, the multiple target test units of each test fault are screened from the multiple basic test units according to the target matching degree, and then the multiple target test units are combined to obtain the target test case of each test fault.
In a specific implementation manner of the present application, when a plurality of target test units with each test fault are screened out from a plurality of basic test units according to the target matching degree, a matching degree threshold may be preset, and then the basic test units with the target matching degree greater than the matching degree threshold are screened out from the plurality of basic test units as the plurality of target test units. Of course, in this embodiment, the plurality of basic test units may also be sorted according to the target matching degree, and a plurality of basic test units with the highest matching degree are selected from the plurality of basic test units as the target test unit, which is not limited in this application.
In order to better implement the test unit-based use case generating method in the embodiment of the present application, on the basis of the test unit-based use case generating method, a test unit-based use case generating apparatus is further provided in the embodiment of the present application, as shown in fig. 3, the test unit-based use case generating apparatus 600 includes:
a data obtaining unit 601, configured to obtain a plurality of test faults and a plurality of initial test cases of a system to be tested, where the test faults and the initial test cases correspond to each other one by one;
a fault classification unit 602, configured to classify the test faults to obtain a plurality of test fault groups;
a first determining unit 603, configured to determine, based on the multiple test failure groups and the multiple initial test cases, multiple basic test units of each test failure group in the multiple test failure groups;
a second determining unit 604, configured to determine, according to the multiple basic test units, a target test case of each test failure in each test failure group.
In the embodiment of the application, a plurality of initial test cases are integrated based on a plurality of test fault groups, a plurality of basic test units of each test fault group are determined, and a target test case of each test fault is reconstructed based on the plurality of basic test units, so that the composition units of the test cases can be enriched, and the comprehensiveness and the accuracy of the constructed content items of the test cases are improved.
In some embodiments of the present application, the fault classifying unit 602 is specifically configured to:
acquiring a functional module corresponding to each test fault, and determining the type of each test fault according to the functional module;
and classifying the plurality of test faults according to the type of each test fault to obtain a plurality of test fault groups.
In some embodiments of the present application, the first determining unit 603 is specifically configured to:
generating a basic test case of each test fault group in the test fault groups based on the test fault groups and the initial test cases;
and splitting the basic test case to obtain a plurality of basic test units of each test fault group.
In some embodiments of the present application, the first determining unit 603 is further specifically configured to:
classifying the initial test cases based on the test fault groups to obtain a plurality of test case sets, wherein the test case sets correspond to the test fault groups one by one;
and combining the initial test cases of the test case set corresponding to each test failure group in the plurality of test failure groups to generate a basic test case of each test failure group.
In some embodiments of the present application, the first determining unit 603 is further specifically configured to:
analyzing the basic test case to obtain a plurality of attribute fields of the basic test case;
and splitting the basic test case according to the plurality of attribute fields to obtain a plurality of basic test units of each test fault group.
In some embodiments of the present application, the second determining unit 604 is specifically configured to:
inputting the attribute field corresponding to each basic test unit in the plurality of basic test units into a matching degree prediction model, and outputting the target matching degree of the attribute field and each test fault in each test fault group through the matching degree prediction model;
and determining the target test case of each test fault according to the target matching degree.
In some embodiments of the present application, the second determining unit 604 is further specifically configured to:
screening a plurality of target test units of each test fault from the plurality of basic test units according to the target matching degree;
and combining the target test units to obtain the target test case of each test fault.
The embodiment of the present application further provides a computer device, which integrates any one of the test unit-based use case generating devices provided in the embodiments of the present application, where the computer device includes:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to perform the steps of the unit-under-test use case generation method in any of the above-described unit-under-test use case generation method embodiments.
The embodiment of the present application further provides a computer device, which integrates any one of the test unit-based use case generation apparatuses provided in the embodiments of the present application. Fig. 4 is a schematic diagram showing a structure of a computer device according to an embodiment of the present application, specifically:
the computer device may include components such as a processor 701 of one or more processing cores, memory 702 of one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 4 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 701 is a control center of the computer apparatus, connects various parts of the entire computer apparatus using various interfaces and lines, and performs various functions of the computer apparatus and processes data by running or executing software programs and/or modules stored in the memory 702 and calling data stored in the memory 702, thereby monitoring the computer apparatus as a whole. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by operating the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
The computer device further includes a power supply 703 for supplying power to the various components, and preferably, the power supply 703 is logically connected to the processor 701 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system. The power supply 703 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 704, the input unit 704 being operable to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 701 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application program stored in the memory 702, thereby implementing various functions as follows:
acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases;
classifying the plurality of test faults to obtain a plurality of test fault groups;
determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like. The test unit based case generation method comprises a step of storing a computer program, and a step of executing the steps of any one of the test unit based case generation methods provided by the embodiments of the application by loading the computer program by a processor. For example, the computer program may be loaded by a processor to perform the steps of:
acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases;
classifying the plurality of test faults to obtain a plurality of test fault groups;
determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The method, the apparatus, the device and the storage medium for generating a test case based on a test unit provided by the embodiment of the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A test cell-based use case generation method is characterized by comprising the following steps:
acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, wherein the test faults are in one-to-one correspondence with the initial test cases;
classifying the plurality of test faults to obtain a plurality of test fault groups;
determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and determining a target test case of each test fault in each test fault group according to the plurality of basic test units.
2. The method for generating use cases based on test units according to claim 1, wherein the system under test includes a plurality of functional modules, the plurality of test failures correspond to the plurality of functional modules, and the classifying the plurality of test failures to obtain a plurality of test failure groups includes:
acquiring a functional module corresponding to each test fault, and determining the type of each test fault according to the functional module;
and classifying the plurality of test faults according to the type of each test fault to obtain a plurality of test fault groups.
3. The method for test-unit-based use case generation according to claim 1, wherein the determining a plurality of basic test units for each of the plurality of test failure groups based on the plurality of test failure groups and the plurality of initial test cases comprises:
generating a basic test case of each test fault group in the test fault groups based on the test fault groups and the initial test cases;
and splitting the basic test case to obtain a plurality of basic test units of each test fault group.
4. The test-unit-based use case generating method according to claim 3, wherein the generating a basic test case for each test failure group of the test failure groups based on the test failure groups and the initial test cases comprises:
classifying the initial test cases based on the test fault groups to obtain a plurality of test case sets, wherein the test case sets correspond to the test fault groups one by one;
and combining the initial test cases of the test case set corresponding to each test failure group in the plurality of test failure groups to generate the basic test case of each test failure group.
5. The method according to claim 3, wherein the splitting the basic test case to obtain a plurality of basic test units of each test failure group comprises:
analyzing the basic test case to obtain a plurality of attribute fields of the basic test case;
and splitting the basic test case according to the plurality of attribute fields to obtain a plurality of basic test units of each test fault group.
6. The method according to claim 5, wherein the plurality of basic test units correspond to the plurality of attribute fields, and wherein determining the target test case for each test failure in each test failure group according to the plurality of basic test units comprises:
inputting the attribute field corresponding to each basic test unit in the plurality of basic test units into a matching degree prediction model, and outputting the target matching degree of the attribute field and each test fault in each test fault group through the matching degree prediction model;
and determining the target test case of each test fault according to the target matching degree.
7. The method according to claim 6, wherein the determining the target test case for each test failure according to the target matching degree comprises:
screening a plurality of target test units of each test fault from the plurality of basic test units according to the target matching degree;
and combining the target test units to obtain the target test case of each test fault.
8. A use case generation device based on a test unit is characterized by comprising:
the system comprises a data acquisition unit, a data processing unit and a data processing unit, wherein the data acquisition unit is used for acquiring a plurality of test faults and a plurality of initial test cases of a system to be tested, and the test faults correspond to the initial test cases one by one;
the fault classification unit is used for classifying the plurality of test faults to obtain a plurality of test fault groups;
the first determining unit is used for determining a plurality of basic test units of each test fault group in the plurality of test fault groups based on the plurality of test fault groups and the plurality of initial test cases;
and the second determining unit is used for determining the target test case of each test fault in each test fault group according to the plurality of basic test units.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps in the test unit based use case generation method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps in the test cell based use case generation method of any of claims 1 to 7.
CN202210731748.3A 2022-06-25 2022-06-25 Test unit-based case generation method, device, equipment and storage medium Pending CN115185830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210731748.3A CN115185830A (en) 2022-06-25 2022-06-25 Test unit-based case generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210731748.3A CN115185830A (en) 2022-06-25 2022-06-25 Test unit-based case generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115185830A true CN115185830A (en) 2022-10-14

Family

ID=83516390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210731748.3A Pending CN115185830A (en) 2022-06-25 2022-06-25 Test unit-based case generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115185830A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737538A (en) * 2023-04-13 2023-09-12 武汉铁路职业技术学院 Automatic software testing system and method for rail transit traction transmission control unit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737538A (en) * 2023-04-13 2023-09-12 武汉铁路职业技术学院 Automatic software testing system and method for rail transit traction transmission control unit

Similar Documents

Publication Publication Date Title
CN107885544B (en) Application program control method, device, medium and electronic equipment
CN109891508A (en) Single cell type detection method, device, equipment and storage medium
CN111243682A (en) Method, device, medium and apparatus for predicting toxicity of drug
CN106537423A (en) Adaptive featurization as service
CA3135466A1 (en) User loan willingness prediction method and device and computer system
CN111538852B (en) Multimedia resource processing method, device, storage medium and equipment
CN107844338B (en) Application program management-control method, device, medium and electronic equipment
CN115185830A (en) Test unit-based case generation method, device, equipment and storage medium
CN110909768A (en) Method and device for acquiring marked data
CN112783790B (en) Application program testing method and device
WO2020041859A1 (en) System and method for building and using learning machines to understand and explain learning machines
CN115689407A (en) Account abnormity detection method and device and terminal equipment
CN113704389A (en) Data evaluation method and device, computer equipment and storage medium
CN115186855A (en) Logistics network cargo quantity prediction method, device, equipment and computer storage medium
CN115221060A (en) Case generation method, device and equipment based on associated field and storage medium
CN110544166A (en) Sample generation method, device and storage medium
CN115174890A (en) Flow playback test method and device, computer equipment and storage medium
CN112583660B (en) Main domain and standby domain test comparison method, device and system of recommendation platform
CN112732685A (en) Financial data processing method and device, computer equipment and storage medium
CN111401383A (en) Target frame estimation method, system, device and medium based on image detection
CN112101447A (en) Data set quality evaluation method, device, equipment and storage medium
CN112308099A (en) Sample feature importance determination method, and classification model training method and device
WO2024046470A1 (en) Weighing abnormality detection method and apparatus, and related apparatus
CN109436980A (en) The condition detection method and system of elevator components
CN115242685B (en) Playback testing method, device, equipment and storage medium based on incidence matrix

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