CN112306854A - 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
CN112306854A
CN112306854A CN201910709168.2A CN201910709168A CN112306854A CN 112306854 A CN112306854 A CN 112306854A CN 201910709168 A CN201910709168 A CN 201910709168A CN 112306854 A CN112306854 A CN 112306854A
Authority
CN
China
Prior art keywords
service data
test
testing
user
label
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.)
Granted
Application number
CN201910709168.2A
Other languages
Chinese (zh)
Other versions
CN112306854B (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • 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)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides a case testing method, apparatus, electronic device and storage medium, the method comprising: acquiring service data required by testing a 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 combinations; 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 case test.

Description

Case testing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of case testing, and in particular, to a case testing method and apparatus, an electronic device, and a storage medium.
Background
In software testing, it is often necessary to test cases in a test environment. In the prior art, a test action sequence is determined in advance according to an existing scene, when a use case in a specific scene is tested, service data of the scene is captured, and the use case is tested according to the test action sequence determined in advance. If a new scene or a test environment is changed, it is likely that the captured service data cannot test the use case according to a predetermined test action sequence. At this time, the user is required to re-analyze the new scene, and then manually adjust the test action sequence to complete the test of the use case, so that the flexibility and efficiency of the use case test 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 the use case testing.
According to an aspect of the embodiments of the present disclosure, a method for testing a use case is disclosed, which includes:
acquiring service data required by testing a 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 combinations;
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 apparatus is disclosed, which includes:
the first acquisition module is used for acquiring service data required by testing the trial example to be tested;
the clustering module is used for clustering the service data to obtain clustered clusters;
the second obtaining module is used for obtaining the label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combinations;
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 the 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 executable instructions stored in the memory to perform the above described method.
According to an aspect of the present disclosure, a computer-readable storage medium is disclosed, which stores computer program instructions that, when executed by a computer, cause the computer to perform the above-described method.
The method for testing the case is different from the method for determining the test action sequence in the scene in advance, then acquiring the service data required by the test in the scene and enabling the service data required by the test to be adapted to the test action sequence in the traditional technology.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by 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 architectural diagrams according to one embodiment of the present disclosure.
FIG. 2 illustrates an overview of the process according to one embodiment of the present disclosure in a particular application scenario.
FIG. 3 illustrates a flow diagram of use case testing according to one embodiment of the present disclosure.
FIG. 4 shows a flowchart for obtaining business data required for testing a case to be tested according to an embodiment of the present disclosure.
5A-5B illustrate a flow diagram for 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 block diagram of an electronic device for use case testing according to one embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 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 their repetitive description 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 subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, steps, and so forth. 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 the form of 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 embodiments of the present disclosure is described below with reference to FIGS. 1A-1D.
FIG. 1A illustrates the basic components of the architecture of an embodiment of the present disclosure: the system comprises a case testing platform 10, a testing environment 20 and a user side 30. The use case testing platform 10 serves as an execution main body of the embodiment of the present disclosure, and is used for testing a use case to be tested; the test environment 20 is the system environment where the case to be tested is located; the user terminal 30 is a terminal used by a use case tester, and can be connected to the use case testing platform 10 and configured on the use case testing platform 10 to control a use case testing process.
Fig. 1B shows the basic components of the architecture of the embodiment of the present disclosure in the cloud framework layer and the user function layer, respectively: the cloud framework layer consists of a case testing platform 10 and a testing environment 20; the user function layer includes a network and an application programming interface, and the use case testing platform 10 provides the user terminal 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 to provide basic communication functions for the ue 30 shown in fig. 1A; the api is mainly used for providing the parameter configuration related functions for the ue 30 shown in fig. 1A.
FIG. 1C shows the specific components of the case testing platform 10 and the testing environment 20 in the architecture of the embodiment of the present disclosure: the case testing platform 10 is composed of an acquisition subsystem 101, a classification subsystem 102, an assembly subsystem 103 and a platform database 104. The acquisition subsystem 101 is configured to acquire data from the test environment 20, and write 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 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, determines a test action on the basis, and further executes the test action in the test environment 20, thereby realizing the test of the use case.
Fig. 1D shows specific components of the architecture of the embodiment of the present disclosure in the cloud framework layer and the user definition layer, respectively: the cloud framework layer is composed 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 what configuration and definition can be specifically performed on each subsystem of the use case testing platform 10 by the user side 30 shown in fig. 1A on the basis of 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; the label judgment rule adopted by the classification subsystem 102 in classifying the data can be configured; the external use case system can be connected by calling an application programming interface to configure the associated process of the assembly subsystem 103 to determine the test action.
The general process of an embodiment of the present disclosure in a specific application scenario is described below with reference to fig. 2.
In an embodiment, the use case testing platform is to complete testing of a use case to be tested in a 'bank card balance payment' scene. Fig. 2 shows the general process of this embodiment: in the embodiment, the case testing platform acquires service data required for testing a case to be tested under a 'bank card balance payment' scene from a testing environment, and further determines a testing action sequence corresponding to the service data; and assembling the test action sequence to obtain a test script of the to-be-tested case under the test 'bank card balance payment' scene, and finally taking the service data as the input of the test script to finish the test of the to-be-tested case under the 'bank card balance payment' scene. The user can configure parameters on the case testing platform through the user side to ensure the smooth proceeding of the test.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
The following describes in detail the steps of the implementation of the embodiments of the present disclosure.
An execution subject of the embodiment of the present disclosure is a use case testing platform 10 shown in fig. 1A, as shown in fig. 3, according to an embodiment of the present disclosure, there is provided a use case testing method, including:
step 410, acquiring service data required by testing the sample to be tested;
step 420, clustering the service data to obtain clustered clusters;
step 430, acquiring a label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combinations;
step 440, 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 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.
The service data refers to data generated by various service activities performed in the test environment. For example: data generated by performing a refund activity, data generated by performing a login activity.
The service data feature refers to a feature that can distinguish a category to which the service data belongs. The service data features can be distinguished through keywords of the service data. For example: the key words in the key value pairs can be used for distinguishing the characteristics of the corresponding service data.
Clustering refers to clustering data to obtain data belonging to the same class.
In the embodiment of the disclosure, before determining the test action sequence adopted for testing the to-be-tested case, the service data required for testing the to-be-tested case is obtained first. And clustering and labeling the service data, further determining a test action sequence adopted for testing the case to be tested on the basis, and assembling the test action sequence into a test script. And finally, testing the to-be-tested case by using the service data and according to the test script.
It should be noted that, because only the abstract system function requirement is described in the use case, the use case is tested, that is, whether the operation of the system function described in the use case in various scenes can meet the described requirement is tested, that is, the test performed on the use case depends on a specific scene. Generally, one use case corresponds to multiple scenes, and correspondingly, service data corresponding to the use case is not the same in different scenes. 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 special description, the "service data required for testing the sample to be tested" refers to the service data exactly required for testing the sample to be tested for a single scenario.
The following describes a specific process of acquiring service data required for testing a case to be tested.
In step 410, business data required for testing the case to be tested is obtained.
In one embodiment, as shown in FIG. 4, step 410 comprises:
step 4101, acquiring a scanning range input by a user;
step 4102, scanning the service data stored in the scanning range in the test environment where the use case is located, and taking the service data as the service data required by the test.
The scan range indicates which data is to be scanned in the test environment as traffic data required for the test. For example: and scanning data of a database named 'order' in the test environment and data of a database named 'user' as service data required by the test.
In one embodiment, a user performs configuration on a use case test platform and inputs a scanning range for acquiring service data required by a test. And the acquisition subsystem of the case testing platform scans the service data in the scanning range in the testing environment where the case to be tested is positioned according to the scanning range input by the user and uses the service data as the service data required by the test.
For example: the user configures a scan range name as 'order' on the use case test platform, the corresponding scan mode is 'database', and the corresponding scan parameter is '10.2.3.4 | select x from xxx'. And scanning the business data in the database order by the acquisition subsystem of the case testing platform according to the scanning parameters of 10.2.3.4 select from xxx.
The embodiment has the advantages that the scanning range of the service data is indicated by the user, and the flexibility of the user test case is improved.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
In one embodiment, the scan range input by the user is a plurality of scan ranges.
For example: as shown in table 1, the user configures a scan range name, a corresponding scan mode, and corresponding scan parameters on the use-case test platform. And the acquisition subsystem of the case test platform respectively scans the service data in each scanning range according to the configuration of a user.
Scanning Range name Scanning mode Scanning parameters
order Database with a plurality of databases 10.2.3.4|select*from xxx
merchant Database with a plurality of databases 10.2.3.5|select*from xxx
merchant_conf Document 10.2.3.5|/data/conf/xxx.xml
user Database with a plurality of databases 10.2.3.6|select*from xxx
TABLE 1 scanning configuration examples
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
In an embodiment, before scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required for the test, the method further includes:
acquiring associated information corresponding to each scanning range input by a user;
the scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required by the test, includes:
scanning the service data in the scanning range stored in the test environment;
scanning service data corresponding to the associated information stored in the test environment;
and merging the service data in the scanning range and the service data corresponding to the associated information to be used as service data required by the test.
In the disclosed embodiment, each scan range generally indicates a file, a table, or a database in the test environment. When a use case is actually tested, a situation that the service data in a certain scanning range has strong correlation with other data may occur, and the service data in the scanning range has complete service significance only together with the other data. In this case, in order to completely test the use case, the user additionally configures the associated 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 associated information with the service data corresponding to the corresponding scanning range.
In one embodiment, a user inputs a plurality of scanning ranges and associated information corresponding to each scanning range. The associated 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 parameter, and the corresponding association information on the use-case test platform.
Scanning Range name Scanning mode Scanning parameters Associated information
order Database with a plurality of databases 10.2.3.4|select*from xxx
merchant Database with a plurality of databases 10.2.3.5|select*from xxx id==order.merchant
merchant_conf Document 10.2.3.5|/data/conf/xxx.xml id==order.merchant
user Database with a plurality of databases 10.2.3.6|select*from xxx id==order.user
TABLE 2 scanning configuration examples
The embodiment has the advantage of allowing the user to configure the associated information, and improving the collection integrity of the service data required by the test.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the 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, acquiring service data required for testing a case to be tested further includes:
and storing the scanned data path of the service data.
In this embodiment, after the collection subsystem of the use case test platform scans the service data, the service data is not directly taken out from the test environment, but the data path of the scanned service data is stored in the platform database of the use case test platform.
The embodiment has the advantages that the platform database of the use case testing platform stores the data path instead of the original data, so that the burden of the platform database is reduced.
The following describes a detailed process of further processing the service data required for the test after the service data is acquired.
In an embodiment, after obtaining service data required for testing a case to be tested, the method includes:
and performing failure check on the service data, and removing the failed service data from the obtained service data.
In the embodiment of the disclosure, in order to ensure that the use case test is performed smoothly, after the service data required by the test is acquired, the service data in the service data needs to be subjected to failure check. If a service data is failed, it is indicated that it can no longer be used, and it can not be used for testing the use case, so the failed service data is discarded.
This embodiment has the advantage that the availability of the acquired service data required for the test is guaranteed by means of the failure check.
In an embodiment, the failure check of the service data includes at least one of:
acquiring the validity period of the service data, and determining the service data of which the current time passes the validity period as invalid service data;
and acquiring the current state of the service data, and determining the service data of which the current state is inconsistent with the effective state as invalid service data.
In one embodiment, the service data in the test environment is marked with a corresponding validity period. And after the acquisition subsystem of the case testing platform acquires the service data required by the test from the testing environment, determining whether the corresponding service data is invalid or not according to the comparison between 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 invoked to make corresponding transitions as the business data is active. When the state of a service data is transferred to a state which is not in accordance with the valid state, the service data is declared invalid.
In an embodiment, after obtaining the service data required for testing the case to be tested, the method further includes:
if the acquired service data volume is lower than the preset service data volume threshold, the service data required by the test of the trial example to be tested is acquired in a supplementary mode until the acquired service data reaches the preset service data volume threshold.
In this embodiment, a threshold of the service data volume is preset, and if the data volume of the service data required for the test, which is acquired by the acquisition subsystem of the case test platform, does not reach the threshold, the supplementary service data is started until the data volume of the acquired service data reaches the threshold.
The embodiment has the advantages that the supplementary service data is judged through the threshold value, and the service data required by the test can be ensured to be sufficient when the sample to be tested is tested.
In an embodiment, after obtaining the service data required for testing the case to be tested, the method further includes:
and supplementing and acquiring the service data required by testing the trial example to be tested every other preset time period until the service data volume acquired by supplementing reaches a preset supplementing acquisition volume threshold value.
In this embodiment, a supplement acquisition amount threshold is preset, and a collection subsystem of the case test platform periodically starts supplementary service data. And starting a supplementary task by the acquisition subsystem of the case testing platform every a preset time period until the data volume of the supplementary service data reaches the supplementary acquisition volume threshold value.
The embodiment has the advantage that the quantity of the service data required by the test is ensured to be stable within a certain range by supplementing the service data at regular time.
In one embodiment, fig. 5A illustrates a triggering process for an acquisition subsystem of a use case testing platform to perform a supplemental task: after acquiring the service data required for testing the trial example to be tested, more specifically, after starting the test action sequence assembly, the data volume of the valid data of the service data required for testing is checked. And if the data volume of the effective data is lower than the threshold value, starting a supplementary task. The acquisition subsystem of the case testing 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 embodiment is merely exemplary and should not limit the function and scope of the disclosure.
In one embodiment, fig. 5B illustrates a detailed flow of executing a supplementary task by an acquisition subsystem of a use case testing platform: triggering the acquisition subsystem to execute a supplementary task by timing starting or when the effective data is lower than a threshold value; the acquisition subsystem starts a scanning task and reads the configuration of a user; loading a corresponding scanning mode according to the configuration of a user (such as a scanning range, a scanning mode and scanning parameters configured by the user), executing scanning according to the corresponding scanning mode, and storing a data path of the scanned service data into a platform database of the use case testing platform.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
The following describes a detailed process of clustering acquired service data.
In step 420, the service data is clustered to obtain clustered clusters.
Clustering is a data grouping method for unsupervised learning. Given a pile of data, a clustering algorithm may divide the pile of data into a set of groups of data. Theoretically, data in the same group have similar characteristics, while data in different groups have highly different characteristics. The clustered data of the same group are collectively referred to as a cluster.
The main idea of testing the use case in the embodiment of the present disclosure is as follows: firstly, acquiring service data required by testing, and then determining a testing action sequence 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, and then the test action sequence to be executed for each type of service data is 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 the service data, the service data is clustered first, and then the category of each clustered cluster is determined.
In one embodiment, the use case testing platform clusters the service data required by the test into cluster clusters according to Density Based on a DBSCAN (sensitivity-Based Spatial Clustering of Applications with Noise) Clustering algorithm. The DBSCAN clustering algorithm is the prior art, and therefore, the detailed algorithm content is not described herein again.
This embodiment has the advantage that by clustering without supervised learning, an accurate grouping of data with new features can be achieved.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
In an embodiment, after clustering the service data to obtain clustered clusters, the method includes:
determining the service data volume of each cluster;
if the service data volume of a cluster is lower than the service data volume threshold corresponding to the cluster, the service data required for testing the trial example to be tested is acquired in a supplementing manner until the service data of each cluster reaches the service data volume threshold after clustering again.
In this embodiment, the complementary task performed on the business data is performed on each cluster after clustering. Presetting a service data volume threshold corresponding to the clustering cluster, and checking the service data volume of each clustering cluster after clustering. And if the service data volume of one cluster does not reach the service data volume threshold, triggering to execute a supplement task, and supplementing to obtain service data required by testing the 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 the cluster 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 present disclosure, the clustering clusters have obvious characteristic differences, and the service data characteristics of the clustering clusters also have obvious differences. Therefore, the corresponding label combination can be marked on each cluster 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 feature and the tag combination is configured as follows:
acquiring a common field of each service data in the cluster, and presenting the common field to a user;
receiving a label combination input by a user;
and establishing a mapping relation between the clustering cluster and the label combination.
In this embodiment, after the case testing platform obtains each cluster, for the same cluster, a field common to each service data in the cluster is extracted and presented to the user. Therefore, a user can mark a label combination on the cluster according to the common field and input the label combination into the case testing platform, so that the case testing platform establishes the mapping relation between the cluster and the label combination.
The embodiment has the advantages that the user marks the label, the mapping relation between the cluster and the label combination can be flexibly established, and the flexibility of case testing is improved.
In another embodiment, the mapping relationship between the service data features and the label combinations is configured by the following steps: and respectively labeling each cluster based on a labeling rule pre-configured by a user to obtain a label combination corresponding to each cluster.
In this embodiment, a user configures a labeling rule in advance, and the labeling rule can label each cluster according to different points of characteristics between service data of each cluster and common points of the service data characteristics inside the cluster, so that the classification subsystem of the case testing platform can establish a mapping relationship between the cluster and the label combination.
The embodiment has the advantages that the labeling rule is configured in advance, the label can be automatically labeled, and the efficiency of case testing is improved.
In an embodiment, after obtaining the label combination corresponding to each cluster, the method includes:
and determining the set of the label combination of each cluster as the label combination of the service data required by the test, and displaying the data path of the service data required by the test.
In this embodiment, the use-case test platform combines the label combinations of each cluster together, displays the label combinations as the service data required by the test on the user configuration interface, and displays the data paths of the service data required by the test. If the user clicks one of the data paths, the use case testing platform can capture the service data corresponding to the data path from the testing environment and present the service data to the user for the user to inquire.
The embodiment has the advantages that the data query service is provided for the user, and the flexibility of the user using the case test platform is improved.
In an embodiment, as shown in fig. 6, the use case test platform combines the labels of each cluster into a set: "old financial system", "balance payment", "wechat payment", "balance refund", "full refund", which is a label combination of service data required for the test, is displayed on the user configuration interface, and displays each data path of the service data required for the test (i.e. the service data satisfying the wechat balance payment of the old financial system shown in fig. 6): address1, address2. If the user clicks the query data button of the data path address1, the use case testing platform captures the service data with the data path address1 from the testing environment and presents the captured service data to the user for the user to query.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
It should be noted that, when testing the to-be-tested sample, the sample is placed in a specific scene for testing. If the division is performed according to whether the association with the scene is tight, the service data required for the test may be divided into service data required for the test within the scene and service data required for the test outside the scene.
For example: for a to-be-tested case under a 'WeChat balance payment of an old financial system' scene, business data generated by 'logging in a balance payment interface in the old financial system' in the business data required by testing is only suitable for the scene, is closely related to the scene and belongs to the business data required by testing in the scene; and the service data generated by paying 100 yuan in the service data required by the test can be used in other scenes, is not closely related to the scenes, and belongs to the service data required by the test outside the scenes.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the 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 the service data required by the test in the scene, the collection subsystem of the case test platform scans from the test environment; for the service data required by the test outside the scene, the user can configure corresponding parameters for the service data required by the test outside the scene in a user configuration interface provided by the use case test platform, so as to realize a basic data driving function, and the test of the use case to be tested can be smoothly carried out.
The embodiment has the advantages that the user is allowed to configure the parameters of the service data required by the test outside the scene, and the flexibility of the use case test is improved.
In an embodiment, as shown in fig. 6, for the parameters of the business data required for the test outside the scenario of "meeting the full refund", the user may configure in the configuration column of "use case parameters meeting the full refund" of the user configuration page of the use case test platform, so as to implement the basic data-driven 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 use-case test platform, a user can configure a corresponding test action sequence in the test action sequence configuration column, so that the assembly subsystem of the use-case test platform can assemble a test script with complete functions, and thus, the test on the use case to be tested can be smoothly performed.
The embodiment has the advantage of allowing a user to configure the test action sequence, and improving the flexibility of case test.
In an embodiment, as shown in fig. 6, a user may configure a test action sequence in a configuration column "test action sequence satisfying a back balance" of a user configuration page of the use-case test platform, so that the assembly subsystem of the use-case test platform can assemble a fully functional test script.
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
The detailed process of determining the sequence of test actions required to test a use case to be tested is described below.
In step 440, a test action sequence corresponding to each label combination is obtained based on the mapping relationship between the label combination and the test action sequence.
In an embodiment, obtaining the test action sequence corresponding to each label combination based on the mapping relationship between the label combination and the test action sequence 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, a user configures a corresponding test action sequence for each tag combination that may occur in advance, writes the test action sequence configuration table, and stores the test action sequence configuration table in a platform database of the use case test platform. Therefore, the assembly subsystem of the 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 subsequently.
It should be noted that the label combination in the embodiment of the present disclosure may include a plurality of labels, or may include only one label.
The following describes in detail the process of adjusting and establishing the mapping relationship between the label combination and the test action sequence as the data clustering proceeds, with reference to tables 3.1, 3.2, and 3.3.
In one embodiment, as shown in table 3.1 below: initializing the tag combination of the data set d1 to be t1, and the corresponding test action sequence to be f 1; the label combination for the initial data set d2 is t2, and the corresponding test action sequence is f 2.
Label combination Data set Test action sequence
t1 d1 f1
t2 d2 f2
TABLE 3.1 initialized tag combinations, 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, that is, each subset of the data set d1, is obtained. The labels of the respective subsets of the data set d1 are provisionally determined as "t 1, [ ]", wherein "[ ]" denotes the label at which the cluster is to be clustered. Correspondingly, the test action sequence corresponding to each subset of the data set d1 is denoted as "to be adjusted", and waits for further determination; the descriptions of the subsets of the data set d2, the added data set d3, and the added data set d4 are omitted 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 states of tag combinations, corresponding test action sequences after data clustering
As shown in table 3.3 below: and the user determines the label combination of each clustered data set and the corresponding test action sequence according to the clustering result of the data set.
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, corresponding test action sequences
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
The following describes the detailed process of assembling the test action sequence and performing the test case.
In step 450, the test action sequences corresponding to the label combinations are assembled into the test scripts corresponding to the use cases, and the service data is input to test the use cases.
In the embodiment of the present disclosure, in order to test the sample cases to be tested, it is necessary to determine which test action sequences to execute and the execution sequence of the test action sequences, so that the test on the sample cases to be tested can be completed by using the service data required by the test.
In an embodiment, the assembling the test action sequence corresponding to each label combination into the test script corresponding to the use case includes:
and assembling the test action sequence corresponding to each label combination based on a preset assembly template to obtain the test script corresponding to the 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 a sequence of assembling a test action sequence into a test script, and stores the assembly template in a platform database of a use case test platform. Therefore, the assembly subsystem of the case test platform can assemble the test action sequence into the test script based on the assembly template. And then inputting the service data required by the test into the test script, executing the assembled test action, and completing the test of the sample to be tested.
The embodiment has the advantages that the assembly template is configured in advance, the case testing platform can automatically assemble the testing action sequence, and the case testing efficiency is improved.
In an embodiment, the assembling the test action sequence corresponding to each label combination into the test script corresponding to the use case includes:
and displaying the test action sequence corresponding to each label combination on a preset interface in a visual element form, so that a user can assemble the test action sequence by himself.
In this embodiment, after the test action sequence corresponding to each label combination is determined, the test action sequence is displayed on a predetermined interface in the form of a visual element. The user can finish the assembly of the test action sequence by dragging and connecting the visual elements.
The embodiment has the advantages that the user is allowed to assemble the test action sequence by himself, and the flexibility of case testing is improved.
The following description of "service data required for testing a trial example to be tested" refers to a detailed process of the embodiment of the present disclosure in the case of all service data required for testing the trial example to be tested for a plurality of scenes.
In an embodiment, after obtaining the label combination corresponding to each cluster based on the mapping relationship between the service data features and the label combinations, the method further includes:
displaying a label combination corresponding to the clustering cluster for a user to select;
obtaining a user-selected tag combination, the user-selected tag combination including at least one of:
adding label combinations corresponding to clustering clusters formed by service data corresponding to the test scenes;
and combining labels corresponding to the cluster formed by the service data in the changed test environment.
In the embodiment of the present disclosure, if "the service data required for testing the trial example to be tested" refers to all the service data required for testing the trial example to be tested in view of multiple scenes. And because the test is carried out on the case to be tested, the test can be carried out only on the case to be tested under a single scene. Therefore, in this case, the use case testing platform in the embodiment of the present disclosure allows the user to select the tag combination on his/her own in the user configuration interface. Wherein, the label combination selected by the user specifies a single scene. The use case testing platform obtains the business data corresponding to the label combination according to the label combination selected by the user, and then tests the sample to be tested on the basis, thereby realizing the purpose of testing the sample to be tested under a single scene.
Further, the term "service data required for testing the trial example to be tested" refers to the embodiment of the present disclosure under the condition that all service data required for testing the trial example to be tested are provided for a plurality of scenes, in the process of testing the trial example to be tested, a new scene may appear in the case to be tested due to service requirements, and if the case to be tested in the new scene is to be tested, the service data required for testing the case to be tested in the new scene needs to be individually picked out; or due to the change of the test environment (for example, the update of the test environment version), the composition between the business data in the test environment changes, and the scene needs to be divided again. Therefore, when a test is performed on a to-be-tested case in a changed test environment, the business data required for testing the to-be-tested case needs to be picked out from the changed test environment again. At this time, the service data required for testing the trial example to be tested refers to all the service data required for testing the trial example to be tested in multiple scenes, and the requirements of the user on the case test in the newly added scene and the case test in the case of changing the test environment can be met for the embodiment of the present disclosure.
In an embodiment, the use case testing method further includes:
acquiring service data required by testing a 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 combinations;
displaying a label combination corresponding to the clustering cluster for a user to select;
acquiring a label combination selected by a user;
acquiring a test action sequence corresponding to the label combination selected by each user 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 selected by the users into test scripts corresponding to the use cases, and inputting the service data to test the use cases.
In this embodiment, the service data acquired from the test environment by the acquisition subsystem of the case test platform is all the service data required for testing the to-be-tested case in view of a plurality of scenes. And the classification subsystem of the case testing platform clusters the service data required by the test aiming at the plurality of scenes and acquires the label combination corresponding to each cluster.
A user can select a label combination by himself through a user configuration interface provided by the use case testing platform so as to test a use case to be tested under a scene corresponding to the label combination. And the assembly subsystem of the case test platform assembles the 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 case to be tested in the scene corresponding to the label combination selected by the user.
The embodiment has the advantages that the test of the case to be tested in the new scene is supported, and the user can specify the new scene only by selecting the label combination, so that the flexibility of the case test is improved.
In an embodiment, as shown in fig. 7, the use-case test platform displays each label in a label combination selection column of the user configuration interface, and different label 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 to-be-tested case under the scene of 'the WeChat balance payment full refund under the old financial system'. In order to obtain service data required by testing a case to be tested in the scene, a user selects a label combination which accords with the scene in a label combination selection column of a user configuration interface: "old user system", "WeChat Payment", "balance Payment", "refund balance", "full refund".
It should be noted that the embodiment is merely exemplary and should not limit the function and scope of the disclosure.
In one embodiment, after obtaining the tag combination selected by the user, the method further includes:
and displaying the data path of the service data corresponding to the label combination selected by the user.
In this embodiment, in the user configuration interface provided by the use-case test platform, after the user clicks the tag combination therein, the data path of the data corresponding to the tag combination is displayed. Through the data path, the use case testing platform can capture the data corresponding to the data path from the platform testing environment and present the data to the user for the user to inquire.
In one embodiment, after obtaining the tag combination selected by the user, the method further includes:
and acquiring user-defined use case parameters.
In the embodiment, in the user configuration interface provided by the use case testing platform, a user can fill in the self-defined use case parameters in the self-defined place of the use case parameters, so that a basic data driving function is realized, and the test of the use case to be tested can be smoothly carried out.
The specific implementation process of this embodiment is the same as the corresponding process in the case where the "service data required for testing the trial example to be tested" refers to the service data exactly required for testing the trial example to be tested for a single scene, and therefore, the detailed description thereof is omitted here.
In one embodiment, after obtaining the tag combination selected by the user, the method further includes:
and acquiring a user-defined test action sequence.
In this embodiment, in the user configuration interface provided by the use-case testing platform, a user can fill the self-configured test action sequence in the test action sequence configuration position, so that the assembly subsystem of the use-case testing platform can assemble a test script with complete functions, and the test on the use case to be tested can be smoothly performed.
The specific implementation process of this embodiment is the same as the corresponding process in the case where the "service data required for testing the trial example to be tested" refers to the service data exactly required for testing the trial example to be tested for a single scene, and therefore, the detailed description thereof 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:
a first obtaining module 510, configured to obtain service data required for testing a sample to be tested;
a clustering module 520, configured to cluster the service data to obtain clustered clusters;
a second obtaining module 530, configured to obtain, based on a mapping relationship between the service data features and the tag combinations, a tag combination corresponding to each cluster;
a third obtaining module 540, configured to obtain, based on a mapping relationship between the tag combinations and the test action sequences, a test action sequence corresponding to each tag combination;
and an assembling module 550, configured to assemble the test action sequence corresponding to each label combination into a test script corresponding to the case, and input the service data to test the case.
In an exemplary embodiment of the present disclosure, after obtaining the label combination corresponding to each cluster based on the mapping relationship between the service data features and the label combinations, the method further includes:
displaying a label combination corresponding to the clustering cluster for a user to select;
obtaining a user-selected tag combination, the user-selected tag combination including at least one of:
adding label combinations corresponding to clustering clusters formed by service data corresponding to the test scenes;
and combining labels corresponding to the cluster formed by the service data in the changed test environment.
In an exemplary embodiment of the present disclosure, the acquiring service data required for testing a case to be tested includes:
acquiring a scanning range input by a user;
and scanning the service data in the scanning range stored in the test environment where the use case is located, and taking the service data as service data required by the test.
In an exemplary embodiment of the present disclosure, the scan range of the user input is a plurality of scan ranges;
before scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required for the test, the method further includes:
acquiring associated information corresponding to each scanning range input by a user;
the scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required by the test, includes:
scanning the service data in the scanning range stored in the test environment;
scanning service data corresponding to the associated information stored in the test environment;
and merging the service data in the scanning range and the service data corresponding to the associated information to be used as service data required by the test.
In an exemplary embodiment of the present disclosure, the acquiring service data required for testing a 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 acquiring service data required for testing a sample to be tested, the method further includes:
if the acquired service data volume is lower than the preset service data volume threshold, the service data required by the test of the trial example to be tested is acquired in a supplementary mode until the acquired service data reaches the preset service data volume threshold.
In an exemplary embodiment of the disclosure, after clustering the service data to obtain clustered clusters, the method further includes:
determining the service data volume of each cluster;
if the service data volume of a cluster is lower than the service data volume threshold corresponding to the cluster, the service data required for testing the trial example to be tested is acquired in a supplementing manner until the service data of each cluster reaches the service data volume threshold after clustering again.
In an exemplary embodiment of the present disclosure, after acquiring service data required for testing a sample to be tested, the method further includes:
acquiring the validity period of the service data;
and eliminating the service data of which the current time passes the validity period from the acquired service data.
In an exemplary embodiment of the disclosure, the mapping relationship between the service data feature and the tag combination is configured by:
acquiring a common field of each service data in the cluster, and presenting the common field to a user;
receiving a label combination input by a user;
and establishing a mapping relation between the clustering cluster and the label combination.
The use case testing method of the embodiment of the present disclosure may be implemented by the use case testing platform 10 shown in fig. 1A. The use case test platform 10 according to an embodiment of the present disclosure is described below with reference to FIG. 9. The use case testing platform 10 shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in FIG. 9, the use case testing platform 10 is embodied in the form of a general purpose computing device. The components of the use case testing 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 couples the various system components including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code executable by the processing unit 610 to cause the processing unit 610 to perform steps according to various exemplary embodiments of the present invention described in the description part of the above exemplary methods of the present specification. For example, the processing unit 610 may perform various steps as shown in fig. 3.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory 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 of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be 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 a local bus using any of a variety of bus architectures.
The use case test platform 10 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), with one or more devices that enable a user to interact with the use case test platform 10, and/or with any devices (e.g., router, modem, etc.) that enable the use case test platform 10 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Moreover, the use case test platform 10 may also communicate with one or more networks (e.g., 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, the network adapter 660 communicates with the other modules of the use case test platform 10 over the bus 630. It should be appreciated that, although not shown in the figures, other hardware and/or software modules may be used in conjunction with the use case testing platform 10, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, 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 (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute 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 above method embodiment section.
According to an embodiment of the present disclosure, there is also provided a program product for implementing the method in the above method embodiment, which may employ a portable compact disc read only memory (CD-ROM) and include 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 in this regard and, in the present 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. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: 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 disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 for aspects 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of the 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, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, 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 (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute 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 variations, 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 (10)

1. A method for use case testing, the method comprising:
acquiring service data required by testing a 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 combinations;
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.
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 combinations, the method further comprises:
displaying a label combination corresponding to the clustering cluster for a user to select;
obtaining a user-selected tag combination, the user-selected tag combination including at least one of:
adding label combinations corresponding to clustering clusters formed by service data corresponding to the test scenes;
and combining labels corresponding to the cluster formed by the service data in the changed test environment.
3. The method of claim 1, wherein the obtaining business data required for testing a case to be tested comprises:
acquiring a scanning range input by a user;
and scanning the service data in the scanning range stored in the test environment where the use case is located, and taking the service data as service data required by the test.
4. The method of claim 3, wherein the user-input scan range is a plurality of scan ranges;
before scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required for the test, the method further includes:
acquiring associated information corresponding to each scanning range input by a user;
the scanning the service data in the scanning range stored in the test environment where the use case is located, as the service data required by the test, includes:
scanning the service data in the scanning range stored in the test environment;
scanning service data corresponding to the associated information stored in the test environment;
and merging the service data in the scanning range and the service data corresponding to the associated information to be used as service data required by the test.
5. The method of claim 1, wherein the obtaining business data required for testing a case to be tested further comprises: and storing the scanned data path of the service data.
6. The method of claim 1, wherein after obtaining the service data required for testing the sample to be tested, the method further comprises:
if the acquired service data volume is lower than the preset service data volume threshold, the service data required by the test of the trial example to be tested is acquired in a supplementary mode until the acquired service data reaches the preset service data volume threshold.
7. The method of claim 1, wherein after clustering the service data to obtain clustered clusters, the method further comprises:
determining the service data volume of each cluster;
if the service data volume of a cluster is lower than the service data volume threshold corresponding to the cluster, the service data required for testing the trial example to be tested is acquired in a supplementing manner until the service data of each cluster reaches the service data volume threshold after clustering again.
8. The method of claim 1, wherein after obtaining the service data required for testing the sample to be tested, the method further comprises:
acquiring the validity period of the service data;
and eliminating the service data of which the current time passes the validity period from the acquired service data.
9. The method of claim 1, wherein the mapping relationship between the service data feature and the label combination is configured by:
acquiring a common field of each service data in the cluster, and presenting the common field to a user;
receiving a label combination input by a user;
and establishing a mapping relation between the clustering cluster and the label combination.
10. A use case testing apparatus, the apparatus comprising:
the first acquisition module is used for acquiring service data required by testing the trial example to be tested;
the clustering module is used for clustering the service data to obtain clustered clusters;
the second obtaining module is used for obtaining the label combination corresponding to each cluster based on the mapping relation between the service data characteristics and the label combinations;
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 the test scripts corresponding to the use cases, and inputting the service data to test the use cases.
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 true CN112306854A (en) 2021-02-02
CN112306854B 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)

Cited By (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
CN113590491A (en) * 2021-08-06 2021-11-02 深圳市共进电子股份有限公司 Test platform and product test method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170060734A1 (en) * 2015-08-30 2017-03-02 International Business Machines Corporation Method and system for creating functional model of test cases
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170060734A1 (en) * 2015-08-30 2017-03-02 International Business Machines Corporation Method and system for creating functional model of test cases
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的测试用例集约简方法", 计算机工程, no. 12 *

Cited By (4)

* 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
CN113590491A (en) * 2021-08-06 2021-11-02 深圳市共进电子股份有限公司 Test platform and product test method
CN113590491B (en) * 2021-08-06 2024-03-29 深圳市共进电子股份有限公司 Test platform and product test method

Also Published As

Publication number Publication date
CN112306854B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
US11119897B2 (en) System and method of handling complex experiments in a distributed system
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN112306854B (en) Case testing method and device, electronic equipment and storage medium
CN107688530A (en) Method for testing software and device
CN110956269B (en) Method, device, equipment and computer storage medium for generating data model
CN108509339A (en) Method for generating test case, device based on browser and mind map and equipment
CN110554958A (en) Graph database testing method, system, device and storage medium
US11093774B2 (en) Optical character recognition error correction model
CN109815147A (en) Test cases generation method, device, server and medium
CN108681493B (en) Data anomaly detection method, device, server and storage medium
CN112433944A (en) Service testing method, device, computer equipment and storage medium
CN114124567A (en) Cloud service processing method based on big data vulnerability mining and artificial intelligence system
CN109828906A (en) UI automated testing method, device, electronic equipment and storage medium
CN113032257B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN113641591B (en) Test case generation method and device and test method and device
CN111324408A (en) Method, device, equipment and medium for intelligently displaying functional modules of application programs
CN110297761A (en) Acquisition methods, device, computer equipment and the storage medium of returned data
CN113760730A (en) Automatic testing method and device
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
US11205092B2 (en) Clustering simulation failures for triage and debugging
CN117193751A (en) Service code generation method, device, equipment and storage medium
CN116257404A (en) Log analysis method and computing device
CN113033816B (en) Processing method and device of machine learning model, storage medium and electronic equipment
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