Use Case Generation Method, Device, Equipment and Storage Medium Based on Associated Fields

Through the use case generation method based on the associated field, the traffic data in the production traffic file is filtered and the target test cases are generated, which solves the problem of long test cycles in the existing technology and improves the testing efficiency.

CN115221060BActive Publication Date: 2025-06-03PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210867897.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-06-03
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The test cases used when testing existing business systems include all traffic data in the production traffic file, resulting in a long test cycle and thus reducing test efficiency.

Method used

Through the use case generation method based on the associated field, the traffic data in the production traffic file is filtered according to the association relationship between the test service and the target attribute field of the service system to be tested, and the target test case is generated.

Benefits of technology

The test cycle of the business system to be tested has been shortened and the testing efficiency has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115221060B_ABST
    Figure CN115221060B_ABST
Patent Text Reader

Abstract

The present application discloses a use case generation method, device, equipment and storage medium based on associated fields, including: cutting the obtained production traffic file to obtain a number of initial traffic file blocks; obtaining the test services of the service system to be tested, and determining a number of candidate traffic file blocks according to the test services, a number of initial attribute fields and a number of initial traffic file blocks; inputting a number of target attribute fields into a first prediction model, and outputting the association relationships of the number of target attribute fields through the first prediction model; determining the target data ratio of each candidate traffic file block according to the number of target attribute fields and the association relationships of the number of target attribute fields; obtaining the target test data volume of the service system to be tested, and generating the target test cases of the service system to be tested according to the target test data volume, the target data ratio and a number of candidate traffic file blocks. The present application can shorten the test cycle of the service system to be tested and improve the test efficiency of the service system to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a use case generation method, apparatus, device, and storage medium based on associated fields. Background Art

[0002] With the rapid development of the Internet, especially the high-speed development of the mobile Internet, the types of activities that people carry out with the help of the Internet are becoming more and more diverse. Taking banking services as an example, users can perform banking service operations such as balance inquiries, transfers, and cash withdrawals through the banking service system. In order to ensure the service quality of the service system, it is necessary to update the services of the service system in various complex business scenarios and test the service system after each update to ensure the availability of the service. The test cases used when the existing service system is tested usually include all traffic data in the production traffic file. Using this test case to perform performance testing on the service system is likely to result in a long test cycle, thereby leading to low test efficiency. Summary of the Invention

[0003] Embodiments of this application provide a use case generation method, apparatus, device, and storage medium based on associated fields, which can screen the traffic data in the production traffic file according to the association relationship between the test service of the service system to be tested and several target attribute fields, and generate test cases for the service system to be tested based on the screened traffic data. Testing the service system to be tested based on this test case can shorten the test cycle of the service system to be tested and improve the test efficiency of the service system to be tested.

[0004] On the one hand, this application provides a use case generation method based on associated fields. The use case generation method based on associated fields includes:

[0005] Cut the obtained production traffic file to obtain several initial traffic file blocks, and the several initial traffic file blocks correspond to several initial attribute fields, where the several initial attribute fields are the attribute fields of the traffic data included in the several initial traffic file blocks;

[0006] Obtain the test service of the service system to be tested, and determine several candidate traffic file blocks according to the test service, the several initial attribute fields, and the several initial traffic file blocks. The several candidate traffic file blocks correspond to several target attribute fields, where the several target attribute fields are the attribute fields of the traffic data included in the several candidate traffic file blocks;

[0007] Input the several target attribute fields into a first prediction model, and output the association relationship of the several target attribute fields through the first prediction model;

[0008] Determine the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationship of the several target attribute fields;

[0009] Obtain the target test data volume of the to-be-tested service system, and generate the target test cases of the to-be-tested service system according to the target test data volume, the target data ratio, and the several candidate traffic file blocks.

[0010] In some embodiments of the present application, the determining of several candidate traffic file blocks according to the test service, the several initial attribute fields, and the several initial traffic file blocks includes:

[0011] Determine several target attribute fields according to the test service and the several initial attribute fields, where the several target attribute fields are the initial attribute fields associated with the test service among the several initial attribute fields;

[0012] Determine the several initial traffic file blocks corresponding to the several target attribute fields as several candidate traffic file blocks.

[0013] In some embodiments of the present application, the determining of several target attribute fields according to the test service and the several initial attribute fields includes:

[0014] Input the test service and the several initial attribute fields into a second prediction model, and output the several target attribute fields through the second prediction model.

[0015] In some embodiments of the present application, the determining of the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationship of the several target attribute fields includes:

[0016] Determine the field data ratio of each target attribute field among the several target attribute fields according to the several target attribute fields and the association relationship of the several target attribute fields;

[0017] Determine the field data ratio of each target attribute field as the target data ratio of the candidate traffic file block corresponding to each target attribute field.

[0018] In some embodiments of the present application, the determining of the field data ratio of each target attribute field among the several target attribute fields according to the several target attribute fields and the association relationship of the several target attribute fields includes:

[0019] Input the several target attribute fields and the association relationship of the several target attribute fields into a third prediction model, and output the field data ratio of each target attribute field among the several target attribute fields through the third prediction model.

[0020] In some embodiments of the present application, generating the target test case for the to-be-tested service system according to the target test data volume, the target data ratio, and the plurality of candidate traffic file blocks includes:

[0021] Determining the target data volume of each candidate traffic file block according to the target test data volume and the target data ratio;

[0022] Generating the target test case for the to-be-tested service system according to the target data volume and the plurality of candidate traffic file blocks.

[0023] In some embodiments of the present application, cutting the obtained production traffic file to obtain a plurality of initial traffic file blocks includes:

[0024] Obtaining the attribute fields of the traffic data included in the production traffic file;

[0025] Cutting the production traffic file according to the attribute fields of the traffic data included in the production traffic file to obtain a plurality of initial traffic file blocks.

[0026] On the other hand, the present application provides a use case generation device based on association fields, and the use case generation device based on association fields includes:

[0027] A file cutting unit, configured to cut the obtained production traffic file to obtain a plurality of initial traffic file blocks, where the plurality of initial traffic file blocks correspond to a plurality of initial attribute fields, and the plurality of initial attribute fields are the attribute fields of the traffic data included in the plurality of initial traffic file blocks;

[0028] A first determination unit, configured to obtain the test service of the to-be-tested service system, and determine a plurality of candidate traffic file blocks according to the test service, the plurality of initial attribute fields, and the plurality of initial traffic file blocks, where the plurality of candidate traffic file blocks correspond to a plurality of target attribute fields, and the plurality of target attribute fields are the attribute fields of the traffic data included in the plurality of candidate traffic file blocks;

[0029] A relationship prediction unit, configured to input the plurality of target attribute fields into a first prediction model, and output the association relationship of the plurality of target attribute fields through the first prediction model;

[0030] A second determination unit, configured to determine the target data ratio of each candidate traffic file block according to the plurality of target attribute fields and the association relationship of the plurality of target attribute fields;

[0031] A use case generation unit, configured to obtain the target test data volume of the to-be-tested service system, and generate the target test cases of the to-be-tested service system according to the target test data volume, the target data ratio, and the plurality of candidate traffic file blocks.

[0032] On the other hand, the present application also provides a computer device, which includes:

[0033] One or more processors;

[0034] A memory; and

[0035] One or more applications, where the one or more applications are stored in the memory and are configured to be executed by the processor to implement the steps in the use case generation method based on association fields described in any one of the first aspects.

[0036] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program is loaded by a processor to execute the steps in the use case generation method based on association fields described in any one of the first aspects.

[0037] The present application determines a plurality of candidate traffic file blocks according to the test service, a plurality of initial attribute fields, and a plurality of initial traffic file blocks, and generates target test cases of the to-be-tested service system based on the plurality of candidate traffic file blocks, the plurality of target attribute fields corresponding to the plurality of candidate traffic file blocks, and the association relationship of the plurality of target attribute fields, which can shorten the test cycle of the to-be-tested service system and improve the test efficiency of the to-be-tested service system. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0039] Figure 1 It is a schematic diagram of the scenario of the use case generation system based on association fields provided by the embodiment of the present application;

[0040] Figure 2 It is a schematic flowchart of an embodiment of the use case generation method based on association fields provided by the embodiment of the present application;

[0041] Figure 3 It is a schematic structural diagram of an embodiment of the use case generation device based on association fields provided by the embodiment of the present application;

[0042] Figure 4It is a schematic structural diagram of an embodiment of the computer device provided in the embodiments of the present application. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0044] In the description of the present application, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation to the present application. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined with "first" and "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 otherwise specifically defined.

[0045] In the present application, the term "exemplary" is used to mean "serving as an example, illustration, or description". Any embodiment described as "exemplary" in the present application is not necessarily to be construed as more preferred or more advantageous than other embodiments. In order for any person skilled in the art to implement and use the present application, the following description is given. In the following description, details are set forth for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can be implemented without the use of these specific details. In other instances, well-known structures and processes are not described in detail to avoid unnecessary details from obscuring the description of the present application. Therefore, 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 in the present application.

[0046] It should be noted that since the method in the embodiments of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time, which is actually time information. It can be understood that if dimensions, quantities, positions, etc. are mentioned in subsequent embodiments, they are all corresponding data existences for the computer device to process, and specific details are not elaborated here.

[0047] An embodiment of the present application provides a use case generation method, device, equipment and storage medium based on associated fields, which will be described in detail below.

[0048] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the scenario of the use case generation system based on associated fields provided by the embodiment of the present application. The use case generation system based on associated fields may include a computer device 100, and a use case generation device based on associated fields is integrated in the computer device 100, such as Figure 1 the computer device in

[0049] In the embodiment of the present application, the computer device 100 is mainly used to cut the obtained production traffic file to obtain a plurality of initial traffic file blocks, and the plurality of initial traffic file blocks correspond to a plurality of initial attribute fields, and the plurality of initial attribute fields are attribute fields of traffic data included in the plurality of initial traffic file blocks; obtain the test service of the to-be-tested service system, and determine a plurality of candidate traffic file blocks according to the test service, the plurality of initial attribute fields and the plurality of initial traffic file blocks, and the plurality of candidate traffic file blocks correspond to a plurality of target attribute fields, and the plurality of target attribute fields are attribute fields of traffic data included in the plurality of candidate traffic file blocks; input the plurality of target attribute fields into a first prediction model, and output the association relationship of the plurality of target attribute fields through the first prediction model; determine the target data ratio of each candidate traffic file block according to the plurality of target attribute fields and the association relationship of the plurality of target attribute fields; obtain the target test data volume of the to-be-tested service system, and generate the target test use case of the to-be-tested service system according to the target test data volume, the target data ratio and the plurality of candidate traffic file blocks. It is possible to screen the traffic data in the production traffic file according to the test service of the to-be-tested service system and the association relationship of a plurality of target attribute fields, and generate the test use case of the to-be-tested service system based on the screened traffic data, shorten the test cycle of the to-be-tested service system, and improve the test efficiency of the to-be-tested service system.

[0050] In the embodiment of the present application, the computer device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing (Cloud Computing).

[0051] It can be understood that the computer device 100 used in the embodiments of the present application can be a device that includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device can include: cellular or other communication devices, which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. Specifically, the computer device 100 can be a desktop terminal or a mobile terminal, and specifically, the computer device 100 can also be one of a mobile phone, a tablet computer, a laptop computer, etc.

[0052] Those skilled in the art can understand that Figure 1 the application environment shown in Figure 1 is only one application scenario of the solution of the present application, and does not constitute a limitation on the application scenario of the solution of the present application. Other application environments can also include more or fewer computer devices than Figure 1 shown in

[0053] For example, Figure 1 as shown in

[0054] the use case generation system based on the association field can also include a memory 200 for storing data, such as traffic data, for example, several traffic data included in a production traffic file, traffic data included in each initial traffic file block among several initial traffic file blocks, traffic data included in each candidate traffic file block among several candidate traffic file blocks, etc., such as the correspondence between traffic file blocks and attribute fields, for example, the correspondence between several initial traffic file blocks and several initial attribute fields, the correspondence between several candidate traffic file blocks and several target attribute fields. Figure 1 It should be noted that

[0055] the scenario schematic diagram of the use case generation system based on the association field shown in is only an example. The use case generation system and scenario described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the use case generation system based on the association field and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0055] First, an embodiment of the present application provides a use case generation method based on associated fields. The execution subject of the use case generation method based on associated fields is a use case generation device based on associated fields. The use case generation device based on associated fields is applied to a computer device. The use case generation method based on associated fields includes: cutting the obtained production traffic file to obtain a plurality of initial traffic file blocks, where the plurality of initial traffic file blocks correspond to a plurality of initial attribute fields, and the plurality of initial attribute fields are attribute fields of traffic data included in the plurality of initial traffic file blocks; obtaining a test service of a to-be-tested service system, and determining a plurality of candidate traffic file blocks according to the test service, the plurality of initial attribute fields, and the plurality of initial traffic file blocks, where the plurality of candidate traffic file blocks correspond to a plurality of target attribute fields, and the plurality of target attribute fields are attribute fields of traffic data included in the plurality of candidate traffic file blocks; inputting the plurality of target attribute fields into a first prediction model, and outputting the association relationship of the plurality of target attribute fields through the first prediction model; determining the target data ratio of each candidate traffic file block according to the plurality of target attribute fields and the association relationship of the plurality of target attribute fields; obtaining the target test data volume of the to-be-tested service system, and generating a target test case of the to-be-tested service system according to the target test data volume, the target data ratio, and the plurality of candidate traffic file blocks.

[0056] As Figure 2 shown, it is a schematic flowchart of an embodiment of the use case generation method based on associated fields in an embodiment of the present application. The use case generation method based on associated fields includes:

[0057] S100. Cut the obtained production traffic file to obtain a plurality of initial traffic file blocks, where the plurality of initial traffic file blocks correspond to a plurality of initial attribute fields, and the plurality of initial attribute fields are attribute fields of traffic data included in the plurality of initial traffic file blocks.

[0058] The production traffic file includes a plurality of traffic data. The plurality of traffic data are traffic data generated during the operation of the to-be-tested service system in the online environment. The online environment can also be referred to as the online operation environment, which refers to the operation environment facing online users. The traffic data generated during the operation of the to-be-tested service system in the online environment include request data packets sent to the to-be-tested service system and response data packets returned after being processed by the to-be-tested service system.

[0059] A number of initial traffic file blocks are the file blocks obtained by cutting the production traffic file. A number of initial attribute fields are the attribute fields of the traffic data contained in the a number of initial traffic file blocks. The a number of initial attribute fields correspond to the a number of initial traffic file blocks. The a number of initial attribute fields include, but are not limited to, interface number, channel number, enumerated value, scenario code, etc. For example, the initial traffic file block A contains traffic data A1, traffic data A2, and traffic data A3, and the initial traffic file block B contains traffic data B1, traffic data B2, and traffic data B3. The traffic data A1, traffic data A2, and traffic data A3 have the same initial attribute field A, and the traffic data B1, traffic data B2, and traffic data B3 have the same initial attribute field B. Then the initial traffic file block A corresponds to the initial attribute field A, and the initial traffic file block B corresponds to the initial attribute field B. After obtaining the production traffic file in this embodiment, the obtained production traffic file is cut to obtain a number of initial traffic file blocks, so as to generate target test cases for testing the to-be-tested service system based on the a number of initial traffic file blocks in subsequent steps.

[0060] In a specific embodiment, step S100 includes:

[0061] S110. Obtain the attribute fields of the traffic data contained in the production traffic file;

[0062] S120. Cut the production traffic file according to the attribute fields of the traffic data contained in the production traffic file to obtain a number of initial traffic file blocks.

[0063] The production traffic file contains a number of traffic data, and each traffic data has a corresponding attribute field. After obtaining the production traffic file in this embodiment, the attribute fields of the traffic data contained in the production traffic file are further obtained, and then the production traffic file is cut according to the attribute fields of the traffic data contained in the production traffic file to obtain a number of cut traffic files. Then, the a number of cut traffic files are grouped so that the cut traffic files of the traffic data with the same attribute fields are divided into the same group to obtain a number of traffic file groups. Finally, the cut traffic files in each traffic file group are merged to obtain a number of initial traffic file blocks. For example, the production traffic file is cut to obtain cut traffic file R1, cut traffic file R2, and cut traffic file R3. The traffic data contained in cut traffic file R1 and cut traffic file R2 have the same attribute fields. Then cut traffic file R1 and cut traffic file R2 are assigned to the same group, and cut traffic file R1 and cut traffic file R2 are merged.

[0064] S200. Obtain the test service of the service system to be tested. According to the test service, the several initial attribute fields, and the several initial traffic file blocks, determine several candidate traffic file blocks. The several candidate traffic file blocks correspond to several target attribute fields, and the several target attribute fields are the attribute fields of the traffic data included in the several candidate traffic file blocks.

[0065] The test service is the service that the service system to be tested needs to test. The test service includes the update service of the service system to be tested and the services associated with the update service. Taking the banking service system as an example, when the update service of the banking service system is the cash withdrawal service, since the user needs to enter the account password to log in before performing the cash withdrawal operation when withdrawing cash, the test service includes the cash withdrawal service and the login service associated with the cash withdrawal service. Considering that after updating a certain service of the service system to be tested, the update operation generally only affects the update service and the services associated with the update service. After obtaining several initial traffic file blocks in this embodiment, further obtain the test service of the service system to be tested, and then determine several candidate traffic file blocks according to the test service, several initial attribute fields, and several initial traffic file blocks, so as to generate the target test cases of the service system to be tested based on the several candidate traffic file blocks in the subsequent steps.

[0066] In a specific implementation manner, in step S200, the determining several candidate traffic file blocks according to the test service, the several initial attribute fields, and the several initial traffic file blocks includes:

[0067] S210. According to the test service and the several initial attribute fields, determine several target attribute fields. The several target attribute fields are the initial attribute fields in the several initial attribute fields that are associated with the test service;

[0068] S220. Determine the several initial traffic file blocks corresponding to the several target attribute fields as several candidate traffic file blocks.

[0069] In a specific implementation manner of the present application, the several target attribute fields are the initial attribute fields selected from the several initial attribute fields according to the test service of the service system to be tested and associated with the test service, and the several candidate traffic file blocks are the initial traffic file blocks corresponding to the initial attribute fields associated with the test service. When determining several candidate traffic file blocks according to the test service, several initial attribute fields, and several initial traffic file blocks in this embodiment, first determine several target attribute fields according to the test service and several initial attribute fields, where the several target attribute fields are the initial attribute fields selected from the several initial attribute fields and associated with the test service, and then determine the several initial traffic file blocks corresponding to the several target attribute fields as several candidate traffic file blocks.

[0070] In a specific embodiment, step S210 includes:

[0071] S211. Input the test service and the several initial attribute fields into a second prediction model, and output the several target attribute fields through the second prediction model.

[0072] In a specific implementation manner of the present application, several target attribute fields associated with the test service are screened out from several initial attribute fields through a second prediction model. Correspondingly, after obtaining the test service of the service system to be tested, the test service and several initial attribute fields are input into the second prediction model, and several target attribute fields are output through the second prediction model. Among them, the second prediction model is obtained by training a preset first network model based on a preset first training sample set. The first training sample set includes several training services, several training attribute fields, and the true attribute fields of each training service in the several training services. The preset first network model can adopt a deep learning model or a machine learning model. For example, Convolutional Neural Networks (CNN), De-Convolutional Networks (DN), etc.

[0073] S300. Input the several target attribute fields into a first prediction model, and output the association relationships of the several target attribute fields through the first prediction model.

[0074] The association relationships are the association relationships between the several target attribute fields corresponding to several candidate traffic file blocks. For example, candidate traffic file block A corresponds to target attribute field A, candidate traffic file block B corresponds to target attribute field B, candidate traffic file block C corresponds to target attribute field C, candidate traffic file block D corresponds to target attribute field D, target attribute field A is associated with target attribute field C, and target attribute field B is associated with target attribute field D. After obtaining several candidate traffic file blocks in this embodiment, the several target attribute fields corresponding to the several candidate traffic file blocks are input into the first prediction model, and the association relationships of the several target attribute fields are output through the first prediction model. Among them, the first prediction model is obtained by training a preset second network model based on a preset second training sample set. The second training sample set includes several training attribute fields and the true association relationships between the several training attribute fields. The preset second network model can adopt a deep learning model or a machine learning model. For example, Convolutional Neural Networks (CNN), De-Convolutional Networks (DN), etc.

[0075] S400. Determine the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationships of the several target attribute fields.

[0076] The target data ratio is the ratio of the traffic data required in each candidate traffic file block when testing the to-be-tested service system. For example, if the target data ratio of candidate traffic file block A is 20%, it means that 20% of the traffic data in candidate traffic file block A needs to be used to test the to-be-tested service system. After determining the association relationships of the several target attribute fields in this embodiment, according to the several target attribute fields and the association relationships of the several target attribute fields, the target data ratio of each candidate traffic file block is determined, so as to generate the target test cases of the to-be-tested service system based on the target data ratio in the subsequent steps.

[0077] In a specific embodiment, step S400 includes:

[0078] S410. Determine the field data ratio of each target attribute field among the several target attribute fields according to the several target attribute fields and the association relationships of the several target attribute fields;

[0079] S420. Determine the field data ratio of each target attribute field as the target data ratio of the candidate traffic file block corresponding to each target attribute field.

[0080] The field data ratio is the data ratio of each target attribute field required by the to-be-tested service system determined according to the several target attribute fields and the association relationships of the several target attribute fields. When determining the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationships of the several target attribute fields in this embodiment, first, according to the several target attribute fields and the association relationships of the several target attribute fields, the field data ratio of each target attribute field among the several target attribute fields is determined, and then the field data ratio of each target attribute field is determined as the target data ratio of the candidate traffic file block corresponding to each target attribute field.

[0081] In a specific embodiment, step S410 includes:

[0082] S411. Input the several target attribute fields and the association relationships of the several target attribute fields into the third prediction model, and output the field data ratio of each target attribute field among the several target attribute fields through the third prediction model.

[0083] In a specific implementation manner of the present application, the field data ratio of each target attribute field among a number of target attribute fields is determined through a third prediction model. Correspondingly, after determining the association relationships of the number of target attribute fields, the number of target attribute fields and the association relationships of the number of target attribute fields are input into the third prediction model, and the field data ratio of each target attribute field among the number of target attribute fields is output through the third prediction model. Among them, the third prediction model is obtained by training a preset third network model based on a preset third training sample set. The preset third network model can adopt a deep learning model or a machine learning model. For example, a Convolutional Neural Networks (CNN), a De-Convolutional Networks (DN), etc.

[0084] S500. Obtain the target test data volume of the to-be-tested service system, and generate the target test case of the to-be-tested service system according to the target test data volume, the target data ratio, and the number of candidate traffic file blocks.

[0085] The target test case is a test case of the to-be-tested service system generated according to the target test data volume, the target data ratio, and the number of candidate traffic file blocks. After determining the target data ratio of each candidate traffic file block in this embodiment, the target test data volume of the to-be-tested service system is further obtained, and the traffic data is screened out from the number of candidate traffic file blocks according to the target test data volume and the target data ratio, and the target test case of the to-be-tested service system is generated based on the screened traffic data. Generating the target test case of the to-be-tested service system based on the screened traffic data in this embodiment can shorten the test cycle of the to-be-tested service system and improve the test efficiency of the to-be-tested service system.

[0086] In a specific implementation manner, step S500 includes:

[0087] S510. Determine the target data volume of each candidate traffic file block according to the target test data volume and the target data ratio;

[0088] S520. Generate the target test case of the to-be-tested service system according to the target data volume and the number of candidate traffic file blocks.

[0089] The target data volume is the volume of traffic data required in each candidate traffic file block when testing the business system to be tested. When generating the target test cases for the business system to be tested according to the target test data volume, the target data ratio, and several candidate traffic file blocks in this embodiment, first, the target data volume of each candidate traffic file block is determined according to the target test data volume and the target data ratio. Then, the traffic data with the target data volume is screened out from each candidate traffic file block, and the target test cases for the business system to be tested are generated based on the screened-out traffic data.

[0090] To better implement the use case generation method based on association fields in the embodiments of the present application, on the basis of the use case generation method based on association fields, an apparatus for generating use cases based on association fields is also provided in the embodiments of the present application, as Figure 3 shown. The apparatus 600 for generating use cases based on association fields includes:

[0091] A file cutting unit 601, configured to cut the obtained production traffic file to obtain several initial traffic file blocks, where the several initial traffic file blocks correspond to several initial attribute fields, and the several initial attribute fields are the attribute fields of the traffic data included in the several initial traffic file blocks;

[0092] A first determination unit 602, configured to obtain the test service of the business system to be tested, and determine several candidate traffic file blocks according to the test service, the several initial attribute fields, and the several initial traffic file blocks, where the several candidate traffic file blocks correspond to several target attribute fields, and the several target attribute fields are the attribute fields of the traffic data included in the several candidate traffic file blocks;

[0093] A relationship prediction unit 603, configured to input the several target attribute fields into a first prediction model, and output the association relationships of the several target attribute fields through the first prediction model;

[0094] A second determination unit 604, configured to determine the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationships of the several target attribute fields;

[0095] A use case generation unit 605, configured to obtain the target test data volume of the business system to be tested, and generate the target test cases of the business system to be tested according to the target test data volume, the target data ratio, and the several candidate traffic file blocks.

[0096] In the embodiments of the present application, a number of candidate traffic file blocks are determined according to a test service, a number of initial attribute fields, and a number of initial traffic file blocks, and a target test case for the to-be-tested service system is generated based on the number of candidate traffic file blocks, a number of target attribute fields corresponding to the number of candidate traffic file blocks, and the association relationship of the number of target attribute fields, which can shorten the test cycle of the to-be-tested service system and improve the test efficiency of the to-be-tested service system.

[0097] In some embodiments of the present application, the file cutting unit 601 is specifically configured to:

[0098] Obtain the attribute fields of the traffic data included in the production traffic file;

[0099] Cut the production traffic file according to the attribute fields of the traffic data included in the production traffic file to obtain a number of initial traffic file blocks.

[0100] In some embodiments of the present application, the first determination unit 602 is specifically configured to:

[0101] Determine a number of target attribute fields according to the test service and the number of initial attribute fields, where the number of target attribute fields are the initial attribute fields associated with the test service among the number of initial attribute fields;

[0102] Determine the number of initial traffic file blocks corresponding to the number of target attribute fields as a number of candidate traffic file blocks.

[0103] In some embodiments of the present application, the first determination unit 602 is specifically further configured to:

[0104] Input the test service and the number of initial attribute fields into a second prediction model, and output the number of target attribute fields through the second prediction model.

[0105] In some embodiments of the present application, the second determination unit 604 is specifically configured to:

[0106] Determine the field data ratio of each target attribute field among the number of target attribute fields according to the number of target attribute fields and the association relationship of the number of target attribute fields;

[0107] Determine the field data ratio of each target attribute field as the target data ratio of the candidate traffic file block corresponding to each target attribute field.

[0108] In some embodiments of the present application, the second determination unit 604 is specifically further configured to:

[0109] Input the several target attribute fields and the association relationships of the several target attribute fields into a third prediction model, and output the field data ratio of each target attribute field in the several target attribute fields through the third prediction model.

[0110] In some embodiments of the present application, the use case generation unit 605 is specifically configured to:

[0111] Determine the target data volume of each candidate traffic file block according to the target test data volume and the target data ratio;

[0112] Generate a target test case for the service system to be tested according to the target data volume and the several candidate traffic file blocks.

[0113] An embodiment of the present application further provides a computer device, which integrates any one of the use case generation devices based on associated fields provided in the embodiments of the present application. The computer device includes:

[0114] One or more processors;

[0115] A memory; and

[0116] One or more application programs, where the one or more application programs are stored in the memory and are configured to be executed by the processor to perform the steps in the use case generation method based on associated fields in any one of the embodiments of the use case generation method based on associated fields described above.

[0117] An embodiment of the present application further provides a computer device, which integrates any one of the use case generation devices based on associated fields provided in the embodiments of the present application. As Figure 4 shown, it shows a schematic structural diagram of the computer device involved in the embodiments of the present application. Specifically:

[0118] The computer device may include a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, an input unit 704, and other components. Those skilled in the art can understand that Figure 4 the computer device structure shown in does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:

[0119] The processor 701 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 702, and by invoking the data stored in the memory 702, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701 either.

[0120] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702. The memory 702 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.); the data storage area can store the data created according to the use of the computer device. In addition, 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 devices. Correspondingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0121] The computer device also includes a power supply 703 for powering each component. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 703 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0122] The computer device may also include an input unit 704, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0123] Although not shown, the computer device may also include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 701 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the application programs stored in the memory 702 to realize various functions as follows:

[0124] Cut the obtained production traffic file to obtain a number of initial traffic file blocks, where the number of initial traffic file blocks corresponds to a number of initial attribute fields, and the number of initial attribute fields are the attribute fields of the traffic data included in the number of initial traffic file blocks;

[0125] Obtain the test service of the service system to be tested, and determine a number of candidate traffic file blocks according to the test service, the number of initial attribute fields, and the number of initial traffic file blocks. The number of candidate traffic file blocks corresponds to a number of target attribute fields, and the number of target attribute fields are the attribute fields of the traffic data included in the number of candidate traffic file blocks;

[0126] Input the number of target attribute fields into the first prediction model, and output the association relationship of the number of target attribute fields through the first prediction model;

[0127] Determine the target data ratio of each candidate traffic file block according to the number of target attribute fields and the association relationship of the number of target attribute fields;

[0128] Obtain the target test data volume of the service system to be tested, and generate the target test cases of the service system to be tested according to the target test data volume, the target data ratio, and the number of candidate traffic file blocks.

[0129] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by instructions controlling related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0130] Therefore, an embodiment of the present application provides a computer-readable storage medium, which may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), a magnetic disk or an optical disc, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the use case generation methods based on association fields provided by the embodiments of the present application. For example, when the computer program is loaded by a processor, the following steps can be executed:

[0131] Cut the obtained production traffic file to obtain a number of initial traffic file blocks, where the number of initial traffic file blocks corresponds to a number of initial attribute fields, and the number of initial attribute fields are the attribute fields of the traffic data included in the number of initial traffic file blocks;

[0132] Obtain the test service of the service system to be tested, and determine a number of candidate traffic file blocks according to the test service, the number of initial attribute fields, and the number of initial traffic file blocks. The number of candidate traffic file blocks corresponds to a number of target attribute fields, and the number of target attribute fields are the attribute fields of the traffic data included in the number of candidate traffic file blocks;

[0133] Input the number of target attribute fields into the first prediction model, and output the association relationship of the number of target attribute fields through the first prediction model;

[0134] Determine the target data ratio of each candidate traffic file block according to the number of target attribute fields and the association relationship of the number of target attribute fields;

[0135] Obtain the target test data volume of the service system to be tested, and generate the target test cases of the service system to be tested according to the target test data volume, the target data ratio, and the number of candidate traffic file blocks.

[0136] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the detailed descriptions of other embodiments above, and details will not be repeated here.

[0137] In specific implementation, the above units or structures can be implemented as independent entities, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of the above units or structures, reference can be made to the method embodiments above, and details will not be repeated here.

[0138] For the specific implementation of the above operations, reference can be made to the previous embodiments, and details will not be repeated here.

[0139] The above has introduced in detail a use case generation method, device, device, and storage medium based on association fields provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A use case generation method based on associated fields, characterized in that, the use case generation method based on associated fields includes: Cutting the obtained production traffic file to obtain a number of initial traffic file blocks, where the number of initial traffic file blocks corresponds to a number of initial attribute fields, and the number of initial attribute fields are the attribute fields of the traffic data included in the number of initial traffic file blocks; Obtaining the test service of the to-be-tested business system, and determining a number of candidate traffic file blocks according to the test service, the number of initial attribute fields, and the number of initial traffic file blocks, where the number of candidate traffic file blocks corresponds to a number of target attribute fields, and the number of target attribute fields are the attribute fields of the traffic data included in the number of candidate traffic file blocks; Inputting the number of target attribute fields into a first prediction model, and outputting the association relationship of the number of target attribute fields through the first prediction model; Determining the target data ratio of each candidate traffic file block according to the number of target attribute fields and the association relationship of the number of target attribute fields; Obtaining the target test data volume of the to-be-tested business system, and generating the target test cases of the to-be-tested business system according to the target test data volume, the target data ratio, and the number of candidate traffic file blocks.

2. The use case generation method based on associated fields according to claim 1, characterized in that, the determining a number of candidate traffic file blocks according to the test service, the number of initial attribute fields, and the number of initial traffic file blocks includes: Determining a number of target attribute fields according to the test service and the number of initial attribute fields, where the number of target attribute fields are the initial attribute fields associated with the test service among the number of initial attribute fields; Determining the number of initial traffic file blocks corresponding to the number of target attribute fields as the number of candidate traffic file blocks.

3. The use case generation method based on associated fields according to claim 2, characterized in that, the determining a number of target attribute fields according to the test service and the number of initial attribute fields includes: Inputting the test service and the number of initial attribute fields into a second prediction model, and outputting the number of target attribute fields through the second prediction model.

4. The use case generation method based on associated fields according to claim 1, characterized in that, the determining the target data ratio of each candidate traffic file block according to the number of target attribute fields and the association relationship of the number of target attribute fields includes: Determining the field data ratio of each target attribute field among the number of target attribute fields according to the number of target attribute fields and the association relationship of the number of target attribute fields; Determining the field data ratio of each target attribute field as the target data ratio of the candidate traffic file block corresponding to each target attribute field.

5. The use case generation method based on associated fields according to claim 4, characterized in that, Determining the field data ratio of each target attribute field in the several target attribute fields according to the several target attribute fields and the association relationship thereof includes: Inputting the several target attribute fields and the association relationship thereof into a third prediction model, and outputting the field data ratio of each target attribute field in the several target attribute fields through the third prediction model.

6. The use case generation method based on associated fields according to claim 1, wherein, Generating a target test case for the service system under test according to the target test data volume, the target data ratio, and the several candidate traffic file blocks includes: Determining the target data volume of each candidate traffic file block according to the target test data volume and the target data ratio; Generating a target test case for the service system under test according to the target data volume and the several candidate traffic file blocks.

7. The use case generation method based on associated fields according to claim 1, wherein, Cutting the obtained production traffic file to obtain several initial traffic file blocks includes: Obtaining the attribute fields of the traffic data included in the production traffic file; Cutting the production traffic file according to the attribute fields of the traffic data included in the production traffic file to obtain several initial traffic file blocks.

8. A use case generation device based on associated fields, wherein, The use case generation device based on associated fields includes: A file cutting unit configured to cut the obtained production traffic file to obtain several initial traffic file blocks, where the several initial traffic file blocks correspond to several initial attribute fields, and the several initial attribute fields are the attribute fields of the traffic data included in the several initial traffic file blocks; A first determination unit configured to obtain the test service of the service system under test, and determine several candidate traffic file blocks according to the test service, the several initial attribute fields, and the several initial traffic file blocks, where the several candidate traffic file blocks correspond to several target attribute fields, and the several target attribute fields are the attribute fields of the traffic data included in the several candidate traffic file blocks; A relationship prediction unit configured to input the several target attribute fields into a first prediction model, and output the association relationship of the several target attribute fields through the first prediction model; A second determination unit configured to determine the target data ratio of each candidate traffic file block according to the several target attribute fields and the association relationship thereof; A use case generation unit configured to obtain the target test data volume of the service system under test, and generate a target test case for the service system under test according to the target test data volume, the target data ratio, and the several candidate traffic file blocks.

9. A computer device, wherein, The computer device includes: One or more processors; A memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps in the association field-based use case generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, a computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the association field-based use case generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Software testing data generation method and device

    CN107480053A

  • Interface test method based on flow data, electronic device and storage medium

    CN112214395A