CN112825061A - Construction method and construction system of test model - Google Patents

Construction method and construction system of test model Download PDF

Info

Publication number
CN112825061A
CN112825061A CN201911149465.2A CN201911149465A CN112825061A CN 112825061 A CN112825061 A CN 112825061A CN 201911149465 A CN201911149465 A CN 201911149465A CN 112825061 A CN112825061 A CN 112825061A
Authority
CN
China
Prior art keywords
service
interactive
incidence relation
model
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911149465.2A
Other languages
Chinese (zh)
Inventor
李娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911149465.2A priority Critical patent/CN112825061A/en
Publication of CN112825061A publication Critical patent/CN112825061A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Abstract

The embodiment of the invention provides a method and a system for constructing a test model, which comprise the following steps: acquiring an interactive log in a tested response performance time period; establishing a production model through the incidence relation between the names and the number of various interactive services in the interactive log; and extracting the incidence relation of the interactive service required by the test from the production model to construct a test model. The embodiment of the invention extracts the names and the corresponding quantity of the interactive services to construct the production model based on the interactive logs in the tested response performance time period, and extracts the incidence relation of the interactive services required by the test from the production model to construct the test model according to the test requirements, so that the test model truly reflects the interactive environment by using fewer types of interactive services, thereby solving the technical problem of poor practicability of the test model in the prior art.

Description

Construction method and construction system of test model
Technical Field
The invention relates to the technical field of testing, in particular to a method and a system for constructing a test model.
Background
Under the conditions of supporting large access amount, high concurrency, massive data and increasing user quantity, internet companies process more and more interactive services. The general interactive business process is as follows: the user sends a service request to the service server, the service server responds to the service request, corresponding service processing is carried out, and then a service processing result is returned to the client.
In many cases, machine resources required by interactive services for multiple growth are not simply increased linearly, and are more likely to be increased sharply by geometric multiples, so that on one hand, the problems of too low user response speed, system breakdown and the like occur to companies due to difficult user load and increasingly complex application environments, and performance testers often need to reproduce the interactive problems until developers thoroughly solve the problems; on the other hand, in the face of the situation that the user quantity is increasing, it is necessary to estimate whether each system of the service server can support the interactive service requirement. Whether the interaction problem is reproduced or the performance of each system of the service server is estimated, a test scene needs to be designed according to the test model, and the interaction service contained in the test scene acts on the service server to perform corresponding interaction performance test.
At present, the type and the number of interactive services in a test model are usually selected by a developer according to the familiarity of the developer with a service server, so that the test model depends on subjective factors such as the familiarity of the developer with the service server, the performance of the service server on the interactive services is difficult to be actually tested according to a test scene obtained by the test model, and the practicability of the test model is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for constructing a test model, so as to solve the technical problem that a test model constructed in the prior art is poor in practicability.
According to a first aspect of the present invention, there is provided a method for constructing a test model, including:
acquiring an interactive log in a tested response performance time period;
establishing a production model according to the incidence relation between the names and the number of various interactive services in the interactive log;
and extracting the incidence relation of the interactive service required by the test from the production model to construct a test model.
Optionally, the creating a production model according to the association between the names and the quantities of the various interactive services in the interactive log includes:
calculating the occupation ratio of various interactive services in the interactive log according to the quantity of various interactive services in the interactive log to obtain the service occupation ratio;
associating the service occupation ratio, the name and the number of various interactive services in the interactive log to obtain the association relation;
and sequencing the incidence relations according to the service proportion to obtain the production model.
Optionally, after obtaining the production model, the method further includes:
judging whether the production model has an incidence relation of a waste service to obtain a first judgment result, wherein the waste service is an interactive service without testability;
and deleting the incidence relation of the abandoned business from the production model to obtain the updated production model under the condition that the first judgment result shows that the incidence relation of the abandoned business exists in the production model.
Optionally, after obtaining the production model, the method further includes:
judging whether a new service exists or not to obtain a second judgment result, wherein the new service is an interactive service for adding the incidence relation to the production model;
and adding the association relation corresponding to the newly added service to the production model to obtain the updated production model under the condition that the second judgment result indicates that the newly added service exists.
Optionally, extracting the association relationship of the interactive services required for testing from the production model to construct a test model, including:
forming a first incidence relation group by the incidence relations with larger business occupation of preset quantity in the production model;
forming a second incidence relation group by incidence relations of high-priority transactions in the production model, wherein the high-priority transactions comprise interactive services which are easy to cause interactive faults;
and constructing a test model through the first incidence relation group and the second incidence relation group.
Optionally, the method for constructing a test model further includes:
judging whether the incidence relation of the abandoned services exists in the test model or not to obtain a third judgment result, wherein the abandoned services are interactive services without testability;
and when the third judgment result shows that the incidence relation of the abandoned service exists in the test model, adjusting the test model so as to enable the test model not to include the incidence relation of the abandoned service.
Optionally, adjusting the test model includes:
judging whether the incidence relation of the abandoned service belongs to the first incidence relation group or not to obtain a first sub-judgment result;
extracting the incidence relation of the first interactive service from the production model to replace the incidence relation of the abandoned service when the first sub-judgment result shows that the incidence relation of the abandoned service belongs to the first incidence relation group,
the first interactive service is a testable interactive service corresponding to the larger service proportion in a target model, and the target model is a residual model of the production model after the test model is removed.
Optionally, adjusting the test model includes:
judging whether the incidence relation of the abandoned service belongs to the second incidence relation group or not to obtain a second sub-judgment result;
obtaining a second interactive service under the condition that the second sub-judgment result shows that the incidence relation of the abandoned service belongs to the second incidence relation group, and replacing the incidence relation of the abandoned service by the incidence relation of the second interactive service, wherein,
the second interactive service has testability, and the same interactive fault is caused by the second interactive service and the abandoned service.
Optionally, constructing a test model through the first association relation group and the second association relation group includes:
calculating the ratio of each type of interactive service in the first incidence relation group and the second incidence relation group to obtain the updated service ratio;
for the incidence relation in the first incidence relation group and the second incidence relation group, replacing the service proportion of the corresponding category interactive service by the updated service proportion to obtain an updated incidence relation;
and constructing a test model according to the updated incidence relation.
According to a second aspect of the present invention, there is provided a test model building system, including:
the acquisition module is used for acquiring an interactive log in a tested response performance time period;
the first construction module is used for constructing a production model through the incidence relation between the names and the number of various interactive services in the interactive log;
and the second construction module is used for extracting the incidence relation of the interactive service required by the test from the production model so as to construct a test model.
Optionally, the first building block includes:
the calculating unit is used for calculating the ratio of various interactive services in the interactive log according to the quantity of various interactive services in the interactive log to obtain the ratio of services;
the association unit is used for associating the service occupation ratio, the name and the number of various interactive services in the interactive log to obtain the association relation;
and the sequencing construction unit is used for sequencing the incidence relation according to the size of the business proportion to obtain the production model.
Optionally, the first building module further includes a first updating unit, and the first updating unit is configured to:
after the production model is obtained, judging whether an incidence relation of a waste service exists in the production model or not to obtain a first judgment result, wherein the waste service is an interactive service without testability;
and deleting the incidence relation of the abandoned business from the production model to obtain the updated production model under the condition that the first judgment result shows that the incidence relation of the abandoned business exists in the production model.
Optionally, the first building module further includes a second updating unit, and the second updating unit is configured to:
after the production model is obtained, judging whether a new service exists or not to obtain a second judgment result, wherein the new service is an interactive service for adding the incidence relation to the production model;
and adding the association relation corresponding to the newly added service to the production model to obtain the updated production model under the condition that the second judgment result indicates that the newly added service exists.
Optionally, the second building block comprises:
the first extraction unit is used for forming a first incidence relation group by the incidence relation with a larger preset number of services in the production model;
the second extraction unit is used for forming a second incidence relation group by incidence relations of high-priority transactions in the production model, wherein the high-priority transactions comprise interactive services which are easy to cause interactive faults;
and the combined construction unit is used for constructing a test model through the first incidence relation group and the second incidence relation group.
Optionally, the second building module further comprises:
a judging unit, configured to judge whether an incidence relation of a waste service exists in the test model, to obtain a third judgment result, where the waste service is an interactive service without testability;
and an adjusting unit, configured to adjust the test model so that the test model does not include the incidence relation of the abandoned service when the third determination result indicates that the incidence relation of the abandoned service exists in the test model.
Optionally, the adjusting unit is configured to:
judging whether the incidence relation of the abandoned service belongs to the first incidence relation group or not to obtain a first sub-judgment result;
extracting the incidence relation of the first interactive service from the production model to replace the incidence relation of the abandoned service under the condition that the first sub-judgment result shows that the incidence relation of the abandoned service belongs to the first incidence relation group, wherein,
the first interactive service is a testable interactive service corresponding to the larger service proportion in a target model, and the target model is a residual model of the production model after the test model is removed.
Optionally, the adjusting unit is configured to:
judging whether the incidence relation of the abandoned service belongs to the second incidence relation group or not to obtain a second sub-judgment result;
obtaining a second interactive service under the condition that the second sub-judgment result shows that the incidence relation of the abandoned service belongs to the second incidence relation group, and replacing the incidence relation of the abandoned service by the incidence relation of the second interactive service, wherein,
the second interactive service has testability, and the same interactive fault is caused by the second interactive service and the abandoned service.
Optionally, the combination building unit is configured to:
calculating the ratio of each type of interactive service in the first incidence relation group and the second incidence relation group to obtain the updated service ratio;
for the incidence relation in the first incidence relation group and the second incidence relation group, replacing the service proportion of the corresponding category interactive service by the updated service proportion to obtain an updated incidence relation;
and constructing a test model according to the updated incidence relation.
According to a third aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions which, when executed, implement the method for constructing a test model according to any one of the embodiments of the first aspect.
According to a fourth aspect of the present invention, there is provided a test model constructing apparatus, including:
a memory for storing computer instructions;
a processor coupled to the memory, the processor configured to perform a building method implementing the test model according to any of the embodiments of the first aspect based on computer instructions stored in the memory.
The embodiment of the invention has the following advantages or beneficial effects:
the method for constructing the test model provided by the embodiment of the invention comprises the following steps: acquiring an interactive log in a tested response performance time period; establishing a production model through the incidence relation between the names and the number of various interactive services in the interactive log; and extracting the incidence relation of the interactive services required by the test from the production model to construct a test model, wherein the test model is used as a reference model for designing a test scene, and the type of the interactive services and the number of various interactive services in the test scene are set by referring to the test model.
In the embodiment of the invention, the production model is obtained according to the interactive log in the tested response performance time period, and the production model comprises the incidence relation between the type and the number of the interactive services, so that the incidence relation of the interactive services required by the test is directly extracted from the production model to construct the test model and design the test scene, and the type and the corresponding number of the tested interactive services in the tested response performance time period are truly restored by the test scene because the type of the interactive services required by the test is less than that of the production model, and the test realizability is improved by less types of the interactive services, thereby improving the practicability of the test model in the test and effectively solving the technical problem of poor practicability of the test model in the prior art.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing embodiments of the present invention with reference to the following drawings, in which:
FIG. 1 is a flow chart of a method of building a test model according to an embodiment of the invention;
FIG. 2 is a flowchart of a method for constructing a production model according to an association relationship between names and numbers of various interactive services in an interactive log according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of a production model according to an embodiment of the invention;
FIG. 4 is a flowchart of a method for extracting the association relationship of the interactive services required for testing from the production model to construct a test model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a test model according to an embodiment of the invention;
FIG. 6 is a schematic diagram of another test model according to an embodiment of the invention;
FIG. 7 is a block diagram of a test model building system according to an embodiment of the present invention;
fig. 8 is a block diagram of a test model building apparatus according to an embodiment of the present invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, and procedures have not been described in detail so as not to obscure the present invention. The figures are not necessarily drawn to scale.
Fig. 1 is a flowchart illustrating a method for constructing a test model according to an embodiment of the present invention. Referring to fig. 1, the method for constructing the test model includes:
step S101, obtaining an interaction log in the tested response performance time period.
It should be noted that, the tested response performance time period, that is, the time period of the tested response performance of the service server, can know how the service server responds to the interactive service in the time period through the test, and therefore, the tested response performance time period is determined according to the test requirement. The tested response performance time period includes, for example: twenty one day, 618 seconds for killing for 30 minutes, morning rush hour for working for 10 minutes, general day scene for 8 hours, special day scene for 4 hours, etc.
And S102, constructing a production model through the incidence relation between the names and the number of various interactive services in the interactive log.
The interactive services include, but are not limited to, transaction-type interactive services commonly processed by e-commerce platforms. The number of interactive services, that is, the number of times that the interactive services are called in the period of the tested response performance, may be obtained by analyzing the number of times that various interactive services are called by the back-end interface of the service server using the shell script.
Step S103, extracting the incidence relation of the interactive services required by the test from the production model to construct a test model, wherein the test model is used as a reference model for designing a test scene, and the type of the interactive services and the quantity of various interactive services in the test scene are set by referring to the test model.
Specifically, the interactive service required for testing is an interactive service determined according to a testing requirement, and the testing requirement is a recurring or predicted interactive fault, so that the interactive service required for testing is related to the interactive fault, and if the interactive service required for testing is not available, the interactive fault does not occur. For example, if an interactive failure of repeated payment occurs in the second killing activity of the online shopping service, the interactive service requesting payment needs to be selected as the interactive service required by the test in the test model.
In the embodiment of the invention, the production model is obtained according to the interactive log in the tested response performance time period, and the production model comprises the incidence relation between the type and the number of the interactive services, so that the incidence relation of the interactive services required by the test is directly extracted from the production model to construct the test model and design the test scene, and the type and the corresponding number of the tested interactive services in the tested response performance time period are truly restored by the test scene because the type of the interactive services required by the test is less than that of the production model, and the test realizability is improved by less types of the interactive services, thereby improving the practicability of the test model in the test and effectively solving the technical problem of poor practicability of the test model in the prior art.
In an alternative embodiment, as shown in fig. 2, in step S102, a production model is constructed through an association relationship between names and numbers of various types of interaction services in an interaction log, where the method includes:
step S201, according to the number of each kind of interactive service in the interactive log, the occupation ratio of each kind of interactive service in the interactive log is calculated to obtain the service occupation ratio.
Step S202, the business proportion, the name and the quantity of each kind of interactive business in the interactive log are correlated to obtain the correlation.
It should be noted that the name of the interactive service includes, but is not limited to, a service serial number, a service name, and a service code.
And S203, sequencing the incidence relations according to the business proportion to obtain a production model.
Specifically, the production model may be stored in a form of a table, each row of the table stores an association relationship, and the association relationships may be sorted in the table from a larger business proportion to a smaller business proportion, so that the association relationship with the larger business proportion is located at a position near the head of the table in the table.
It is emphasized that the production model is a model comprising the correlation corresponding to each type of interactive service in the interactive log, and thus the sum of all correlations in the production model is 100%. FIG. 3 shows an example of a production model in which the end of the table is indicated by ellipses to indicate relationships less than 0.50%.
According to the embodiment of the invention, by introducing the parameter of business proportion, a plurality of incidence relations are comprehensively and systematically arranged into the production model, so that systematic and organized available data are provided for the construction of the test model, and the rapid construction of the test model is facilitated.
However, the inventor finds that there may be some interactive services in the interactive log that have no testability (hereinafter referred to as obsolete services) for many reasons, such as that the data of the interactive services have no reusability. For this case, in an alternative embodiment, after obtaining the production model, the method further includes:
judging whether the production model has an incidence relation of the waste services or not to obtain a first judgment result;
and deleting the incidence relation of the waste business from the production model to obtain an updated production model under the condition that the first judgment result is that the waste business incidence relation exists in the production model.
In the case where the first determination result indicates that there is no relation of relationship between the obsolete businesses in the production model, the production model does not need to be updated as described above.
Specifically, the method for obtaining the updated production model by deleting the incidence relation of the abandoned business from the production model can be implemented by adopting the following steps:
A) and deleting the incidence relation of the waste services from the production model to obtain a transition model. A transition model, namely a production model after the incidence relation of the waste services is deleted;
B) calculating business proportions corresponding to various interactive businesses included in the incidence relation in the transition model to obtain a first adjustment proportion;
C) and updating the business proportion in each incidence relation in the transition model through the first adjustment proportion to obtain an updated production model.
The production model is obtained according to an interaction log of a certain tested response performance time period, and considering that the interaction services have variability in the tested response performance time period, the production model does not include all the interaction services existing in the tested response performance time period, and in order to make the production model have real-time performance and universality for the tested response performance time period, the association relationship of individual interaction services needs to be added into the production model. For this case, in an alternative embodiment, after obtaining the production model, the method further includes:
judging whether a new service exists or not to obtain a second judgment result, wherein the new service is an interactive service for adding an association relation to the production model;
and adding the incidence relation corresponding to the newly added service to the production model to obtain an updated production model under the condition that the second judgment result shows that the newly added service exists.
It should be noted that, in the case that the first determination result is that there is no new service in the production model, the production model does not need to be updated as described above.
Specifically, the association relationship corresponding to the newly added service is added to the production model to obtain the updated production model, and the method can be implemented by adopting the following steps:
A) calculating the occupation ratios of various interactive services in the interactive service set to obtain a second adjustment occupation ratio, wherein the interactive service set consists of newly added services and interactive services included in the incidence relation in the production model;
B) updating the business proportion in each incidence relation in the production model through the second adjustment proportion, and establishing incidence relations among the second adjustment proportion, the name and the number of the newly added business;
C) and determining the position of adding the incidence relation of the newly added service into the production model according to the size arrangement sequence of the second adjustment ratio, and adding the incidence relation of the newly added service into the production model according to the determined position to obtain an updated production model.
The two optional embodiments provide an adjusting method for the production model from different angles, the adjusted production model has real-time performance and universality, the utilization of data for the construction of the test model is improved, and the practicability of the test model is improved.
In an alternative embodiment, as shown in fig. 4, step S103, extracting the association relationship of the interactive services required by the test from the production model to construct a test model, includes:
step S301, forming a first incidence relation group by incidence relations with a larger preset number of services in the production model.
Specifically, the preset number may be determined according to the sum of the service percentages of the first association group, for example, the association relationship of the preset number with a larger service percentage is extracted, so that the sum of the service percentages of the first association group just reaches 80%, which is described with the exemplary production model in fig. 3, and the preset number is 11, and the first association group is composed of the interactive services with the sequence numbers of 1 to 11.
Step S302, forming a second incidence relation group by incidence relations of high-priority transactions in the production model, wherein the high-priority transactions comprise interactive services which are easy to cause interactive faults.
It should be understood that the test model is used for recurrence or prediction of an interactive failure, and the interactive service liable to cause the interactive failure belongs to the interactive service required for the test, that is, the above-mentioned high-priority transaction belongs to the interactive service required for the test. Specifically, the types of the interaction failures include various types, for example, there are interaction services that receive an error response, and if there is an interaction service that causes performance degradation of the service server, the response speed is reduced, or even the response is not possible, so the high-priority transaction includes an interaction service that is prone to error reporting or an interaction service that is prone to cause a performance problem of the service server. Moreover, some important interactive services need to strictly avoid interactive faults, so to speak, any interactive faults are not allowed to occur, so that any faults of the important interactive services are particularly obvious based on the strict control degree of the important interactive services to the interactive faults, in this sense, the important interactive services can also be classified in the interactive services which are easy to cause the interactive faults to strictly control the occurrence of the interactive faults, and therefore, the high-priority transaction can also comprise all the important interactive services. For example, in the second killing activity of the online shopping service, the later-stage checkout of the purchased goods is an important interactive service of the online shopping, and it is also ensured that no error occurs in the later-stage associated checkout while the second killing activity is ensured to be carried out smoothly, therefore, each second-killing interactive service is used as the current interactive service which is easy to report errors or cause the performance problem of the service server, and the high-priority transaction may also include the interactive service which kills the later-stage checkout.
To illustrate with the exemplary production model of fig. 3, assuming that the interactive service in the association relationship of the serial number 14 and the association relationship of the serial number 18 is a high priority transaction, the second association relationship group is composed of the association relationship of the serial number 14 and the association relationship of the serial number 18.
Step S303, a test model is constructed through the first incidence relation group and the second incidence relation group.
For example, after extracting the first set of correlations and the second set of correlations from the exemplary production model of fig. 3, the test model shown in fig. 5 is obtained.
In the embodiment of the invention, the interactive service in the first incidence relation group is the interactive service with larger proportion, and the interactive service in the incidence relation group has larger influence on the interactive performance such as pressure, load and the like in quantity, so that an interactive fault is caused from one end of the service server; the interactive service in the second incidence relation group is the interactive service which is easy to cause the interactive fault, namely the interactive service has larger influence on the interactive performance in category, and one end of the interactive service in the second incidence relation group can receive error response to cause the interactive fault, so that the interactive service in the two incidence relation groups can more completely include the interactive service required by various tests which cause the interactive fault, and the interactive service categories of the two incidence relation groups in the production model are fewer, therefore, the first incidence relation group and the second incidence relation group are extracted from the production model to construct the test model, so that the response performance of the service server can be more truly reflected through fewer kinds of interactive services, and the test practicability of the test model is improved.
In some cases, the test model constructed by the first association relation group and the second association relation group may have a waste service. For this case, in an alternative example, further comprising:
judging whether the incidence relation of the waste services exists in the test model or not to obtain a third judgment result, wherein the waste services are interactive services without testability;
and adjusting the test model so that the incidence relation of the abandoned service is not included in the test model when the third judgment result shows that the incidence relation of the abandoned service exists in the test model.
There are many adjustment methods, and the following provides corresponding adjustment methods for two different situations:
1) and if the incidence relation of the waste service belongs to the first incidence relation group, extracting the incidence relation of the first interactive service from the production model to replace the incidence relation of the waste service, wherein the first interactive service is the testability interactive service corresponding to the larger service proportion in the target model, and the target model is the residual model of the production model after the test model is removed.
Further, the number of the first interactive services may be one, in which case the first interactive service may be a testable interactive service with the largest service proportion in the target model association relationship. The number of the first interactive services may also be multiple, in this case, the first interactive services may be multiple testable interactive services with a larger service proportion in the target model association relationship, and the sum of the service proportions of the multiple first interactive services is approximately equal to the service proportion of the abandoned transactions.
For example, in the test model of fig. 5, if the interactive service included in the association relationship of serial number 9 belongs to the obsolete service, the association relationship of serial number 9 is replaced by the association relationship of serial number 12 in the production model shown in fig. 3.
In the embodiment of the invention, the testable interactive service with larger service occupation ratio is extracted from the target model to be used as the first interactive service, which is beneficial to achieving the service occupation ratio of the waste service through a small amount of first interactive services, thereby replacing the influence of the waste service on the interactive performance in quantity.
2) And if the incidence relation of the abandoned service belongs to a second incidence relation, acquiring a second interactive service, and replacing the incidence relation of the abandoned service by the incidence relation of the second interactive service, wherein the second interactive service has testability, and the same interactive fault is caused by the second interactive service and the abandoned service.
Further, the second interactive service may select the same interactive service as the obsolete service in terms of the degree of causing the interactive failure. The degree of the interactive failure, for example, the extent and speed of the interactive failure, etc.
It should be noted that, because the second interactive service focuses on the nature of the influence on the interactive performance, the second interactive service may be selected from the association relations of the production model, or may be selected from a database outside the production model. The number in the second interactive service association may be set to the number in the obsolete service association when the second interactive service is selected from a database outside the production model.
By the two adjusting methods, testability of the test model data is checked, waste services are not included in the test model, and practicability of the test model is improved.
The test model obtained by the above method includes the data shown in fig. 5, and it is obvious that the sum of the ratios in the association relations in the test model shown in fig. 5 is not 100%, in an optional example, in step S303, the test model is constructed by the first association relation group and the second association relation group, and the method includes:
calculating the ratio of various interactive services in the first incidence relation group and the second incidence relation group to obtain the updated service ratio;
for the incidence relation in the first incidence relation group and the second incidence relation group, replacing the business proportion of the corresponding category interactive business by the updated business proportion to obtain the updated incidence relation;
and constructing a test model through the updated incidence relation.
Further, in the test model, each updated incidence relation may also be sorted according to the updated business proportion.
For example, after the first association relationship set and the second association relationship set are extracted from the exemplary production model in fig. 3, the test model shown in fig. 6 is obtained by the method provided by the embodiment of the present invention.
The embodiment of the invention ensures that the sum of the updated business proportions contained in each updated incidence relation in the test model is equal to 100 percent through the updated business proportions, and the parameter of the updated business proportions added in the test model gives the proportions of various interactive businesses under the condition that the test model is taken as a whole. When the user quantity is continuously increased and the interactive performance of the service server needs to be estimated, the quantity of various interactive services in the test model can be increased according to the updated service proportion, so that the test model for estimating the test is obtained.
If fig. 6 shows a test model obtained through the interactive log of the twenty-one last year, if it needs to estimate whether the service server can support the total interactive service volume of this year under the condition of 2000 ten thousand, it only needs to calculate the number of various interactive services of the test model shown in fig. 6 under the condition of 2000 ten thousand interactive service volumes through the updated service duty ratio, and then the interactive performance tests such as pressure, load and the like when the service volume is increased can be performed.
The embodiment provides a method for obtaining and determining interactive services of a high-practicability test model and constructing the model, and the test model constructed by the method can be used for testing the interactive performances such as the pressure, the load and the like of a service server.
After the test model with better practicability is constructed based on the construction method of the test model, the test scene which accords with the reality can be designed according to the test model, so that the test scene can truly and effectively simulate the production condition to carry out performance test, and pressure testing performance data which accords with the actual production environment is obtained during pressure test, and the design of the test model is very critical.
FIG. 7 is a block diagram of a system for building a test model according to an embodiment of the present invention. Referring to fig. 7, the construction system of the test model includes:
an obtaining module 100, configured to obtain an interaction log within a tested response performance time period;
the first building module 200 is used for building a production model through the incidence relation between the names and the number of various interactive services in the interactive log;
the second building module 300 is used for extracting the incidence relation of the interactive services required by the test from the production model to build the test model;
the test model is used as a reference model for designing a test scene, and the type of interactive services and the number of various interactive services in the test scene are set with reference to the test model.
In the system for constructing the test model provided by the embodiment of the invention, the constructed test model is converted from the production model, the production model is obtained according to the interaction log in the tested response performance time period, and the production model comprises the incidence relation between the types and the quantity of the interaction services, so that the test model constructed by extracting the incidence relation of the interaction services required by the test from the production model is based on the interaction condition in the tested response performance time period, namely, the types and the corresponding quantity of the interaction services in the tested response performance time period are truly reduced by a test scene with less types of interaction services, thereby solving the technical problem of poor practicability of the test model in the prior art.
In an alternative embodiment, the first building block comprises:
the computing unit is used for computing the occupation ratio of various interactive services in the interactive log according to the quantity of various interactive services in the interactive log to obtain the service occupation ratio;
the association unit is used for associating the business proportion, the name and the quantity of various interactive businesses in the interactive log to obtain an association relation;
and the sequencing construction unit is used for sequencing the incidence relation according to the business proportion to obtain the production model.
In an optional example, the first building module further comprises a first updating unit, and the first updating unit is configured to:
after the production model is obtained, judging whether the production model has an incidence relation of the waste business or not to obtain a first judgment result, wherein the waste business is an interactive business without testability;
and deleting the incidence relation of the waste business from the production model to obtain an updated production model under the condition that the first judgment result is that the waste business incidence relation exists in the production model.
In an optional embodiment, the first building module further comprises a second updating unit, and the second updating unit is configured to:
after the production model is obtained, judging whether a new service exists or not to obtain a second judgment result, wherein the new service is an interactive service for adding an incidence relation to the production model;
and adding the incidence relation corresponding to the newly added service to the production model to obtain an updated production model under the condition that the second judgment result shows that the newly added service exists.
In an alternative example, the second building block comprises:
the first extraction unit is used for forming a first incidence relation group by incidence relations with a larger preset number of services in the production model;
the second extraction unit is used for forming a second incidence relation group by incidence relations of high-priority transactions in the production model, wherein the high-priority transactions comprise interactive services which are easy to cause interactive faults;
and the combined construction unit is used for constructing the test model through the first incidence relation group and the second incidence relation group.
In an alternative embodiment, the second building block further comprises:
the judging unit is used for judging whether the incidence relation of the waste services exists in the test model or not to obtain a third judgment result, wherein the waste services are interactive services without testability;
and the adjusting unit is used for adjusting the test model so that the incidence relation of the abandoned service is not included in the test model under the condition that the third judgment result is that the incidence relation of the abandoned service exists in the test model.
In an alternative embodiment, the adjusting unit is configured to:
judging whether the incidence relation of the abandoned service belongs to a first incidence relation group or not to obtain a first sub-judgment result;
and under the condition that the first sub-judgment result shows that the incidence relation of the abandoned service belongs to the first incidence relation group, extracting the incidence relation of the first interactive service from the production model to replace the incidence relation of the abandoned service, wherein,
the first interactive service is a testability interactive service corresponding to a larger service proportion in the target model, and the target model is a residual model of the production model after the test model is removed.
In an alternative embodiment, the adjusting unit is configured to:
judging whether the incidence relation of the abandoned service belongs to a second incidence relation group or not to obtain a second sub-judgment result;
and under the condition that the second sub-judgment result indicates that the incidence relation of the abandoned service belongs to the second incidence relation group, acquiring a second interactive service, and replacing the incidence relation of the abandoned service by the incidence relation of the second interactive service, wherein,
the second interactive service has testability, and the same interactive failure is caused by the second interactive service and the abandoned service.
In an alternative embodiment, the combined construction element is adapted to:
calculating the ratio of various interactive services in the first incidence relation group and the second incidence relation group to obtain updated services;
for the incidence relation in the first incidence relation group and the second incidence relation group, replacing the business proportion of the corresponding category interactive business by the updated business proportion to obtain the updated incidence relation;
and constructing a test model through the updated incidence relation.
The device for constructing the test model in one embodiment of the invention comprises:
a memory for storing computer instructions;
a processor coupled to the memory, the processor configured to execute the method of constructing the test model described above based on computer instructions stored by the memory.
The apparatus shown in fig. 8 is only an example of a device for constructing a test model, and should not limit the function and the scope of the embodiment of the present invention. Referring to fig. 8, the apparatus for constructing a test model includes a processor 801, a memory 802, and an input/output device 803 connected by a bus. The memory 802 includes a Read Only Memory (ROM) and a Random Access Memory (RAM), and various computer instructions and data required to perform system functions are stored in the memory 802, and the processor 801 reads the various computer instructions from the memory 802 to perform various appropriate actions and processes. Input and output devices 803 including an input section for a keyboard, a mouse, and the like; an output section including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section including a hard disk and the like; and a communication section including a network interface card such as a LAN card, a modem, or the like. The memory 802 also stores the following computer instructions to perform the operations specified by the tone selection method of embodiments of the present invention: acquiring an interactive log in a tested response performance time period; establishing a production model through the incidence relation between the names and the number of various interactive services in the interactive log; extracting the incidence relation of interactive services required by testing from the production model to construct a testing model; the test model is used as a reference model for designing a test scene, and the type of interactive services and the number of various interactive services in the test scene are set with reference to the test model.
Accordingly, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions that, when executed, implement the operations specified by the above-mentioned test model building method.
The flowcharts and block diagrams in the figures and block diagrams illustrate the possible architectures, functions, and operations of the systems, methods, and apparatuses according to the embodiments of the present invention, and may represent a module, a program segment, or merely a code segment, which is an executable instruction for implementing a specified logical function. It should also be noted that the executable instructions which implement the specified logical functions may be recombined to construct new modules and program segments. The blocks of the drawings, and the order of the blocks, are thus provided to better illustrate the processes and steps of the embodiments and should not be taken as limiting the invention itself.
The various modules or units of the system may be implemented in hardware, firmware or software. The software includes, for example, a code program formed using various programming languages such as JAVA, C/C + +/C #, SQL, and the like. Although the steps and sequence of steps of the embodiments of the present invention are presented in method and method diagrams, the executable instructions of the steps implementing the specified logical functions may be re-combined to create new steps. The sequence of the steps should not be limited to the sequence of the steps in the method and the method illustrations, and can be modified at any time according to the functional requirements. Such as performing some of the steps in parallel or in reverse order.
Systems and methods according to the present invention may be deployed on a single server or on multiple servers. For example, different modules may be deployed on different servers, respectively, to form a dedicated server. Alternatively, the same functional unit, module or system may be deployed in a distributed fashion across multiple servers to relieve load stress. The server includes but is not limited to a plurality of PCs, PC servers, blades, supercomputers, etc. on the same local area network and connected via the Internet.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for constructing a test model is characterized by comprising the following steps:
acquiring an interactive log in a tested response performance time period;
establishing a production model according to the incidence relation between the names and the number of various interactive services in the interactive log;
and extracting the incidence relation of the interactive service required by the test from the production model to construct a test model.
2. The method according to claim 1, wherein the building of the production model through the association relationship between the names and the numbers of the various types of interaction services in the interaction log comprises:
calculating the occupation ratio of various interactive services in the interactive log according to the quantity of various interactive services in the interactive log to obtain the service occupation ratio;
associating the service occupation ratio, the name and the number of various interactive services in the interactive log to obtain the association relation;
and sequencing the incidence relations according to the service proportion to obtain the production model.
3. The method of constructing according to claim 2, further comprising, after obtaining the production model:
judging whether the production model has an incidence relation of a waste service to obtain a first judgment result, wherein the waste service is an interactive service without testability;
and deleting the incidence relation of the abandoned business from the production model to obtain the updated production model under the condition that the first judgment result shows that the incidence relation of the abandoned business exists in the production model.
4. The method of constructing according to claim 2, further comprising, after obtaining the production model:
judging whether a new service exists or not to obtain a second judgment result, wherein the new service is an interactive service for adding the incidence relation to the production model;
and adding the association relation corresponding to the newly added service to the production model to obtain the updated production model under the condition that the second judgment result indicates that the newly added service exists.
5. The building method according to claim 2, wherein extracting the association relation of the interactive services required for testing from the production model to build a test model comprises:
forming a first incidence relation group by the incidence relations with larger business occupation of preset quantity in the production model;
forming a second incidence relation group by incidence relations of high-priority transactions in the production model, wherein the high-priority transactions comprise interactive services which are easy to cause interactive faults;
and constructing a test model through the first incidence relation group and the second incidence relation group.
6. The building method according to claim 5, further comprising:
judging whether the incidence relation of the abandoned services exists in the test model or not to obtain a third judgment result, wherein the abandoned services are interactive services without testability;
and when the third judgment result shows that the incidence relation of the abandoned service exists in the test model, adjusting the test model so as to enable the test model not to include the incidence relation of the abandoned service.
7. The method of construction according to claim 6, wherein adjusting the test model comprises:
judging whether the incidence relation of the abandoned service belongs to the first incidence relation group or not to obtain a first sub-judgment result;
extracting the incidence relation of the first interactive service from the production model to replace the incidence relation of the abandoned service under the condition that the first sub-judgment result shows that the incidence relation of the abandoned service belongs to the first incidence relation group, wherein,
the first interactive service is a testable interactive service corresponding to the larger service proportion in a target model, and the target model is a residual model of the production model after the test model is removed.
8. The method of construction according to claim 6, wherein adjusting the test model comprises:
judging whether the incidence relation of the abandoned service belongs to the second incidence relation group or not to obtain a second sub-judgment result;
obtaining a second interactive service under the condition that the second sub-judgment result shows that the incidence relation of the abandoned service belongs to the second incidence relation group, and replacing the incidence relation of the abandoned service by the incidence relation of the second interactive service, wherein,
the second interactive service has testability, and the same interactive fault is caused by the second interactive service and the abandoned service.
9. The building method according to claim 5, wherein building a test model through the first incidence relation group and the second incidence relation group comprises:
calculating the ratio of each type of interactive service in the first incidence relation group and the second incidence relation group to obtain the updated service ratio;
for the incidence relation in the first incidence relation group and the second incidence relation group, replacing the service proportion of the corresponding category interactive service by the updated service proportion to obtain an updated incidence relation;
and constructing a test model according to the updated incidence relation.
10. A system for building a test model, comprising:
the acquisition module is used for acquiring an interactive log in a tested response performance time period;
the first construction module is used for constructing a production model through the incidence relation between the names and the number of various interactive services in the interactive log;
and the second construction module is used for extracting the incidence relation of the interactive service required by the test from the production model so as to construct a test model.
11. A computer-readable storage medium storing computer instructions which, when executed, implement a method of constructing a test model according to any one of claims 1 to 9.
12. An apparatus for constructing a test model, comprising:
a memory for storing computer instructions;
a processor coupled to the memory, the processor configured to perform a build method implementing the test model of any of claims 1-9 based on computer instructions stored by the memory.
CN201911149465.2A 2019-11-21 2019-11-21 Construction method and construction system of test model Pending CN112825061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911149465.2A CN112825061A (en) 2019-11-21 2019-11-21 Construction method and construction system of test model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911149465.2A CN112825061A (en) 2019-11-21 2019-11-21 Construction method and construction system of test model

Publications (1)

Publication Number Publication Date
CN112825061A true CN112825061A (en) 2021-05-21

Family

ID=75907199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911149465.2A Pending CN112825061A (en) 2019-11-21 2019-11-21 Construction method and construction system of test model

Country Status (1)

Country Link
CN (1) CN112825061A (en)

Similar Documents

Publication Publication Date Title
EP2572294B1 (en) System and method for sql performance assurance services
US8606905B1 (en) Automated determination of system scalability and scalability constraint factors
US7685468B2 (en) Method and system for test case generation
US20160224400A1 (en) Automatic root cause analysis for distributed business transaction
Vokolos et al. Performance testing of software systems
US11567756B2 (en) Causality determination of upgrade regressions via comparisons of telemetry data
CN106803799B (en) Performance test method and device
US11169910B2 (en) Probabilistic software testing via dynamic graphs
Srikanth et al. Regression testing in software as a service: An industrial case study
CN110647447A (en) Abnormal instance detection method, apparatus, device and medium for distributed system
US9823999B2 (en) Program lifecycle testing
CN102014163A (en) Cloud storage test method and system based on transaction driving
CN112825061A (en) Construction method and construction system of test model
CN110008098B (en) Method and device for evaluating operation condition of nodes in business process
CN113434382A (en) Database performance monitoring method and device, electronic equipment and computer readable medium
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN111240981A (en) Interface testing method, system and platform
CN113360368B (en) Method and device for testing software performance
JP7214173B1 (en) System and method for evaluating software development
US20050076276A1 (en) System and method for defect projection in transaction management in a target computer environment
CN117130945B (en) Test method and device
CN112783753B (en) Testing method and device for stream data processing system
CN116991708A (en) Method, system, device, electronic equipment and storage medium for calling link test
Kim et al. The new approach to IT testing: real transaction-based automated validation solution
CN117234852A (en) Abnormal service detection 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