CN108345979B - Service testing method and device - Google Patents

Service testing method and device Download PDF

Info

Publication number
CN108345979B
CN108345979B CN201710058791.7A CN201710058791A CN108345979B CN 108345979 B CN108345979 B CN 108345979B CN 201710058791 A CN201710058791 A CN 201710058791A CN 108345979 B CN108345979 B CN 108345979B
Authority
CN
China
Prior art keywords
data
product
user
target
preset
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
CN201710058791.7A
Other languages
Chinese (zh)
Other versions
CN108345979A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710058791.7A priority Critical patent/CN108345979B/en
Publication of CN108345979A publication Critical patent/CN108345979A/en
Application granted granted Critical
Publication of CN108345979B publication Critical patent/CN108345979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Abstract

The application discloses a service testing method and a device, wherein the method comprises the following steps: acquiring target product data from original product data according to a product scoring model based on a preset product rule and pre-training, and acquiring target user data from original user data based on a preset user rule and a pre-training user scoring model; screening target combination data from the association data after combination between the target product data and the target user data based on a preset combination rule and a pre-trained association probability model; and generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service. By adopting the embodiment of the application, the whole service test execution process does not need testers to manually generate the test model, so that the workload of the testers is reduced, the service function test coverage is comprehensive, and some extreme scenes or some unusual functions can be involved.

Description

Service testing method and device
Technical Field
The present application relates to the field of software testing, and in particular, to a method and an apparatus for testing a service.
Background
With the development and popularization of the internet, the electric commerce service greatly facilitates the life of users, and the electric commerce service familiar to the users at present comprises product transaction, red packet robbing, electronic payment and the like. In order to ensure the normal use of the electric business service, the electric business service needs to be tested when the electric business service is developed or maintained at ordinary times.
In the prior art, the e-commerce business test is carried out by a user, each business to be tested needs a corresponding tester to understand the business and establish a corresponding test model according to the understanding of the business, but the e-commerce business is various and complicated, and huge workload is generated for the tester; moreover, the test model relies on the understanding of the business by the tester, and sometimes it is difficult to cover all the operations involved in the e-commerce business, and some extreme scenarios or some less common businesses are also difficult to involve.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present application is to provide a method and an apparatus for testing a business, so that a test of an e-commerce business can be automatically performed according to some preset rules or pre-trained models, and a test of the business can be realized without manual participation, thereby reducing the workload of testers, saving the cost of manpower and material resources, and covering more e-commerce businesses, including extreme scenes or infrequent businesses and the like.
Based on this, the present application provides a service testing method, which includes:
acquiring target product data from original product data based on a preset product rule and a pre-trained product scoring model, and acquiring target user data from original user data based on a preset user rule and a pre-trained user scoring model;
screening target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, wherein the original combination data are as follows: the target product data and the target user data are combined to form associated data;
and generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service.
The method for acquiring the target product data from the original product data based on the preset product rules and the pre-trained product scoring model comprises the following steps:
generating corresponding product characteristics by using a preset product rule;
acquiring product data matched with the product characteristics from the original product data by using the product characteristics;
and screening partial products from the matched product data according to a pre-trained product scoring model to serve as target product data.
Wherein, the screening out part of the products from the matched product data as target product data according to a pre-trained product scoring model comprises:
clustering the matched product data by adopting a clustering algorithm of unsupervised learning to obtain various clustered product data;
calculating the score of each product in the various product data by adopting the pre-trained product scoring model;
determining a product with a score greater than a preset score threshold as the target product data.
The method for acquiring the target user data from the original user data based on the preset user rule and the pre-trained user scoring model comprises the following steps:
generating corresponding user characteristics by using a preset user rule;
acquiring user data matched with the user characteristics from the original user data by using the user characteristics;
and screening partial users from the matched user data according to a pre-trained user scoring model to serve as target user data.
The method for screening out part of user characteristics from the user characteristics according to the pre-trained user scoring model to serve as target user data comprises the following steps:
clustering the matched user data by adopting a clustering algorithm of unsupervised learning to obtain various user data after clustering;
calculating the score of each user in the various user data by adopting the pre-trained user scoring model;
and determining the users with the user scores larger than a preset score threshold value as the target user data.
The method for acquiring the target combination data from the original combination data based on the preset combination rule and the pre-trained association probability model comprises the following steps:
respectively combining each target user data and each target product data in pairs based on a preset combination rule to obtain combined initial combination data;
performing probability prediction on the combined initial combined data based on a pre-trained association probability model to obtain the prediction probability of each initial combined data;
and determining the initial combined data with the prediction probability larger than a preset probability threshold value as target combined data.
The generating of the test case of the service to be tested based on the target combination data and a preset case rule comprises the following steps:
acquiring a combination relation between each target product data and each target user data included in the target combination data;
and generating the test cases under the service to be tested according to preset case rules by using each group of target product data and target user data with the combination relation.
The product scoring model, the user scoring model and the association probability model are obtained by training in the following modes:
acquiring a historical transaction record of the online service, wherein the historical transaction record is used for representing an association relation between each user and each product when transaction is carried out;
calculating the transaction amount of each product based on the historical transaction record and a preset product rule, and calculating the transaction amount of each user based on the historical transaction record and a preset user rule;
training the transaction amount of each product by adopting a Support Vector Regression (SVR) algorithm to obtain a product scoring model, and training the transaction amount of each user by adopting a Support Vector Regression (SVR) algorithm to obtain a user scoring model;
calculating a combination relation between each product and each user based on the historical transaction records, the transaction amount of each product and the transaction amount of each user;
and training the combination relation between each product and each user by adopting a Support Vector Machine (SVM) algorithm to obtain an association probability model.
Wherein the method further comprises:
and acquiring a test result obtained by testing the service to be tested, and debugging the source code of the service to be tested according to the test result.
The present application further provides a service testing apparatus, which includes:
the system comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring target product data from original product data based on a preset product rule and a pre-trained product scoring model and acquiring target user data from original user data based on a preset user rule and a pre-trained user scoring model;
the screening unit is used for screening target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, wherein the original combination data are as follows: the target product data and the target user data are combined to form associated data;
the generating unit is used for generating a test case of the service to be tested based on the target combination data and a preset case rule;
and the test unit is used for executing the test case so as to test the service to be tested.
Optionally, the obtaining unit may include:
the product characteristic acquiring subunit is used for generating corresponding product characteristics by utilizing preset product rules;
the first acquisition subunit is used for acquiring product data matched with the product characteristics from the original product data by using the product characteristics;
and the first screening subunit is used for screening partial products from the matched product data according to a pre-trained product scoring model to serve as target product data.
Optionally, the first screening subunit may include:
the product clustering subunit is used for clustering the matched product data by adopting a clustering algorithm of unsupervised learning to obtain various clustered product data;
the first calculating subunit is used for calculating the score of each product in the various product data by adopting the pre-trained product scoring model;
and the target product data determining subunit is used for determining the product with the score larger than a preset score threshold as the target product data.
Optionally, the obtaining unit 701 may include:
the user characteristic acquiring subunit is used for generating corresponding user characteristics by utilizing a preset user rule;
a second obtaining subunit, configured to obtain, from the original user data, user data matched with the user feature by using the user feature;
and the second screening subunit is used for screening partial users from the matched user data according to a pre-trained user scoring model to serve as target user data.
Optionally, the second screening subunit may include:
the user characteristic clustering subunit is used for clustering the matched user data by adopting a clustering algorithm of unsupervised learning to obtain various clustered user data;
the second calculating subunit is used for calculating the score of each user in the various types of user data by adopting the pre-training user scoring model;
and the target user data determining subunit is used for determining the user with the score value larger than a preset score threshold value as the target user data.
Optionally, the screening unit may include:
the combination subunit is used for respectively combining each target user data and each target product data in pairs based on a preset combination rule to obtain combined initial combination data;
the probability prediction subunit is used for carrying out probability prediction on the combined initial combined data based on a pre-trained associated probability model to obtain the prediction probability of each initial combined data;
and a target combined data determining subunit, configured to determine initial combined data with a prediction probability greater than a preset probability threshold as target combined data.
Optionally, the generating unit may include:
a combination relation obtaining subunit, configured to obtain a combination relation between each target product data and each target user data included in the target combination data;
and the generating subunit is used for generating the test cases under the service to be tested according to preset case rules by using each group of target product data and target user data with the combination relation.
Optionally, the apparatus may further include:
the system comprises a historical transaction record acquisition unit, a historical transaction record acquisition unit and a historical transaction record processing unit, wherein the historical transaction record acquisition unit is used for acquiring the historical transaction record of the online service, and the historical transaction record is used for representing the incidence relation between each user and each product during transaction;
the transaction amount operator unit is used for calculating the transaction amount of each product based on the historical transaction record and a preset product rule and calculating the transaction amount of each user based on the historical transaction record and a preset user rule;
the first training unit is used for training the transaction amount of each product by adopting a Support Vector Regression (SVR) algorithm to obtain a product scoring model, and training the transaction amount of each user by adopting a Support Vector Regression (SVR) algorithm to obtain a user scoring model;
the calculation unit is used for calculating the combination relation between each product and each user based on the historical transaction record, the transaction amount of each product and the transaction amount of each user;
and the second training unit is used for training the combination relationship between each product and each user by adopting a Support Vector Machine (SVM) algorithm to obtain an association probability model.
Optionally, the apparatus may further include:
and the debugging unit is used for acquiring a test result obtained by testing the service to be tested and debugging the source code of the service to be tested according to the test result.
Compared with the prior art, the method has the following advantages:
according to the technical scheme of the embodiment of the application, when the service is tested, firstly, target product data are obtained from original product data according to a product rule based on the preset and a product scoring model trained in advance, and target user data are obtained from original user data based on a user rule based on the preset and a user scoring model trained in advance; then, based on a preset combination rule and a pre-trained association probability model, screening target combination data from association data obtained after combination between the target product data and the target user data; and finally, generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service. Therefore, in the embodiment of the application, the test case of the service to be tested is generated through the target combination data screened by the trained machine learning model, and the whole execution process does not need a tester to manually generate the test model, so that the workload of the tester is reduced, the functional test coverage of the service is comprehensive, and the test case can also relate to some extreme scenes or some unusual functions.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of an embodiment of a service testing method in an embodiment of the present application;
fig. 2 is a schematic flowchart of step S101 in an embodiment of the method of the present application;
fig. 3 is another schematic flow chart of step S101 in the method embodiment of the present application;
fig. 4 is a schematic flowchart of step S102 in the method embodiment of the present application;
FIG. 5 is a diagram illustrating a combination manner of user collection product sets in an embodiment of the present application;
FIG. 6 is a schematic flow chart of a training model in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a service testing apparatus in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The applicant finds that in the prior art, when the electric business is subjected to the function test, a tester understands the business to establish a test model, but the electric business is various and complex, and a corresponding test model needs to be established for each business, so that the workload of the tester is huge; in addition, it is sometimes difficult for a tester to build a test model through understanding of the business to cover all operations involved in the e-commerce business, and some extreme scenarios or some unusual functions are also difficult to involve.
In order to solve the above problems, in the embodiment of the present application, when a service is tested, first, target product data is obtained from original product data according to a product rule based on a preset product rule and a product scoring model trained in advance, and target user data is obtained from original user data based on a user rule based on a preset user rule and a user scoring model trained in advance; then, based on a preset combination rule and a pre-trained association probability model, screening target combination data from association data obtained after combination between the target product data and the target user data; and finally, generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service. Therefore, by adopting the embodiment of the application, the test case of the service to be tested is generated through the target combination data screened by the trained machine learning model, and the test model is not required to be manually generated by a tester in the whole service execution process, so that the workload of the tester is reduced, the functional test of the service is comprehensively covered, and the test case can also relate to some extreme scenes or some unusual functions.
Various non-limiting embodiments of the present application are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of an embodiment of a service testing method in the embodiment of the present application is shown. In this embodiment, the method may include the following steps S101 to S103:
s101: the method comprises the steps of obtaining target product data from original product data based on preset product rules and a pre-trained product scoring model, and obtaining target user data from original user data based on preset user rules and a pre-trained user scoring model.
In this step, it should be noted that, the step of obtaining the target product data from the original product data based on the preset product rule and the pre-trained product average model, and the step of obtaining the target user data from the original user data based on the preset user rule and the pre-trained user scoring model may not be in order, that is, the two steps may be performed simultaneously or may not be performed simultaneously.
On one hand, in S101, target product data is acquired from original product data based on a preset product rule and a pre-trained product scoring model, and as shown in fig. 2, the method may specifically include steps S201 to S203:
s201: and generating corresponding product characteristics by using a preset product rule.
In this step, the original product data may be, for example, product information or product identification in a product transaction service; the preset product rule can be a characteristic rule preset by a tester and used for extracting a product required by the service to be tested from the original product data.
For example, the following steps are carried out: assume that in the raw product data, each product corresponds to a product ID, and different features of each product correspond to different feature IDs. The product rule may be, for example: and obtaining the household appliance products. In this case, the specific implementation of S201 may include: firstly, correspondingly generating characteristics of a product by all original product data, wherein each characteristic corresponds to a unique characteristic ID; and matching the characteristic ID corresponding to the household appliance product from all the obtained characteristic IDs. For example, if the feature ID of the product home appliance just conforms to the "home appliance" feature corresponding to the "acquisition home appliance product", the product feature generated by using the preset product rule is the "home appliance".
S202: and acquiring product data matched with the product characteristics from the original product data by using the product characteristics.
The product features generated in step S201, such as "home appliances", are reused to extract product data whose product features are "home appliances" from the original product data. Specifically, the product data in the original product data may be generated into corresponding product features, and then the home appliances are used for matching, so as to extract the product data with the product features matching with the home appliances.
S203: and screening partial products from the matched product data according to a pre-trained product scoring model to serve as target product data.
Wherein, S203 may specifically include the following clustering-screening method for target product data:
clustering the matched product data by adopting a clustering algorithm of unsupervised learning to obtain various clustered product data; calculating the score of each product in the various product data by adopting the pre-trained product scoring model; determining a product with a score greater than a preset score threshold as the target product data.
In this embodiment, the unsupervised learning clustering algorithm mentioned here can be, for example, a K-means algorithm, a fuzzy clustering algorithm, an SC (Spectral clustering, chinese) algorithm, or a family of these algorithms.
In the step, various clustered product data are input into a pre-trained product scoring model to obtain the score of each product in each product data; and screening products with the scores larger than a preset score threshold value from the obtained scores of each type of products, and determining the products as target product data. Wherein, the higher the score of the product, the more likely the product corresponding to the score is to be traded or traded in the actual business is. Therefore, a part of products with a high possibility of trading can be screened out by setting a preset score threshold, which can be preset by a person skilled in the art, or by using an empirical value, etc.
On the other hand, in S101, acquiring target user data from the original user data based on the preset user rule and the pre-trained user scoring model may include steps S301 to S302:
s301: and generating corresponding user characteristics by using a preset user rule.
In this step, the original user data may include buyer information or buyer identification in product transaction; the preset user rule may be a user characteristic rule preset by a tester and used for extracting the service to be tested from the original user data.
In this embodiment, it should be noted that the user may be a buyer performing actions such as purchasing or placing an order in the e-commerce business.
For example, the following steps are carried out: assuming that each user in the original user data has a user ID and each user has a different feature ID corresponding to a different feature, assuming that the membership grade is a feature of the user, the membership grade may include: v1, V2, V3, V4 and the like. The user rules may be, for example: and acquiring users with V4 grades. In this case, S301, when implemented, may include: firstly, generating user characteristics corresponding to all original user data, wherein each user characteristic corresponds to a unique characteristic ID; the feature ID corresponding to the "V4 level" is matched among all the feature IDs obtained. If the feature ID of the V4 level "0000" exactly matches the "V4 level" feature corresponding to the "acquire V4 level user", the user feature generated by using the preset user rule is "V4 level".
S302: and acquiring user data matched with the user characteristics from the original user data by using the user characteristics.
The user data having the user characteristic of "V4 level" is extracted from the original user data by reusing the user characteristic generated in step S301, for example, "V4 level". Specifically, the corresponding user characteristics may be generated from each user data in the original user data, and then the user data with the user characteristics matched with the user characteristics of the "V4 level" may be extracted by matching the user characteristics with the user characteristics of the "V4 level".
S303: and screening partial users from the matched user data according to a pre-trained user scoring model to serve as target user data.
S303 may specifically include the following clustering-screening method for target user data:
clustering the matched user data by adopting a clustering algorithm of unsupervised learning to obtain various user data after clustering; calculating the score of each user in the various user data by adopting the pre-trained user scoring model; and determining the users with the scores larger than a preset score threshold value as the target user data.
In this embodiment, the unsupervised learning clustering algorithm mentioned here can be, for example, a K-means algorithm, a fuzzy clustering algorithm, an SC (Spectral clustering, chinese) algorithm, or a family of these algorithms.
In the step, various types of clustered user data are input into a pre-trained user rating model to obtain the score of each user in each type of user data; and then, screening out users with the scores larger than a preset score threshold value from the obtained scores of all types of users, and determining the users with the scores larger than the preset score threshold value as target user data. The higher the score of the user is, the higher the possibility that the user corresponding to the score performs the service transaction in the actual service is. Therefore, a part of users having a high possibility of executing a transaction may be screened out by setting a preset score threshold, which may be preset by a person skilled in the art, or an empirical value, etc.
S102: screening target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, wherein the original combination data are as follows: and the target product data and the target user data are combined to form associated data.
The step S102 may specifically include the following steps S401 to S403:
s401: and combining each target user data and each target product data in pairs respectively based on a preset combination rule to obtain combined initial combination data.
In this step, the target user data obtained in step S203 and the target product data obtained in step S303 may be combined in pairs to obtain initial combination data of the user and the product.
Specifically, referring to fig. 5, a schematic diagram of a combination manner of target user data and target product data is shown, and fig. 5 shows that each user in the target user data and each product in the target product data are combined pairwise to obtain a combination relationship between the user and the product. For example, if the number of products in the obtained product set is n, and the number of users in the obtained user set is m, the combination of the users and the products may be n × m.
In this embodiment, the preset combination rule may be preset by a tester, and the preset combination rule may be, for example: and (3) characterizing the product: (household appliances, there are more than 3 SKUs (English full name: Stock positioning Unit, Chinese full name: Stock Keeping Unit)) and user characteristics: (V4 Member, available points for combination).
S402: and performing probability prediction on the combined initial combined data based on a pre-trained associated probability model to obtain the prediction probability of each initial combined data.
In this embodiment, the obtained initial combination data is input into the pre-trained associated probability model, so as to obtain a prediction probability value of each initial combination data.
S403: and determining the initial combined data with the prediction probability larger than a preset probability threshold value as target combined data.
And screening out initial combined data with the prediction probability value larger than a preset probability threshold from the target combined data, and determining the initial combined data as the target combined data. The higher the value of the prediction probability of the combined data is, the higher the possibility that the corresponding user and product in the combined data are combined together to perform the business transaction in the actual business transaction process is. Therefore, a part of the combined data with a high possibility of trading the combination of the actual user and the product can be screened out by setting a preset probability threshold, which can be preset by a person skilled in the art, or an empirical value is adopted.
S103: and generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service.
In S103, generating a test case of the service to be tested based on the target combination data and a preset case rule may specifically include:
acquiring a combination relation between each target product data and each target user data included in the target combination data; and generating the test cases under the service to be tested according to preset case rules by using each group of target product data and target user data with the combination relation.
For example, the following steps are carried out: the preset use case rule may be, for example: the operation behavior is added on the basis of the target combination data, and the specific expression form can be as follows: user characteristics: (V4 Member, available points) & product characteristics: (household appliances, with more than 3 SKUs) & action (using points for ordering), where & represents the relationship of "and", i.e. can be understood as "and". The resulting expression may also be understood as the resulting test case. And finally, testing the service to be tested by simulating the behavior of the test case.
In this embodiment of the application, the pre-trained product scoring model, the pre-trained user scoring model, and the pre-trained association probability model mentioned in S101-S103 may be trained through a process of training a model shown in fig. 6, where the process of training the model may include steps S601 to S605:
s601: and acquiring a historical transaction record of the online service, wherein the historical transaction record is used for representing the association relation between each user and each product during transaction.
In this embodiment, the online service may be understood as a service that has been used by a user, and the historical transaction record of the online service may include information of the user, information of a product, and an association relationship between each user and each product when a transaction is performed, and the association relationship between each user and each product when a transaction is performed may be implemented by using a transaction relationship table of a product and a buyer.
S602: calculating the transaction amount of each product based on the historical transaction record and a preset product rule, and calculating the transaction amount of each user based on the historical transaction record and a preset user rule.
In this embodiment, it should be noted that, for the step of calculating the transaction amount of each product based on the historical transaction record and the preset product rule, and the step of calculating the transaction amount of each user based on the historical transaction record and the preset user rule, the order may not be distinguished, and the two steps may be performed simultaneously or may not be performed simultaneously.
On one hand, in S602, calculating the transaction amount of each product based on the historical transaction record and the preset product rule may specifically include: acquiring product characteristics and transaction amount of the product characteristics in the history record; and acquiring the association relationship between the product characteristics conforming to the product rules and the transaction amount of the product characteristics according to the preset product rules. Therefore, the transaction amount of the product represents the association relationship between the product characteristics conforming to the product rules and the transaction amount of the product characteristics, and can be realized by using an association table of the transaction amounts of the product characteristics and the product characteristics.
Wherein the preset product rule mentioned here and the preset product rule mentioned in S101 are the same product rule.
On the other hand, in S602, calculating the transaction amount of each user based on the historical transaction record and the preset user rule may specifically include: acquiring user characteristics and transaction amount of the user characteristics in the historical record; and acquiring the association relationship between the user characteristics conforming to the user rules and the transaction amount of the user characteristics according to the preset user rules. Therefore, the transaction amount of the user represents the association relationship between the user characteristics conforming to the user rules and the transaction amount of the user characteristics, and can be realized by adopting the association relationship between the user characteristics and the transaction amount of the user characteristics.
Wherein the preset user rule mentioned here and the preset user rule mentioned in S101 are the same user rule.
S603: and training the transaction amount of each product by adopting a Support Vector Regression (SVR) algorithm to obtain a product scoring model, and training the transaction amount of each user by adopting a Support Vector Regression (SVR) algorithm to obtain a user scoring model.
In this embodiment, it should be noted that, the step of training the transaction amount of each product by using the SVR algorithm supporting vector regression to obtain the product scoring model, and the step of training the transaction amount of each user by using the SVR algorithm supporting vector regression to obtain the user scoring model may be performed simultaneously or not.
In this step, on one hand, the SVR algorithm supporting vector regression is used to train the transaction amount of each product to obtain a product scoring model, which may specifically include: and training the obtained association relationship between the product characteristics and the transaction amount of the product characteristics by adopting an SVR (Support Vector Regression) algorithm to obtain a product scoring model. For example: the transaction amounts of different product characteristics in the obtained product scoring model correspond to different scores.
For example, the following steps are carried out: the step of calculating the feature score of each product feature by using the product scoring model mentioned in the above step may specifically be: and inputting the obtained clustering result of the product characteristics into the product scoring model to obtain the transaction amount corresponding to each type of product characteristics, different scores corresponding to different product characteristic transaction amounts, and the higher the transaction amount is, the higher the product characteristic score is.
On the other hand, training the transaction amount of each user by using a Support Vector Regression (SVR) algorithm to obtain a user scoring model, which may specifically include: and training the obtained association relationship between the user product characteristics and the transaction amount of the product characteristics by adopting an SVR algorithm to obtain a user scoring model. For example: and obtaining different scores corresponding to the transaction quantities of different user characteristics.
The above-mentioned step of calculating the feature score of each type of user feature by using the user scoring model in S302 may specifically be: and inputting the obtained clustering result of the user characteristics into the user grading model to obtain the transaction amount corresponding to each user characteristic, wherein different user characteristic transaction amounts correspond to different scores, and the larger the user characteristic transaction amount is, the larger the score is.
In this embodiment, it should be further noted that the SVR algorithm may be replaced by cart (classification and Regression trees) algorithm, gbdt (gradient Boosting Decision tree) algorithm, Linear Regression (chinese full name: Linear Regression) algorithm, and other equivalent algorithms.
S604: and calculating the combination relation between each product and each user based on the historical transaction records, the transaction amount of each product and the transaction amount of each user.
In this embodiment, the historical transaction record includes an association relationship between each user and each product when performing a transaction, and further, the historical transaction record includes an association relationship between each user characteristic and each product characteristic when performing a transaction. The combination relationship between each product and each user obtained in S504 can be further understood as a combination relationship between each product feature and each user feature, a transaction amount of each corresponding product feature, and a transaction amount of each corresponding user feature.
S605: and training the combination relation between each product and each user by adopting a Support Vector Machine (SVM) algorithm to obtain an association probability model.
In this embodiment, the obtained combinations of different products and users in the association probability model correspond to different scores, that is, the combinations of different product features and user features correspond to different scores. It is further understood that different combinations of product characteristics and user characteristics correspond to different product characteristic transaction amounts and user characteristic transaction amounts, and that different product characteristic transaction amounts and different user characteristic transaction amounts represent different scores.
In this embodiment, it should be noted that the SVM (Support Vector Machine, chinese full name) may be replaced by C45 precision Tree (Decision Tree, chinese full name) and Adaboost algorithm.
In this embodiment, after the service test is completed, the method may further include: and acquiring a test result obtained by testing the service to be tested, and debugging the source code of the service to be tested according to the test result.
In this embodiment, when testing a service, first, target product data is obtained from original product data according to a product scoring model based on a preset product rule and pre-training, and target user data is obtained from original user data based on a user rule and a user scoring model pre-training; then, based on a preset combination rule and a pre-trained association probability model, screening target combination data from association data obtained after combination between the target product data and the target user data; and finally, generating a test case of the service based on the target combination data and a preset case rule, and executing the test case so as to test the service. Therefore, by adopting the embodiment of the application, the test case of the service to be tested is generated through the target combination data screened by the trained machine learning model, and the test model is not required to be manually generated by a tester in the whole service execution process, so that the workload of the tester is reduced, the functional test of the service is comprehensively covered, and the test case can also relate to some extreme scenes or some unusual functions.
Referring to fig. 7, a structure of a service test apparatus in an embodiment of the present application is shown. In this embodiment, the apparatus may include:
an obtaining unit 701, configured to obtain target product data from original product data based on a preset product rule and a pre-trained product scoring model, and obtain target user data from original user data based on a preset user rule and a pre-trained user scoring model;
a screening unit 702, configured to screen target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, where the original combination data are: the target product data and the target user data are combined to form associated data;
a generating unit 703, configured to generate a test case of the service to be tested based on the target combination data and a preset case rule.
A testing unit 704, configured to execute the test case so as to test the service to be tested.
Optionally, the obtaining unit may include:
the product characteristic acquiring subunit is used for generating corresponding product characteristics by utilizing preset product rules;
the first acquisition subunit is used for acquiring product data matched with the product characteristics from the original product data by using the product characteristics;
and the first screening subunit is used for screening partial products from the matched product data according to a pre-trained product scoring model to serve as target product data.
Optionally, the first screening subunit may include:
the product clustering subunit is used for clustering the matched product data by adopting a clustering algorithm of unsupervised learning to obtain various clustered product data;
the first calculating subunit is used for calculating the score of each product in the various product data by adopting the pre-trained product scoring model;
and the target product data determining subunit is used for determining the product with the score larger than a preset score threshold as the target product data.
Optionally, the obtaining unit 701 may include:
the user characteristic acquiring subunit is used for generating corresponding user characteristics by utilizing a preset user rule;
a second obtaining subunit, configured to obtain, from the original user data, user data matched with the user feature by using the user feature;
and the second screening subunit is used for screening partial users from the matched user data according to a pre-trained user scoring model to serve as target user data.
Optionally, the second screening subunit may include:
the user characteristic clustering subunit is used for clustering the matched user data by adopting a clustering algorithm of unsupervised learning to obtain various clustered user data;
the second calculating subunit is used for calculating the score of each user in the various types of user data by adopting the pre-training user scoring model;
and the target user data determining subunit is used for determining the user with the score value larger than a preset score threshold value as the target user data.
Optionally, the screening unit may include:
the combination subunit is used for respectively combining each target user data and each target product data in pairs based on a preset combination rule to obtain combined initial combination data;
the probability prediction subunit is used for carrying out probability prediction on the combined initial combined data based on a pre-trained associated probability model to obtain the prediction probability of each initial combined data;
and a target combined data determining subunit, configured to determine initial combined data with a prediction probability greater than a preset probability threshold as target combined data.
Optionally, the generating unit may include:
a combination relation obtaining subunit, configured to obtain a combination relation between each target product data and each target user data included in the target combination data;
and the generating subunit is used for generating the test cases under the service to be tested according to preset case rules by using each group of target product data and target user data with the combination relation.
Optionally, the apparatus may further include:
the system comprises a historical transaction record acquisition unit, a historical transaction record acquisition unit and a historical transaction record processing unit, wherein the historical transaction record acquisition unit is used for acquiring the historical transaction record of the online service, and the historical transaction record is used for representing the incidence relation between each user and each product during transaction;
the transaction amount operator unit is used for calculating the transaction amount of each product based on the historical transaction record and a preset product rule and calculating the transaction amount of each user based on the historical transaction record and a preset user rule;
the first training unit is used for training the transaction amount of each product by adopting a Support Vector Regression (SVR) algorithm to obtain a product scoring model, and training the transaction amount of each user by adopting a Support Vector Regression (SVR) algorithm to obtain a user scoring model;
the calculation unit is used for calculating the combination relation between each product and each user based on the historical transaction record, the transaction amount of each product and the transaction amount of each user;
and the second training unit is used for training the combination relationship between each product and each user by adopting a Support Vector Machine (SVM) algorithm to obtain an association probability model.
Optionally, the apparatus may further include:
and the debugging unit is used for acquiring a test result obtained by testing the service to be tested and debugging the source code of the service to be tested according to the test result.
When the testing device in this embodiment tests a service, first, target product data is obtained from original product data according to a product scoring model based on a preset product rule and pre-training, and target user data is obtained from original user data based on a user rule and a user scoring model pre-training; then, based on a preset combination rule and a pre-trained association probability model, screening target combination data from association data obtained after combination between the target product data and the target user data; and finally, generating a test case of the service to be tested based on the target combination data and a preset case rule, and executing the test case so as to test the service to be tested.
Therefore, by adopting the testing device in the embodiment of the application, the test case of the service to be tested is generated through the target combination data screened by the trained machine learning model, and the testing personnel does not need to manually generate the test model in the whole service execution process, so that the workload of the testing personnel is reduced, the functional test coverage of the service is comprehensive, and the testing device can also be used for some extreme scenes or some unusual functions.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described device embodiments are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.

Claims (10)

1. A method for service testing, the method comprising:
acquiring target product data from original product data based on a preset product rule and a pre-trained product scoring model, and acquiring target user data from original user data based on a preset user rule and a pre-trained user scoring model;
screening target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, wherein the original combination data are as follows: the target product data and the target user data are combined to form associated data;
and generating a test case of the service to be tested based on the target combination data and a preset case rule, and executing the test case so as to test the service to be tested.
2. The method of claim 1, wherein the obtaining target product data from raw product data based on pre-set product rules and pre-trained product scoring models comprises:
generating corresponding product characteristics by using a preset product rule;
acquiring product data matched with the product characteristics from the original product data by using the product characteristics;
and screening partial products from the matched product data according to a pre-trained product scoring model to serve as target product data.
3. The method of claim 2, wherein said screening out a portion of said matched product data as target product data according to a pre-trained product scoring model comprises:
clustering the matched product data by adopting a clustering algorithm of unsupervised learning to obtain various clustered product data;
calculating the score of each product in the various product data by adopting the pre-trained product scoring model;
determining a product with a score greater than a preset score threshold as the target product data.
4. The method of claim 1, wherein the obtaining target user data from raw user data based on preset user rules and a pre-trained user scoring model comprises:
generating corresponding user characteristics by using a preset user rule;
acquiring user data matched with the user characteristics from the original user data by using the user characteristics;
and screening partial users from the matched user data according to a pre-trained user scoring model to serve as target user data.
5. The method of claim 4, wherein the screening out the partial user features from the user features as target user data according to a pre-trained user scoring model comprises:
clustering the matched user data by adopting a clustering algorithm of unsupervised learning to obtain various user data after clustering;
calculating the score of each user in the various user data by adopting the pre-trained user scoring model;
and determining the users with the user scores larger than a preset score threshold value as the target user data.
6. The method according to claim 1, wherein the obtaining target combination data from the original combination data based on the preset combination rule and the pre-trained association probability model comprises:
respectively combining each target user data and each target product data in pairs based on a preset combination rule to obtain combined initial combination data;
performing probability prediction on the combined initial combined data based on a pre-trained association probability model to obtain the prediction probability of each initial combined data;
and determining the initial combined data with the prediction probability larger than a preset probability threshold value as target combined data.
7. The method according to claim 1, wherein the generating a test case of the service to be tested based on the target combination data and a preset case rule comprises:
acquiring a combination relation between each target product data and each target user data included in the target combination data;
and generating the test cases under the service to be tested according to preset case rules by using each group of target product data and target user data with the combination relation.
8. The method of claim 1, wherein the product scoring model, user scoring model, and associated probability model are trained by:
acquiring a historical transaction record of the online service, wherein the historical transaction record is used for representing an association relation between each user and each product when transaction is carried out;
calculating the transaction amount of each product based on the historical transaction record and a preset product rule, and calculating the transaction amount of each user based on the historical transaction record and a preset user rule;
training the transaction amount of each product by adopting a Support Vector Regression (SVR) algorithm to obtain a product scoring model, and training the transaction amount of each user by adopting a Support Vector Regression (SVR) algorithm to obtain a user scoring model;
calculating a combination relation between each product and each user based on the historical transaction records, the transaction amount of each product and the transaction amount of each user;
and training the combination relation between each product and each user by adopting a Support Vector Machine (SVM) algorithm to obtain an association probability model.
9. The method of any one of claims 1 to 8, further comprising:
and acquiring a test result obtained by testing the service to be tested, and debugging the source code of the service to be tested according to the test result.
10. A service testing apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring target product data from original product data based on a preset product rule and a pre-trained product scoring model and acquiring target user data from original user data based on a preset user rule and a pre-trained user scoring model;
the screening unit is used for screening target combination data from original combination data based on a preset combination rule and a pre-trained association probability model, wherein the original combination data are as follows: the target product data and the target user data are combined to form associated data;
the generating unit is used for generating a test case of the service to be tested based on the target combination data and a preset case rule;
and the test unit is used for executing the test case so as to test the service to be tested.
CN201710058791.7A 2017-01-23 2017-01-23 Service testing method and device Active CN108345979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710058791.7A CN108345979B (en) 2017-01-23 2017-01-23 Service testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710058791.7A CN108345979B (en) 2017-01-23 2017-01-23 Service testing method and device

Publications (2)

Publication Number Publication Date
CN108345979A CN108345979A (en) 2018-07-31
CN108345979B true CN108345979B (en) 2021-07-09

Family

ID=62962217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710058791.7A Active CN108345979B (en) 2017-01-23 2017-01-23 Service testing method and device

Country Status (1)

Country Link
CN (1) CN108345979B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109389972B (en) * 2018-09-21 2020-11-03 四川长虹电器股份有限公司 Quality testing method and device for semantic cloud function, storage medium and equipment
CN111489163A (en) * 2020-04-07 2020-08-04 支付宝(杭州)信息技术有限公司 Service processing method and device and electronic equipment
CN112185575B (en) * 2020-10-14 2024-01-16 北京嘉和美康信息技术有限公司 Method and device for determining medical data to be compared
CN112508631A (en) * 2021-02-07 2021-03-16 北京淇瑀信息科技有限公司 User policy distribution method and device and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908020A (en) * 2010-08-27 2010-12-08 南京大学 Method for prioritizing test cases based on classified excavation and version change
CN101984416A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for generating test case
CN102004691A (en) * 2010-11-12 2011-04-06 中兴通讯股份有限公司 Method and system for executing test case
CN102063374A (en) * 2011-01-07 2011-05-18 南京大学 Method for selecting regression test case for clustering with semi-supervised information
CN102629233A (en) * 2012-01-09 2012-08-08 北京航空航天大学 Software reliability test data generating method and computer aided tool of software reliability test data generating method
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN105469263A (en) * 2014-09-24 2016-04-06 阿里巴巴集团控股有限公司 Commodity recommendation method and device
CN105893256A (en) * 2016-03-30 2016-08-24 西北工业大学 Software failure positioning method based on machine learning algorithm
CN105988930A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Test case generation method and device
CN106294107A (en) * 2015-05-27 2017-01-04 富士通株式会社 The method and apparatus generating the test case of Webpage

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150026664A1 (en) * 2013-07-17 2015-01-22 International Business Machines Corporation Method and system for automated test case selection

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908020A (en) * 2010-08-27 2010-12-08 南京大学 Method for prioritizing test cases based on classified excavation and version change
CN101984416A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for generating test case
CN102004691A (en) * 2010-11-12 2011-04-06 中兴通讯股份有限公司 Method and system for executing test case
CN102063374A (en) * 2011-01-07 2011-05-18 南京大学 Method for selecting regression test case for clustering with semi-supervised information
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN102629233A (en) * 2012-01-09 2012-08-08 北京航空航天大学 Software reliability test data generating method and computer aided tool of software reliability test data generating method
CN105469263A (en) * 2014-09-24 2016-04-06 阿里巴巴集团控股有限公司 Commodity recommendation method and device
CN105988930A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Test case generation method and device
CN106294107A (en) * 2015-05-27 2017-01-04 富士通株式会社 The method and apparatus generating the test case of Webpage
CN105893256A (en) * 2016-03-30 2016-08-24 西北工业大学 Software failure positioning method based on machine learning algorithm

Also Published As

Publication number Publication date
CN108345979A (en) 2018-07-31

Similar Documents

Publication Publication Date Title
CN107153971B (en) Method and device for identifying equipment cheating in APP popularization
CN108345979B (en) Service testing method and device
CN106651542B (en) Article recommendation method and device
CN107220845B (en) User re-purchase probability prediction/user quality determination method and device and electronic equipment
CN109934341A (en) The model of training, verifying and monitoring artificial intelligence and machine learning
CN111582645B (en) APP risk assessment method and device based on factoring machine and electronic equipment
CN105824806A (en) Quality evaluation method and device for public accounts
CN108733712A (en) A kind of question answering system evaluation method and device
CN108717519B (en) Text classification method and device
CN110096539A (en) Online batch imports examination question method and device
JP6308339B1 (en) Clustering system, method and program, and recommendation system
CN110163683B (en) Value user key index determination method, advertisement delivery method and device
CN111475628A (en) Session data processing method, device, computer equipment and storage medium
CN108984777B (en) Customer service method, apparatus and computer-readable storage medium
CN113554438B (en) Account identification method and device, electronic equipment and computer readable medium
CN108399545B (en) Method and device for detecting quality of electronic commerce platform
JP5945206B2 (en) Product recommendation device, method and program
CN110705955B (en) Contract detection method and device
CN111773728A (en) Data table testing method, device, equipment and storage medium
CN109902196B (en) Trademark category recommendation method and device, computer equipment and storage medium
Eken et al. Predicting defects with latent and semantic features from commit logs in an industrial setting
CN112995256A (en) Behavior data processing method and related equipment
CN110782128A (en) User occupation label generation method and device and electronic equipment
CN107291722B (en) Descriptor classification method and device
CN116127155A (en) Method, system, electronic equipment and storage medium for pushing measures

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