CN112306854B - Case testing method and device, electronic equipment and storage medium - Google Patents

Case testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112306854B
CN112306854B CN201910709168.2A CN201910709168A CN112306854B CN 112306854 B CN112306854 B CN 112306854B CN 201910709168 A CN201910709168 A CN 201910709168A CN 112306854 B CN112306854 B CN 112306854B
Authority
CN
China
Prior art keywords
test
service data
case
testing
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910709168.2A
Other languages
Chinese (zh)
Other versions
CN112306854A (en
Inventor
郑越
徐林华
陈玉
黄亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910709168.2A priority Critical patent/CN112306854B/en
Publication of CN112306854A publication Critical patent/CN112306854A/en
Application granted granted Critical
Publication of CN112306854B publication Critical patent/CN112306854B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a use case testing method, a device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring service data required by testing the test case to be tested; clustering the service data to obtain clustered clusters; acquiring a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination; acquiring a test action sequence corresponding to each label combination based on the mapping relation between the label combination and the test action sequence; and assembling the test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, and inputting the service data to test the use cases. The embodiment of the disclosure can improve the flexibility and efficiency of the use case test.

Description

Case testing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of case testing, in particular to a case testing method, a device, electronic equipment and a storage medium.
Background
In software testing, it is often necessary to test use cases in a test environment. In the prior art, a test action sequence is determined in advance according to an existing scene, service data of the scene is grabbed when the use cases in the specific scene are tested, and the use cases are tested according to the test action sequence determined in advance. If a new scene appears or the test environment is changed, the situation that the captured service data cannot test the use case according to a predetermined test action sequence is likely to occur. At this time, the user needs to re-analyze the new scene and manually adjust the test action sequence to complete the test of the use case, so that the flexibility and efficiency of the test of the use case are greatly affected.
Disclosure of Invention
An object of the present disclosure is to provide a method, an apparatus, an electronic device, and a storage medium for testing a use case, which can improve flexibility and efficiency of use case testing.
According to an aspect of the disclosed embodiments, a use case testing method is disclosed, including:
acquiring service data required by testing the test case to be tested;
clustering the service data to obtain clustered clusters;
acquiring a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
acquiring a test action sequence corresponding to each label combination based on the mapping relation between the label combination and the test action sequence;
and assembling the test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, and inputting the service data to test the use cases.
According to an aspect of the disclosed embodiments, a use case testing device is disclosed, including:
the first acquisition module is used for acquiring service data required by testing the test case to be tested;
the clustering module is used for clustering the service data to obtain clustered clusters;
the second acquisition module is used for acquiring the label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
The third acquisition module is used for acquiring a test action sequence corresponding to each label combination based on the mapping relation between the label combination and the test action sequence;
and the assembling module is used for assembling the test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, and inputting the service data to test the use cases.
According to an aspect of the present disclosure, an electronic device for use case testing is disclosed, including:
a memory configured to store executable instructions;
a processor configured to execute the executable instructions stored in the memory to perform the method described above.
According to an aspect of the disclosure, a computer-readable storage medium storing computer program instructions that, when executed by a computer, cause the computer to perform the method described above is disclosed.
Compared with the method that in the prior art, a test action sequence under a scene is determined in advance, then service data required by the test under the scene is acquired, and the service data required by the test is adapted to the test action sequence.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIGS. 1A-1D illustrate architecture diagrams according to one embodiment of the present disclosure.
Fig. 2 illustrates a general process according to one embodiment of the present disclosure in a specific application scenario.
FIG. 3 illustrates a flow chart of use case testing according to one embodiment of the present disclosure.
FIG. 4 illustrates a flowchart for obtaining business data required to test a test case under test, according to one embodiment of the present disclosure.
5A-5B illustrate a flowchart of performing a supplemental task according to one embodiment of the present disclosure.
FIG. 6 illustrates an interface diagram of a user configuration interface in a use case testing platform according to one embodiment of the present disclosure.
FIG. 7 illustrates an interface diagram of a user configuration interface in a use case testing platform according to one embodiment of the present disclosure.
FIG. 8 illustrates a block diagram of a use case testing apparatus according to one embodiment of the present disclosure.
FIG. 9 illustrates a hardware architecture diagram of an electronic device for use case testing according to one embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more example embodiments. In the following description, numerous specific details are provided to give a thorough understanding of example embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, steps, etc. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The architecture of an embodiment of the present disclosure is described below with reference to fig. 1A-1D.
FIG. 1A shows the basic composition of the architecture of an embodiment of the present disclosure: the system comprises a use case test platform 10, a test environment 20 and a user side 30. The case test platform 10 is used as an execution main body of the embodiment of the disclosure and is used for testing a test case to be tested; the test environment 20 is a system environment in which the test case to be tested is located; the user terminal 30 is a terminal used by a case tester, and can connect to the case testing platform 10, and perform corresponding configuration on the case testing platform 10 to control a process of case testing.
Fig. 1B illustrates basic components of the architecture of the embodiment of the present disclosure at the cloud framework layer and the user function layer, respectively: the cloud frame layer consists of a use case test platform 10 and a test environment 20; the user function layer includes a network and an application programming interface, and the use case testing platform 10 provides the user side 30 shown in fig. 1A with related functions capable of executing the embodiments of the present disclosure through the user function layer. Wherein the network is used for providing basic communication functions for the user terminal 30 shown in fig. 1A; the api is mainly used for providing the user terminal 30 shown in fig. 1A with the parameter configuration related functions.
FIG. 1C illustrates the specific composition of a use case test platform 10 and a test environment 20 in a architecture of an embodiment of the present disclosure: the use case test platform 10 is composed of an acquisition subsystem 101, a classification subsystem 102, an assembly subsystem 103 and a platform database 104. Wherein, the acquisition subsystem 101 is used for acquiring data from the test environment 20 and writing a data path of the acquired data into the platform database 104; the classification subsystem 102 reads the data path written by the acquisition subsystem 101 from the platform database 104, classifies the data corresponding to the data path, and then writes the label mapping obtained by classification into the platform database 104; the assembly subsystem 103 reads the data path written by the acquisition subsystem and the label mapping written by the classification subsystem 102 from the platform database 104, and determines a test action on the basis of the data path written by the acquisition subsystem and the label mapping written by the classification subsystem, so that the test action is executed in the test environment 20, and the test of the use case is realized.
Fig. 1D shows specific compositions of the architecture of the embodiment of the present disclosure at the cloud framework layer and the user-defined layer, respectively: the cloud frame layer consists of an acquisition subsystem 101, a classification subsystem 102, an assembly subsystem 103, a platform database 104 and a test environment 20; the user definition layer shows which configuration and definition can be specifically performed on each subsystem of the use case testing platform 10 by the user terminal 30 shown in fig. 1A based on the user function layer shown in fig. 1B. Specifically, the user side 30 shown in fig. 1A can configure a scanning mode, a scanning path, and a supplementing mode of the acquisition subsystem 101 when acquiring data; label judgment rules adopted by the classification subsystem 102 in classifying data can be configured; the external use case system can be connected by invoking an application programming interface to configure the assembly subsystem 103 to determine the relevant course of test action.
The general process of embodiments of the present disclosure in a specific application scenario is described below with reference to fig. 2.
In an embodiment, the case test platform is to complete the test of the test case to be tested in the scenario of "bank card balance payment". Fig. 2 shows the general procedure of this embodiment: in the embodiment, a case test platform acquires service data required by testing a to-be-tested case in a 'bank card balance payment' scene from a test environment, and further determines a test action sequence corresponding to the service data; and assembling a test action sequence to obtain a test script for testing the test case in the 'bank card balance payment' scene, and finally taking the business data as the input of the test script to finish the test of the test case in the 'bank card balance payment' scene. The user can configure parameters on the use case test platform through the user side so as to ensure the smooth test.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
The steps of the implementation of the embodiments of the present disclosure are described in detail below.
The execution body of the embodiment of the present disclosure is the use case test platform 10 shown in fig. 1A, as shown in fig. 3, and according to one embodiment of the present disclosure, there is provided a use case test method, including:
Step 410, obtaining service data required by testing the test case to be tested;
step 420, clustering the service data to obtain clustered clusters;
step 430, obtaining a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
step 440, based on the mapping relation between the label combinations and the test action sequences, obtaining the test action sequences corresponding to each label combination;
and 450, assembling the test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, and inputting the service data to test the use cases.
Business data refers to data generated by various types of business activities performed in a test environment. For example: data generated by a refund activity and data generated by a login activity.
The service data feature is a feature that can distinguish the category to which the service data belongs. Wherein the business data features can be distinguished by keywords of the business data. For example: the service data is stored in the form of key-value pairs, the keywords of which can be used to distinguish the corresponding service data features.
The clustering refers to the data belonging to the same class after the data are clustered.
In the embodiment of the disclosure, before determining a test action sequence adopted for testing the test case to be tested, service data required for testing the test case to be tested is firstly obtained. Clustering and labeling the service data, further determining a test action sequence adopted for testing the test case on the basis of the clustering and labeling, and assembling the test action sequence into a test script. And finally, testing the test case to be tested according to the test script by using the service data.
It should be noted that, because the use case describes only the abstract system function requirement, the use case is tested, that is, whether the operation of the system function described by the use case under various scenes can meet the described requirement, that is, the test of the use case depends on the specific scene. In general, a case corresponds to multiple scenes, and accordingly, service data corresponding to the case in different scenes is not the same. That is, even for the same test case, the service data required for testing the test case is different in different scenarios.
Therefore, for convenience of understanding, in the following description of the embodiments of the present disclosure, without specific description, "the service data required for testing the test case" refers to the service data just required for testing the test case for a single scenario.
The following describes a specific process of acquiring service data required for testing a test case to be tested.
In step 410, the business data required for testing the test case to be tested is obtained.
In one embodiment, as shown in FIG. 4, step 410 includes:
step 4101, obtaining a scanning range input by a user;
step 4102, scanning service data in the scanning range stored in the testing environment where the use case is located, as service data required by testing.
The scan range indicates which data to scan in the test environment as the traffic data required for the test. For example: the data of the database named "order" and the data of the database named "user" in the test environment are scanned as the service data required for the test.
In an embodiment, a user performs configuration on a case test platform, and inputs a scanning range for acquiring service data required by a test. And the acquisition subsystem of the case test platform scans service data in a scanning range in a test environment where the test case to be tested is positioned according to the scanning range input by a user, and the service data is used as service data required by the test.
For example: the user configures a scanning range name of "order" on the use case test platform, the corresponding scanning mode is "database", and the corresponding scanning parameter is "10.2.3.4|select*from xxx". The collection subsystem of the use case test platform scans the service data in the database order according to the scanning parameters 10.2.3.4|select*from xxx.
The embodiment has the advantage that the scanning range of the service data is indicated by the user, so that the flexibility of the user test case is improved.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In one embodiment, the user-entered scan range is a plurality of scan ranges.
For example: as shown in Table 1, the user configures the scan range name, the corresponding scan mode and the corresponding scan parameters on the case test platform. And the acquisition subsystem of the use case test platform scans the service data in each scanning range according to the configuration of the user.
Scan range name Scanning mode Scanning parameters
order Database for storing data 10.2.3.4|select*from xxx
merchant Database for storing data 10.2.3.5|select*from xxx
merchant_conf File 10.2.3.5|/data/conf/xxx.xml
user Database for storing data 10.2.3.6|select*from xxx
TABLE 1 scanning configuration example
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In an embodiment, before scanning the service data in the scanning range stored in the testing environment where the use case is located as the service data required for testing, the method further includes:
acquiring association information corresponding to each scanning range input by a user;
the scanning of the service data in the scanning range stored in the testing environment where the use case is located as the service data required by the test comprises the following steps:
Scanning business data stored in the test environment within the scanning range;
scanning service data corresponding to the associated information stored in the test environment;
and combining the service data in the scanning range with the service data corresponding to the association information to serve as the service data required by the test.
In the disclosed embodiments, each scan range generally indicates a file, a table, or a database in the test environment. When the use case is actually tested, the situation that the service data in a certain scanning range has strong correlation with other data may occur, and only the service data in the scanning range has complete service significance together with the other data. In this case, in order to completely test the use case, the user additionally configures association information corresponding to each scanning range on the use case testing platform, so that the acquisition subsystem of the use case testing platform can combine the service data corresponding to the association information with the service data corresponding to the corresponding scanning range.
In one embodiment, a user inputs a plurality of scan ranges and associated information corresponding to each scan range. Wherein, the association information corresponding to the scanning range may be null.
For example: as shown in Table 2, the user configures the scan range name, the corresponding scan mode, the corresponding scan parameters and the corresponding associated information on the case test platform.
Scan range name Scanning mode Scanning parameters Association information
order Database for storing data 10.2.3.4|select*from xxx
merchant Database for storing data 10.2.3.5|select*from xxx id==order.merchant
merchant_conf File 10.2.3.5|/data/conf/xxx.xml id==order.merchant
user Database for storing data 10.2.3.6|select*from xxx id==order.user
TABLE 2 scanning configuration example
This embodiment has the advantage that it allows the user to configure the association information, improving the acquisition integrity of the service data required for the test.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In an embodiment, the association information may be a field of the corresponding data, or may be a data path of the corresponding data.
In an embodiment, obtaining service data required for testing the test case to be tested further includes:
and storing the scanned data path of the service data.
In this embodiment, after the service data is scanned, the collecting subsystem of the use case testing platform does not directly take the service data out of the testing environment, but stores the data path of the scanned service data into the platform database of the use case testing platform.
The embodiment has the advantage that the data path is stored in the platform database of the use case test platform instead of storing the original data, so that the burden of the platform database is reduced.
The detailed process of further processing the service data required for testing after it is acquired is described below.
In one embodiment, after obtaining the service data required for testing the test case to be tested, the method includes:
and performing failure check on the service data, and removing the failed service data from the acquired service data.
In the embodiment of the disclosure, in order to ensure the smooth performance of the use case test, after the service data required by the test is obtained, the service data is subjected to failure check. If one service data has failed, it indicates that it can no longer be used, and therefore, it can not be used for testing of use cases, so that the failed service data is discarded.
This embodiment has the advantage that the availability of the service data required for the acquired test is ensured by the failure check.
In an embodiment, performing a failure check on the service data includes at least one of:
acquiring the validity period of the service data, and determining the service data with the current time exceeding the validity period as invalid service data;
and acquiring the current state of the service data, and determining the service data with the current state inconsistent with the effective state as invalid service data.
In one embodiment, the business data in the test environment is marked with a corresponding validity period. After acquiring service data required by the test from the test environment, the acquisition subsystem of the use case test platform determines whether the corresponding service data fails according to the comparison of the current time and the validity period.
In one embodiment, the business data in the test environment is identified with corresponding states, wherein the states are transferred accordingly as the business data is active and invoked. When the state of a service data is transferred to a state which is not consistent with the valid state, the service data is indicated to be invalid.
In an embodiment, after obtaining the service data required for testing the test case to be tested, the method further includes:
and if the acquired service data volume is lower than a preset service data volume threshold, supplementing and acquiring the service data required by testing the test case to be tested until the acquired service data reaches the preset service data volume threshold.
In this embodiment, a service data amount threshold is preset, and if the data amount of the service data required for the test acquired by the acquisition subsystem of the case test platform does not reach the threshold, the supplementary service data is started until the data amount of the acquired service data reaches the threshold.
The embodiment has the advantage that the supplementary service data is judged by the threshold value, so that sufficient service data required by the test can be ensured when the to-be-tested case is tested.
In an embodiment, after obtaining the service data required for testing the test case to be tested, the method further includes:
and supplementing and acquiring service data required by testing the test case to be tested every preset time period until the quantity of the service data obtained by supplementing reaches a preset supplementing and acquiring quantity threshold value.
In this embodiment, a supplementary acquisition amount threshold is preset, and the acquisition subsystem of the case test platform periodically starts supplementary service data. And starting a supplementary task by the acquisition subsystem of the case test platform every preset time period until the data volume of the supplementary service data reaches the supplementary acquisition volume threshold value.
An advantage of this embodiment is that by timing the supplementary service data, it is ensured that the amount of service data required for the test remains stable within a certain range.
In one embodiment, FIG. 5A illustrates a triggering process for the acquisition subsystem of the case testing platform to perform a supplemental task: after acquiring the service data required for testing the test case to be tested, more specifically, after starting the test action sequence assembly, the data amount of the effective data of the service data required for the test is checked. And if the data quantity of the effective data is lower than the threshold value, starting a supplementary task. The collection subsystem of the use case test platform reads the configuration (such as the scanning range, the scanning mode and the scanning parameters configured by the user) of the user and executes the supplementary task.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In one embodiment, FIG. 5B illustrates a detailed flow of the acquisition subsystem of the case testing platform performing the supplemental tasks: triggering the acquisition subsystem to execute the supplementary task by timing starting or the effective data is lower than a threshold value; the acquisition subsystem starts a scanning task and reads the configuration of a user; and loading a corresponding scanning mode according to the configuration (such as a scanning range, a scanning mode and scanning parameters configured by a user), executing scanning according to the corresponding scanning mode, and storing the data path of the scanned service data into a platform database of the use case testing platform.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
The detailed process of clustering acquired service data is described below.
In step 420, the service data is clustered to obtain clustered clusters.
Clustering is a data grouping method of unsupervised learning. Given a heap of data, a clustering algorithm may divide the heap of data into a set of groups of data. Theoretically, data in the same group has similar features, while data in different groups has highly different features. Wherein the data of the same group after clustering is collectively called a cluster.
The main idea of the embodiment of the disclosure for testing the use cases is as follows: firstly, service data required by testing is acquired, and then a testing action sequence is determined aiming at the service data. In order to determine the test action sequence corresponding to the service data, the service data should be classified first, then the test action sequence to be executed for each type of service data should be determined according to the classification, and finally the test action sequence corresponding to each type of service data is assembled into a test script. Specifically, in the embodiment of the present disclosure, when classifying service data, the service data is clustered first, so as to determine the class of each clustered cluster.
In one embodiment, the use case testing platform clusters the business data required for testing into clusters according to Density based on a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm. The DBSCAN clustering algorithm is a prior art, so the specific algorithm content is not described here again.
An advantage of this embodiment is that by means of unsupervised learning clustering, an accurate grouping of data with new features can be achieved.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In one embodiment, after clustering the service data to obtain clustered clusters, the method includes:
determining the business data volume of each cluster;
and if the service data volume of one cluster is lower than the service data volume threshold corresponding to the cluster, supplementing and acquiring the service data required by testing the test case to be tested until the service data of each cluster reaches the service data volume threshold after re-clustering.
In this embodiment, performing the supplemental tasks on the traffic data is performed for each cluster after clustering. Presetting a business data quantity threshold corresponding to the cluster, and checking the business data quantity of each cluster after clustering. And if the service data volume of one cluster does not reach the service data volume threshold, triggering to execute a supplementary task, and supplementing and acquiring the service data required by testing the test case to be tested until the service data of each cluster reaches the service data volume threshold after clustering again.
The detailed process of labeling clusters is described below.
In step 430, a label combination corresponding to each cluster is obtained based on the mapping relationship between the service data features and the label combinations.
In the embodiment of the disclosure, obvious characteristic differences exist among the clusters, and obvious differences exist among the business data characteristics of the clusters. Therefore, each cluster can be labeled with a corresponding label combination according to the mapping relation between the service data characteristics of the service data in the cluster and the label combination.
In an embodiment, the mapping relationship between the service data features and the label combination is configured in the following manner:
acquiring a field common to all service data in the cluster, and presenting the field common to the user;
receiving a label combination input by a user;
and establishing a mapping relation between the cluster and the label combination.
In this embodiment, after obtaining each cluster, the use case testing platform extracts, for the same cluster, fields common to each service data in the cluster, and presents the fields to the user. Therefore, a user can mark the cluster with a label combination according to the common field, and input the label combination into the case test platform, so that the case test platform establishes the mapping relation between the cluster and the label combination.
The embodiment has the advantages that the user can flexibly establish the mapping relation between the cluster and the label combination by marking, and the flexibility of the use case test is improved.
In another embodiment, the mapping relationship between the service data features and the tag combinations is configured by: and labeling each cluster based on a labeling rule preset by a user to obtain label combinations respectively corresponding to each cluster.
In this embodiment, a user configures a labeling rule in advance, where the labeling rule can label each cluster according to different points of features between service data of each cluster and common points of service data features inside the cluster, so that a mapping relationship between the cluster and a label combination can be established by a classification subsystem of the use case test platform.
The embodiment has the advantages that the labeling rule is configured in advance, the labeling can be automatically performed, and the efficiency of the use case test is improved.
In an embodiment, after obtaining the label combination corresponding to each cluster, the method includes:
the set of label combinations of each cluster is determined as the label combination of the service data required for the test, and the data path of the service data required for the test is displayed.
In this embodiment, the use case test platform gathers together the label combinations of the clusters, displays the label combinations as the service data required for the test on the user configuration interface, and displays the data path of the service data required for the test. If the user clicks one of the data paths, the case test platform can grasp the service data corresponding to the data path from the test environment and present the service data to the user for the user to inquire.
The embodiment has the advantage of providing data query service for the user and improving the flexibility of the user use case test platform.
In one embodiment, as shown in FIG. 6, the use case testing platform combines the labels of each cluster into a set: the label combination of the service data required for the test is displayed on the user configuration interface, and each data path of the service data required for the test (namely, the service data meeting the WeChat balance payment of the old financial system shown in fig. 6) is displayed: address1, address2. If the user clicks the "query data" button of the data path address1, the case test platform captures the service data of which the data path is address1 in the test environment and presents the data to the user for the user to query.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
It should be noted that, when the test case to be tested is tested, the test case is tested in a specific scene. The service data required for the test can be divided into service data required for the test in the scene and service data required for the test out of the scene according to whether the association with the scene is tightly divided.
For example: for the test case to be tested in the 'old financial system WeChat balance payment' scene, the service data generated by 'logging in the balance payment interface in the old financial system' in the service data required by the test is only suitable for the scene, is closely related to the scene, and belongs to the service data required by the test in the scene; the service data generated by paying 100 yuan in the service data required by the test can be put into other scenes to be used, is not closely related to the scene, and belongs to the service data required by the test outside the scene.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In an embodiment, after obtaining the label combination corresponding to each cluster, the method includes:
and acquiring parameters of service data required by testing outside the scene configured by the user.
In the embodiment, for service data required by the test in the scene, the service data is obtained by scanning from a test environment by an acquisition subsystem of the use case test platform; for the service data required by the test outside the scene, a user can configure corresponding parameters by himself on a user configuration interface provided by the case test platform aiming at the service data required by the test outside the scene, so as to realize a basic data driving function, and the test of the case to be tested can be smoothly carried out.
The embodiment has the advantage of allowing the user to configure parameters of the service data required for the test outside the scene, improving the flexibility of the use case test.
In an embodiment, as shown in fig. 6, for the parameters of the service data required for the test outside the scenario of "satisfy full refund", the user may configure in the configuration column of "satisfy full refund's use case parameters" of the user configuration page of the use case test platform to implement the basic data driving function.
In an embodiment, after obtaining the label combination corresponding to each cluster, the method further includes:
and acquiring a test action sequence configured by a user.
In this embodiment, in the user configuration interface provided by the case test platform, the user may configure the corresponding test action sequence in the test action sequence configuration column thereof by himself, so that the assembly subsystem of the case test platform may assemble a test script with complete functions, and thus the test on the test case to be tested may be performed smoothly.
This embodiment has the advantage that it allows the user to configure the test action sequence, increasing the flexibility of the use case testing.
In an embodiment, as shown in fig. 6, a user may configure a test action sequence by himself in a configuration column "test action sequence satisfying balance withdrawal" of a user configuration page of the case test platform, so that an assembly subsystem of the case test platform can assemble a test script with complete functions.
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
The detailed process of determining the test action sequence required to test the test case under test is described below.
In step 440, a test action sequence corresponding to each tag combination is obtained based on the mapping relationship between the tag combinations and the test action sequences.
In an embodiment, based on a mapping relationship between the tag combinations and the test action sequences, obtaining the test action sequence corresponding to each tag combination includes:
acquiring a preset test action sequence configuration table, wherein the test action sequence configuration table describes a test action sequence corresponding to each label combination;
and acquiring a test action sequence corresponding to each label combination based on the test action sequence configuration table.
In this embodiment, the user configures a corresponding test action sequence for each tag combination that may appear in advance, and writes a test action sequence configuration table into a platform database of the case test platform. Therefore, the assembly subsystem of the use case test platform can determine the test action sequence corresponding to the label combination corresponding to each cluster based on the test action sequence configuration table, and then can complete the assembly of the test action sequence.
It should be noted that, in the embodiment of the present disclosure, the tag combination may include a plurality of tags, or may include only one tag.
The following describes in detail the process of adjusting and establishing the mapping relation between the label combination and the test action sequence along with the data clustering in combination with tables 3.1, 3.2 and 3.3.
In one embodiment, the following table 3.1 shows: initializing a label combination of a data set d1 as t1, and setting a corresponding test action sequence as f1; the label combination of the initial data set d2 is t2, and the corresponding test action sequence is f2.
Label combination Data set Test action sequence
t1 d1 f1
t2 d2 f2
TABLE 3.1 initialized tag combinations and corresponding test action sequences
As shown in table 3.2 below: clustering is performed on the data set d1, and each cluster of the data set d1, namely each subset of the data set d1, is obtained. The tags of each subset of dataset d1 are temporally determined as "t1, [ ]", where "[ ]" indicates the tags of the cluster to be determined. Correspondingly, the test action sequences corresponding to the subsets of the data set d1 are expressed as 'to be adjusted', and further determination is waited for; the subset of the data set d2, the newly added data set d3, and the newly added data set d4 are the same as above, and will not be described in detail here.
Label combination Data set Test action sequence
t1,[] Subset of d1 To be adjusted
t1,[] Subset of d1 To be adjusted
t2,[] Subset of d2 To be adjusted
t2,[] Subset of d2 To be adjusted
[] d3 To be adjusted
[] d4 To be adjusted
TABLE 3.2 intermediate State of tag combinations and corresponding test action sequences after data clustering
As shown in table 3.3 below: and the user determines label combinations of the clustered data sets and test action sequences for the data sets according to the clustering result of the data sets.
Label combination Data set Test action sequence
t1,t3 d11 f1
t1,t4 d12 f1
t2,t3 d21 f2,f3
t2,t4 d22 f2,f4
t3 d3 f3
t4 d4 f4
TABLE 3.3 Manual determination of tag combinations and corresponding test action sequences
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
The following describes the detailed process of assembling the test action sequence and performing the test case under test.
In step 450, the test action sequences corresponding to the label combinations are assembled into the test script corresponding to the use case, and the service data is input to test the use case.
In the embodiment of the disclosure, in order to test the test case to be tested, it is necessary to determine which test action sequences are executed and the execution sequence of the test action sequences, so that the test of the test case to be tested can be completed by using the service data required by the test.
In an embodiment, the assembling the test action sequences corresponding to the tag combinations into the test script corresponding to the use case includes:
and assembling the test action sequences corresponding to each label combination based on a preset assembly template to obtain the test script corresponding to the use case, wherein the assembly template describes the sequence of assembling the test action sequences into the test script.
In this embodiment, a user configures an assembly template in advance, describes an order in which a sequence of test actions is assembled into a test script, and stores the assembly template in a platform database of a case test platform. Therefore, the assembly subsystem of the use case test platform can assemble the test action sequence into a test script based on the assembly template. And further inputting the service data required by the test into a test script, and executing the assembled test action to complete the test of the to-be-tested case.
The embodiment has the advantages that the assembly template is pre-configured, the case test platform can automatically assemble the test action sequence, and the case test efficiency is improved.
In an embodiment, the assembling the test action sequences corresponding to the tag combinations into the test script corresponding to the use case includes:
And displaying the test action sequences corresponding to the label combinations in a preset interface in the form of visual elements, so that a user can assemble the test action sequences by himself.
In this embodiment, after determining the test action sequences corresponding to the tag combinations, the test action sequences are displayed on a predetermined interface in the form of visual elements. The user can complete the assembly of the test action sequence through the dragging and connecting of the visual elements.
This embodiment has the advantage of allowing the user to assemble the test action sequence by himself, increasing the flexibility of the use case test.
The following describes a detailed procedure of the embodiment of the present disclosure in the case where all service data required for testing a test case is tested for multiple scenarios.
In an embodiment, after the obtaining the label combination corresponding to each cluster based on the mapping relationship between the service data feature and the label combination, the method further includes:
displaying label combinations corresponding to the cluster for the user to select;
obtaining a user-selected tag combination, the user-selected tag combination comprising at least one of:
A label combination corresponding to a cluster formed by gathering business data corresponding to the added test scene;
and a label combination corresponding to the cluster formed by the business data in the changed test environment.
In the embodiment of the disclosure, if "the service data required for testing the test case" refers to all the service data required for testing the test case for a plurality of scenes. And because the test case to be tested is tested, the test can be performed only aiming at the test case to be tested in a single scene. Thus, in this case, the use case testing platform in embodiments of the present disclosure allows a user to select tag combinations at the user configuration interface by himself. Wherein, the label combination selected by the user designates a single scene. The case test platform acquires service data corresponding to the label combination according to the label combination selected by the user, and further tests the case to be tested on the basis, so that the purpose of testing the case to be tested in a single scene is achieved.
Further, regarding "the service data required for testing the test case" refers to the embodiment of the disclosure under the condition that all the service data required for testing the test case are tested for multiple scenes, in the process of testing the test case, a new scene may appear in the test case due to service requirements, and if the test case under the new scene is to be tested, the service data required for testing the test case under the new scene needs to be individually selected; or the composition between the business data in the test environment changes due to changes in the test environment (e.g., updates to the version of the test environment), at which point the scene needs to be repartitioned. Therefore, if the test case to be tested in the changed test environment is to be tested, the service data required for testing the test case to be tested needs to be reelected from the changed test environment. At this time, the "service data required for testing the test case" refers to the requirement of the user for the case test when the newly added scenario occurs and the requirement for the case test when the test environment changes when all the service data required for testing the test case are tested for multiple scenarios.
In an embodiment, the use case testing method further includes:
acquiring service data required by testing the test case to be tested;
clustering the service data to obtain clustered clusters;
acquiring a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
displaying label combinations corresponding to the cluster for the user to select;
acquiring a label combination selected by a user;
based on the mapping relation between the label combination and the test action sequence, obtaining a test action sequence corresponding to the label combination selected by each user;
and assembling the test action sequences corresponding to the label combinations selected by each user into test scripts corresponding to the use cases, and inputting the service data to test the use cases.
In this embodiment, the service data collected by the collection subsystem of the case test platform from the test environment is all the service data required for testing the test case to be tested for multiple scenes. And clustering the service data required by the test aiming at a plurality of scenes by using a classification subsystem of the case test platform, and acquiring a label combination corresponding to each cluster.
A user can select the label combination by himself through a user configuration interface provided by the case test platform so as to test the to-be-tested case under the scene corresponding to the label combination. And the assembly subsystem of the case test platform assembles a test action sequence corresponding to the label combination selected by the user into a test script, and takes the service data of the cluster corresponding to the label combination selected by the user as input, thereby completing the test of the to-be-tested case under the scene corresponding to the label combination selected by the user.
The embodiment has the advantages that the test of the test case to be tested in the new scene is supported, the user can specify the new scene only by selecting the label combination, and the flexibility of the test case test is improved.
In an embodiment, as shown in fig. 7, the case test platform displays each tag in the tag combination selection field of the user configuration interface, and different tag combinations obtained by different combination modes correspond to different scenes. The user can combine the labels according to the requirements of the user on the scene, so as to obtain the label combination conforming to the scene.
For example: the user needs to test the test case under the scene of 'WeChat balance payment full refund under the old financial system'. In order to acquire service data required by testing the test case to be tested in the scene, a user selects a label combination conforming to the scene in a label combination selection field of a user configuration interface: "old user system", "WeChat Payment", "balance refund", "full refund".
It should be noted that the embodiments are merely exemplary illustrations and should not be construed as limiting the functionality and scope of the present disclosure.
In an embodiment, after obtaining the label combination selected by the user, the method further comprises:
And displaying the data path of the business data corresponding to the label combination selected by the user.
In this embodiment, after clicking the tag combination in the user configuration interface provided by the case test platform, the user displays the data path of the data corresponding to the tag combination. Through the data path, the case test platform can grasp the data corresponding to the data path from the platform test environment and present the data to the user for the user to inquire.
In an embodiment, after obtaining the label combination selected by the user, the method further comprises:
and acquiring user-defined use case parameters.
In this embodiment, in the user configuration interface provided by the case test platform, the user may fill in the user-defined case parameters at the user-defined place of the case parameters, so as to implement a basic data driving function, so that the test of the case to be tested can be performed smoothly.
The specific implementation process of this embodiment is the same as the above-mentioned "the service data required for testing the test case" refers to the corresponding process in the case of testing the test case just the service data required for testing the test case for a single scenario, so that the description is omitted here.
In an embodiment, after obtaining the label combination selected by the user, the method further comprises:
And acquiring a user-defined test action sequence.
In this embodiment, in the user configuration interface provided by the case test platform, the user may fill in the self-configured test action sequence at the test action sequence configuration position thereof, so that the assembly subsystem of the case test platform may assemble a test script with complete functions, and thus the test on the test case to be tested may be performed smoothly.
The specific implementation process of this embodiment is the same as the above-mentioned "the service data required for testing the test case" refers to the corresponding process in the case of testing the test case just the service data required for testing the test case for a single scenario, so that the description is omitted here.
According to an embodiment of the present disclosure, as shown in fig. 8, there is also provided a use case testing apparatus, including:
the first obtaining module 510 is configured to obtain service data required for testing the test case to be tested;
the clustering module 520 is configured to cluster the service data to obtain clustered clusters;
a second obtaining module 530, configured to obtain a label combination corresponding to each cluster based on a mapping relationship between the service data feature and the label combination;
A third obtaining module 540, configured to obtain a test action sequence corresponding to each tag combination based on a mapping relationship between the tag combination and the test action sequence;
and the assembling module 550 is configured to assemble the test action sequences corresponding to the tag combinations into test scripts corresponding to the use cases, and input the service data to test the use cases.
In an exemplary embodiment of the present disclosure, after the obtaining the label combination corresponding to each cluster based on the mapping relationship between the service data feature and the label combination, the method further includes:
displaying label combinations corresponding to the cluster for the user to select;
obtaining a user-selected tag combination, the user-selected tag combination comprising at least one of:
a label combination corresponding to a cluster formed by gathering business data corresponding to the added test scene;
and a label combination corresponding to the cluster formed by the business data in the changed test environment.
In an exemplary embodiment of the present disclosure, the obtaining service data required for testing a test case to be tested includes:
acquiring a scanning range input by a user;
and scanning service data in the scanning range stored in the testing environment where the use case is located, and taking the service data as service data required by testing.
In an exemplary embodiment of the present disclosure, the user-entered scan range is a plurality of scan ranges;
before scanning the service data in the scanning range stored in the testing environment where the use case is located as the service data required by the test, the method further comprises:
acquiring association information corresponding to each scanning range input by a user;
the scanning of the service data in the scanning range stored in the testing environment where the use case is located as the service data required by the test comprises the following steps:
scanning business data stored in the test environment within the scanning range;
scanning service data corresponding to the associated information stored in the test environment;
and combining the service data in the scanning range with the service data corresponding to the association information to serve as the service data required by the test.
In an exemplary embodiment of the present disclosure, the obtaining service data required for testing the test case to be tested further includes: and storing the scanned data path of the service data.
In an exemplary embodiment of the present disclosure, after obtaining the service data required for testing the test case to be tested, the method further includes:
And if the acquired service data volume is lower than a preset service data volume threshold, supplementing and acquiring the service data required by testing the test case to be tested until the acquired service data reaches the preset service data volume threshold.
In an exemplary embodiment of the present disclosure, after clustering the service data to obtain clustered clusters, the method further includes:
determining the business data volume of each cluster;
and if the service data volume of one cluster is lower than the service data volume threshold corresponding to the cluster, supplementing and acquiring the service data required by testing the test case to be tested until the service data of each cluster reaches the service data volume threshold after re-clustering.
In an exemplary embodiment of the present disclosure, after obtaining the service data required for testing the test case to be tested, the method further includes:
acquiring the validity period of the service data;
and eliminating the service data with the current time being over the validity period from the acquired service data.
In an exemplary embodiment of the present disclosure, the mapping relationship between the service data features and the tag combinations is configured in the following manner:
Acquiring a field common to all service data in the cluster, and presenting the field common to the user;
receiving a label combination input by a user;
and establishing a mapping relation between the cluster and the label combination.
The case testing method of the embodiment of the present disclosure may be implemented by the case testing platform 10 shown in fig. 1A. A use case testing platform 10 according to an embodiment of the present disclosure is described below with reference to fig. 9. The use case test platform 10 shown in fig. 9 is only one example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in FIG. 9, the case testing platform 10 is in the form of a general purpose computing device. The components of use case test platform 10 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that connects the various system components, including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary methods described above in this specification. For example, the processing unit 610 may perform the various steps as shown in fig. 3.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 520 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The case testing platform 10 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the case testing platform 10, and/or any device (e.g., router, modem, etc.) that enables the case testing platform 10 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, the use case testing platform 10 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet via the network adapter 660. As shown, network adapter 660 communicates with other modules of use case testing platform 10 via bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with the case test platform 10, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer program medium having stored thereon computer readable instructions, which when executed by a processor of a computer, cause the computer to perform the method described in the method embodiment section above.
According to an embodiment of the present disclosure, there is also provided a program product for implementing the method in the above method embodiments, which may employ a portable compact disc read only memory (CD-ROM) and comprise program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RGM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as JGvG, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (KGN) or a wide area network (WGN), or may be connected to an external computing device (e.g., connected over the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (8)

1. A use case testing method, the method comprising:
acquiring service data required by testing the test case to be tested;
clustering the service data to obtain clustered clusters;
acquiring a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
acquiring a test action sequence corresponding to each label combination based on the mapping relation between the label combination and the test action sequence;
assembling test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, and inputting the service data to test the use cases;
the method for acquiring the service data required by testing the test case to be tested comprises the following steps:
acquiring a plurality of scanning ranges input by a user;
acquiring association information corresponding to each scanning range input by a user;
scanning business data in the scanning range stored in the test environment where the use case is located;
scanning service data corresponding to the associated information stored in the test environment where the use case is located;
and combining the service data in the scanning range with the service data corresponding to the association information to serve as the service data required by the test.
2. The method according to claim 1, wherein after obtaining the label combination corresponding to each cluster based on the mapping relationship between the service data features and the label combination, the method further comprises:
displaying label combinations corresponding to the cluster for the user to select;
obtaining a user-selected tag combination, the user-selected tag combination comprising at least one of:
a label combination corresponding to a cluster formed by gathering business data corresponding to the added test scene;
and a label combination corresponding to the cluster formed by the business data in the changed test environment.
3. The method of claim 1, wherein the obtaining the service data required for testing the test case to be tested further comprises: and storing the scanned data path of the service data.
4. The method of claim 1, wherein after obtaining the business data required for testing the test case under test, the method further comprises:
and if the acquired service data volume is lower than a preset service data volume threshold, supplementing and acquiring the service data required by testing the test case to be tested until the acquired service data reaches the preset service data volume threshold.
5. The method of claim 1, wherein after clustering the traffic data to obtain clustered clusters, the method further comprises:
determining the business data volume of each cluster;
and if the service data volume of one cluster is lower than the service data volume threshold corresponding to the cluster, supplementing and acquiring the service data required by testing the test case to be tested until the service data of each cluster reaches the service data volume threshold after re-clustering.
6. The method of claim 1, wherein after obtaining the business data required for testing the test case under test, the method further comprises:
acquiring the validity period of the service data;
and eliminating the service data with the current time being over the validity period from the acquired service data.
7. The method of claim 1, wherein the mapping relationship of the service data features and the tag combinations is configured by:
acquiring a field common to all service data in the cluster, and presenting the field common to the user;
receiving a label combination input by a user;
and establishing a mapping relation between the cluster and the label combination.
8. A use case testing device, the device comprising:
the first acquisition module is used for acquiring service data required by testing the test case to be tested;
the clustering module is used for clustering the service data to obtain clustered clusters;
the second acquisition module is used for acquiring the label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combination;
the third acquisition module is used for acquiring a test action sequence corresponding to each label combination based on the mapping relation between the label combination and the test action sequence;
the assembling module is used for assembling the test action sequences corresponding to the label combinations into test scripts corresponding to the use cases, inputting the service data and testing the use cases;
the first obtaining module is specifically configured to:
acquiring a plurality of scanning ranges input by a user;
acquiring association information corresponding to each scanning range input by a user;
scanning business data in the scanning range stored in the test environment where the use case is located;
scanning service data corresponding to the associated information stored in the test environment where the use case is located;
and combining the service data in the scanning range with the service data corresponding to the association information to serve as the service data required by the test.
CN201910709168.2A 2019-08-01 2019-08-01 Case testing method and device, electronic equipment and storage medium Active CN112306854B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910709168.2A CN112306854B (en) 2019-08-01 2019-08-01 Case testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910709168.2A CN112306854B (en) 2019-08-01 2019-08-01 Case testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112306854A CN112306854A (en) 2021-02-02
CN112306854B true CN112306854B (en) 2023-10-27

Family

ID=74485461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910709168.2A Active CN112306854B (en) 2019-08-01 2019-08-01 Case testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112306854B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360400A (en) * 2021-06-29 2021-09-07 中国农业银行股份有限公司 Data processing method, device, equipment, readable storage medium and product
CN113419961A (en) * 2021-07-09 2021-09-21 平安国际智慧城市科技股份有限公司 Method, device, equipment and storage medium for establishing case library for business test
CN113590491B (en) * 2021-08-06 2024-03-29 深圳市共进电子股份有限公司 Test platform and product test method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109684198A (en) * 2018-11-13 2019-04-26 平安科技(深圳)有限公司 Data capture method to be tested, device, medium, electronic equipment
CN109933515A (en) * 2017-12-18 2019-06-25 大唐移动通信设备有限公司 A kind of optimization method and automatic optimizing equipment of regression test case collection

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9600403B1 (en) * 2015-08-30 2017-03-21 International Business Machines Corporation Method and system for creating functional model of test cases

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933515A (en) * 2017-12-18 2019-06-25 大唐移动通信设备有限公司 A kind of optimization method and automatic optimizing equipment of regression test case collection
CN109684198A (en) * 2018-11-13 2019-04-26 平安科技(深圳)有限公司 Data capture method to be tested, device, medium, electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于二分K-means的测试用例集约简方法;汪文靖;冯瑞;;计算机工程(12);全文 *

Also Published As

Publication number Publication date
CN112306854A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US11119897B2 (en) System and method of handling complex experiments in a distributed system
CN112306854B (en) Case testing method and device, electronic equipment and storage medium
US9558230B2 (en) Data quality assessment
US20230393846A1 (en) System and Method For Automated Cross-Application Dependency Mapping
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN110554958A (en) Graph database testing method, system, device and storage medium
CN110956269B (en) Method, device, equipment and computer storage medium for generating data model
CN107688530A (en) Method for testing software and device
CN108959059A (en) A kind of test method and test platform
CN105283866A (en) Optimization analysis using similar frequencies
CN110135590B (en) Information processing method, information processing apparatus, information processing medium, and electronic device
CN114124567A (en) Cloud service processing method based on big data vulnerability mining and artificial intelligence system
CN108681493B (en) Data anomaly detection method, device, server and storage medium
CN109933515B (en) Regression test case set optimization method and automatic optimization device
CN109828906A (en) UI automated testing method, device, electronic equipment and storage medium
CN109144852A (en) Scan method, device, computer equipment and the storage medium of static code
US11232019B1 (en) Machine learning based test coverage in a production environment
CN112862593A (en) Credit scoring card model training method, device, system and computer storage medium
CN116048987A (en) Processing method, device, electronic equipment, system and storage medium for flow business
CN112445692A (en) Case testing method and terminal
CN107748720A (en) A kind of method and device of the service parameter of detection function test cases
CN111444099A (en) Data inconsistency analysis method, system, electronic device and storage medium
CN116257404A (en) Log analysis method and computing device
CN116185393A (en) Method, device, equipment, medium and product for generating interface document
CN114064510A (en) Function testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant