CN111209180A - Regression testing method and device based on fuzzy matching - Google Patents

Regression testing method and device based on fuzzy matching Download PDF

Info

Publication number
CN111209180A
CN111209180A CN201811392842.0A CN201811392842A CN111209180A CN 111209180 A CN111209180 A CN 111209180A CN 201811392842 A CN201811392842 A CN 201811392842A CN 111209180 A CN111209180 A CN 111209180A
Authority
CN
China
Prior art keywords
value
test
keyword
response message
service response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811392842.0A
Other languages
Chinese (zh)
Other versions
CN111209180B (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.)
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang 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 China Mobile Communications Group Co Ltd, China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201811392842.0A priority Critical patent/CN111209180B/en
Publication of CN111209180A publication Critical patent/CN111209180A/en
Application granted granted Critical
Publication of CN111209180B publication Critical patent/CN111209180B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The embodiment of the invention provides a regression testing method and device based on fuzzy matching, wherein a service request message of a production environment is extracted and converted to be input into a testing environment with a stable version, keyword value content of a response message to be tested is configured and cut, a first response message output by the testing environment with the stable version is taken as a training sample, the number ratio of each keyword value is calculated to form a standard expected testing result, and then the keyword value number ratio obtained by the testing version is compared with a standard value in an interval manner to obtain a testing conclusion; the regression case can be simply and quickly updated and fitted with actual production business, the analysis and judgment of the test result can be automatically adjusted along with the input change, the business scene design of professional testers is not needed, and the test coverage degree and the case updating efficiency are improved.

Description

Regression testing method and device based on fuzzy matching
Technical Field
The embodiment of the invention relates to the technical field of testing, in particular to a regression testing method and device based on fuzzy matching.
Background
Software may be subject to problems whenever it is changed at any stage in its lifecycle. The software changes may result from errors being discovered and modifications being made, or may result from new modules being added during the integration or maintenance phase. When errors contained in the software are discovered, if the error tracking and management system is not perfect enough, modifications to the errors may be missed; the developer is not thorough enough to understand the error, and the modification can only correct the external appearance of the error without repairing the error so as to cause the modification failure; modifications may also have side effects that cause new problems with the unmodified portion of the software, causing errors in what would otherwise function properly. Similarly, when new code is added to the software, the new code may affect the original code in addition to the possibility of errors in the newly added code. Therefore, whenever software changes, we must retest the existing functionality to determine if the modification has achieved the intended purpose, and check if the modification has compromised the original normal functionality. At the same time, new test cases need to be supplemented to test new or modified functionality. Regression testing is required to verify the correctness of the modifications and their impact.
Regression testing refers to re-testing after old code has been modified to confirm that the modification did not introduce new errors or cause errors in other code. With the continuous popularization of agile development modes, the automated regression testing technology is paid more extensive attention and application, plays an extremely important role in the aspects of improving testing efficiency, saving testing cost and the like, greatly reduces the workload of testers, and can enable the testers to place the center of gravity of the test on the implementation of the test of changing functional points.
The development process of the traditional message automatic regression test mainly comprises the steps of test personnel regression case scene design, test expert case review, developer automatic case development investigation and automatic test application, but as most of the regression cases are compiled by professional test personnel according to experience and simultaneously combining with the service scene of actual design of production operation, the situations of incomplete coverage or non-conformity with the actual situation still exist; meanwhile, the compiling of the automatic test case requires a test developer to preset an input message, compile an expected output message, compare the expected output with the test output, and determine that the test passes when the results are consistent, so that the development and maintenance process of each regression case is complex, the time consumption is long, and the labor cost is high.
Disclosure of Invention
Embodiments of the present invention provide a regression testing method and apparatus based on fuzzy matching, which overcome the above problems or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a regression testing method based on fuzzy matching, including:
the method comprises the steps that a service request message in a production environment is input into a stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
and inputting the service request message into a test version test environment, obtaining a second service response message output by the test version test environment, judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, passing the test, and otherwise, testing abnormally.
In a second aspect, an embodiment of the present invention provides a regression testing apparatus based on fuzzy matching, including:
the data acquisition generator is used for inputting the service request message extracted from the production environment into a stable version test environment in a training stage, acquiring a first service response message output by the stable version test environment, and inputting the service request message extracted from the production environment into a test version test environment in a test stage to acquire a second service response message output by the test version test environment;
the key value calculator is used for calculating the keyword value occupation ratio in the first service response message in the training stage, and training by taking the keyword value occupation ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule; calculating the keyword value occupation ratio of the second service response message in a test stage;
the deviation analyzer is used for writing the mean value and the standard deviation value obtained in the training stage into a standard deviation library and constructing a key value ratio deviation interval based on the mean value and the standard deviation value; and in the test stage, comparing whether the key word value occupation ratio in the two service response messages is in the key value occupation ratio deviation interval, if so, judging that the test is passed, and if not, judging that the test is not passed.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the fuzzy matching based regression testing method as provided in the first aspect when executing the program.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the fuzzy matching based regression testing method as provided in the first aspect.
The embodiment of the invention provides a regression testing method and device based on fuzzy matching, wherein a service request message of a production environment is extracted and converted to be input into a testing environment with a stable version, keyword value content of a response message to be tested is configured and cut, a first response message output by the testing environment with the stable version is taken as a training sample, the number ratio of each keyword value is calculated to form a standard expected testing result, and then the keyword value number ratio obtained by the testing version is compared with a standard value in an interval to obtain a testing conclusion; the regression case can be simply and quickly updated and fitted with actual production business, the analysis and judgment of the test result can be automatically adjusted along with the input change, the business scene design of professional testers is not needed, and the test coverage degree and the case updating efficiency are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a regression testing method based on fuzzy matching according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a specific flow of sample training according to an embodiment of the present invention;
FIG. 3 is a block diagram of a regression testing apparatus based on fuzzy matching according to an embodiment of the present invention;
FIG. 4 is a flow chart of a service test phase according to an embodiment of the present invention;
fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
The regression test refers to that after a program is modified, the test is carried out again to confirm that no new error is introduced into the modification or other codes generate errors, and the regression test is used as a component of the life cycle of the program and has a great workload proportion in the whole program test. Multiple regression tests are performed at each stage of program development. In progressive and fast iterative development, the continuous release of new versions of programs makes regression testing more frequent, whereas in extreme programming methods it is even more required to perform regression testing several times per day.
Although the development mode of the current automatic case can accurately judge the test conclusion, most of the compiling of the regression case is realized by combining the business scenes of production operation actual design according to experience by professional testers, and the condition of incomplete coverage or noncompliance with the actual situation still exists; meanwhile, the compiling of the automatic test case requires a test developer to preset an input message, compile an expected output message, compare the expected output with the test output, and determine that the test passes when the results are consistent, so that the development and maintenance process of each regression case is complex, the time consumption is long, and the labor cost is high.
Therefore, in each embodiment of the invention, the standard value and the standard difference value of different value ratios of each keyword of the service response message are calculated and analyzed by carrying out sample training in a normal environment, then the interval deviation comparison analysis is carried out on the response message result obtained by the test version and the standard value, whether the test result is in accordance with the expectation is automatically verified, and the current situations of incomplete coverage of the regression test case, update lag, high case maintenance investment cost and the like caused by service development change are solved. The following description and description will proceed with reference being made to various embodiments.
Fig. 1 is a regression testing method based on fuzzy matching according to an embodiment of the present invention, including:
s1, the service request message in the production environment is input into the stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
s2, inputting the service request message into a test environment of the test version, obtaining a second service response message output by the test environment of the test version, and judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, the test is passed, and if not, the test is abnormal.
In this embodiment, step S1 is mainly to perform sample training, extract a service request packet of a production environment, convert and input the service request packet into a stable version test environment with a stable version, simply configure and cut the keyword value content of a response packet to be tested, use the response packet output by the stable version test environment as a training sample, calculate the number ratio of each keyword value to form a standard expected test result, analyze a standard value and a standard difference value of different value ratios of each keyword of the service response packet, perform interval comparison between the number ratio of the keyword values obtained by the test version and the standard value to obtain a test conclusion, perform interval deviation comparison analysis between the response packet result obtained by the test version and the standard value, and automatically verify whether the test result meets expectations. The method for accurately comparing the test result with the expected result and judging the test conclusion is broken through, and the regression test result is judged by adopting a data training and result interval matching comparison method based on statistical analysis. The problems that regression test cases are not covered completely, updating is delayed, case maintenance input cost is high and the like due to business development changes are solved, the test scenes can be extracted and updated from the production environment simply and quickly, manual design is not needed, intervention of testers is not needed, and fitting degree of the test scenes and reduction of human resources are greatly improved.
On the basis of the above embodiment, the method for inputting the service request message in the production environment into the stable version test environment specifically includes, as shown in fig. 2:
s11, releasing the version of the test environment into a stable version consistent with the current production environment to obtain a stable version test environment;
s12, extracting a set number of service request messages from the production environment, and converting the service request messages into message formats matched with the stable version test environment input;
and S13, inputting the service request message into the stable version test environment, and acquiring a first service response message output by the stable version test environment.
In this embodiment, the version of the test environment is released into a stable version consistent with the current production environment, a set number of service request messages with a certain time interval are extracted from the production environment as required, the service request messages are subjected to simple target address conversion and converted into a message format capable of being used by test environment test input, the message format is converted into a simulated service request message of the test environment and input into the test environment, a corresponding service response message is obtained, and when a regression case needs to be updated, the purpose can be achieved by simply extracting the service request message from the production environment again.
On the basis of the foregoing embodiments, calculating a keyword value-to-value ratio in the first service response packet specifically includes, as shown in fig. 2:
s14, formatting the first service response message to form a message type, keywords and a value-taking key value pair sequence;
calculating a ratio combination matrix of various values of the keywords:
Figure BDA0001874455480000061
Figure BDA0001874455480000062
in the formula (I), the compound is shown in the specification,
Figure BDA0001874455480000063
for the KEY word KEY in the first service response messageiSubmatrices of various value ratios, vi1~vimAs a keyword KEYiIs determined by the sequence of values of (c),
Figure BDA0001874455480000064
as a keyword KEYkThe number of the occurrences accounts for the value of the corresponding first service response message, and n is the number of the keywords in the first service response message.
In this embodiment, the received pairs need to be pairedThe response message (in this embodiment, the first service response message) is formatted to form a KEY-value pair sequence of the message type, a KEY-value pair sequence of the KEY and a KEY-value pair sequence of the value, such as [ message type (KEY) ]1,value11),(KEY2,value21),(KEY3,value31),…]And the like.
Calculating the occupation ratio combination matrix of various values of the keywords, namely calculating the occupation ratio combination matrix T of various values of the keywords in the response message corresponding to the test in the current round(KEY)Expressed as follows:
Figure BDA0001874455480000071
on the basis of the above embodiments, training with the keyword value ratio as a sample to obtain a mean value and a standard deviation value that conform to a gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard deviation value, as shown in fig. 2, specifically includes:
s15, calculating
Figure BDA0001874455480000072
And constructing a key value ratio deviation interval (mu-3 sigma, mu +3 sigma) based on the mean value mu and the standard deviation sigma, and writing the mean value mu and the standard deviation sigma into a standard deviation library for storage.
In this embodiment, the received keyword ratio of the multiple rounds of tests is used as a sample, and the keyword ratio is calculated to meet the gaussian distribution rule N (μ, σ)2) The mean value mu and the standard difference value sigma of the method can calculate the proportion combination matrix T of various values of each keyword in the test environment output response message when the service request message extracted from the production environment under the normal condition is used as the simulation test input((KEY)All elements obey the mean value mu and the standard deviation value sigma of the Gaussian distribution rule; and writing the mean value mu and the standard deviation value sigma into a standard deviation library for storage.
After the steps are completed, the corresponding service request message can be used in multiple tests, corresponding training is not required to be carried out before each test, and only when test case scene updating or service message format changing is carried out, the test is required to carry out parameter configuration and sample training and calculate the corresponding mathematical expected value mu and the standard difference value sigma.
On the basis of the foregoing embodiments, before formatting the first service response packet, the method further includes:
and configuring the message type, the keywords and the keyword values to be tested in the first service response message.
In this embodiment, it is also necessary to perform configuration of the message type to be tested, the keyword of the message, and a keyword value in the response message in advance, where the keyword value may be flexibly configured according to actual needs. For example, a key for enumerated values may be set as a default, i.e., each value is statistically analyzed; for the numeric keywords, the numeric keywords can be set as interval range values for statistical analysis; for the character-type keywords, a regular expression matching of partial characters or a numeric statistical evaluation method of the number of characters can be adopted for statistical analysis.
On the basis of the foregoing embodiments, determining whether the value occupation ratio of the keyword in the second service response packet is within the key value occupation ratio deviation interval specifically includes:
and calculating the value occupation ratio of each keyword in the second service response message, and judging whether the value occupation ratio of each keyword is in the key value occupation ratio deviation interval.
Specifically, if the value occupation ratio is within the key value occupation ratio deviation interval, judging that the value occupation ratio of the corresponding keyword meets the test requirement, and passing the test;
if the value occupation ratio is not in the key value occupation ratio deviation interval, judging that the value occupation ratio of the corresponding keyword does not meet the test requirement, failing the test, and outputting a test failure result and related data.
In this embodiment, during testing, different value ratios of each keyword of the test response packet in the current round are compared with corresponding standard ratio data stored in the deviation standard library, if a test value falls outside a key value ratio deviation interval (μ -3 σ, μ +3 σ), it is indicated that a test result of the keyword corresponding value is abnormal, a test failure result and related data are output to a tester for analysis, otherwise, the test is passed, a random deviation of the output result caused by a jitter variation of a test environment is compensated and corrected, and accuracy of a test conclusion is ensured.
Fig. 3 shows a regression testing apparatus based on fuzzy matching, which is based on the regression testing method based on fuzzy matching in the above embodiments, and includes a data acquisition generator 30, a key value calculator 40, and a deviation analyzer 50, wherein:
the data acquisition generator 30 inputs the service request message extracted from the production environment into the stable version test environment in the training stage to obtain a first service response message output by the stable version test environment, and inputs the service request message extracted from the production environment into the test version test environment in the test stage to obtain a second service response message output by the test version test environment;
the key value calculator 40 calculates a keyword value ratio in the first service response message in a training stage, and obtains a mean value and a standard difference value which accord with a Gaussian distribution rule by taking the keyword value ratio as a sample for training; calculating the keyword value occupation ratio of the second service response message in a test stage;
the deviation analyzer 50 writes the mean value and the standard deviation value obtained in the training stage into a standard deviation library, and establishes a key value ratio deviation interval based on the mean value and the standard deviation value; and in the test stage, comparing whether the key word value occupation ratio in the two service response messages is in the key value occupation ratio deviation interval, if so, judging that the test is passed, and if not, judging that the test is not passed.
Specifically, in this embodiment, the data collection generator 30 extracts a service request message at a certain time interval from the production environment according to the requirement of the tester, and performs simple target address conversion on the service request message to convert the service request message into a simulated service request message for the test environment. The advantage of this is that when the regression case needs to be updated, the objective can be achieved by simply extracting the service request message from the production environment.
In this embodiment, the key value calculator 40 receives the service response message output by the test environment, calculates the proportion distribution of the values of the keywords in the test response message of the current round according to the detection configuration information, and outputs the proportion distribution to the deviation analyzer 50 for processing. The system comprises a detection configuration module 401, a message analysis module 402, a value-taking ratio calculation module 403 and the like.
Specifically, the detection configuration module 401 is responsible for configuring the type of the message to be tested, the keywords of the message, and the values of the keywords in the response message, where the values of the keywords can be flexibly configured according to actual needs. For example, a key for enumerated values may be set as a default, i.e., each value is statistically analyzed; for the numeric keywords, the numeric keywords can be set as interval range values for statistical analysis; for the character-type keywords, a regular expression matching of partial characters or a numeric statistical evaluation method of the number of characters can be adopted for statistical analysis.
The message parsing module 402 is responsible for formatting the received corresponding response message (in this embodiment, the first service response message) to form a KEY-value pair sequence of a message type, a KEY-value pair sequence of a KEY and a value-taking KEY-value pair sequence, such as [ MessageType (KEY) ]1,value11),(KEY2,value21),(KEY3,value31),…]And the like.
Formatting the first service response message to form a message type, keywords and a value-taking key value pair sequence;
the value-to-ratio calculation module 403 calculates a ratio combination matrix in which various values of the keyword appear:
Figure BDA0001874455480000091
Figure BDA0001874455480000092
in the formula (I), the compound is shown in the specification,
Figure BDA0001874455480000093
for the KEY word KEY in the first service response messageiSubmatrices of various value ratios, vi1~vimAs a keyword KEYiIs determined by the sequence of values of (c),
Figure BDA0001874455480000094
as a keyword KEYkThe number of the occurrences accounts for the value of the corresponding first service response message, and n is the number of the keywords in the first service response message.
In this embodiment, the deviation analyzer 50 is configured to calculate a proportion matrix T of various values of each keyword in a test environment output response message when a service request message extracted from a production environment under normal conditions is used as a simulation test input(KEY)All elements obey the mean value mu and the standard deviation value sigma of the Gaussian distribution rule; in the test case, if the ratio of the values of the keywords in the test result falls outside the corresponding probability interval (mu-3 sigma, mu +3 sigma), the test is not passed, otherwise, the test is passed. The deviation analyzer 50 includes four components, a mode switch 501, a standard deviation library 502, a distribution calculation module 503, and a deviation comparison module 504.
Specifically, the mode switch 501 is used to set the current functional state of the fuzzy matching regression testing apparatus, and includes two modes, i.e. a "training" mode and a "testing" mode. When the mode switch 501 is "training", the apparatus is in a training learning state, and at this time, the deviation analyzer 50 takes the value-to-value ratio distribution of each keyword in the current round of testing output by the key value calculator 40 as a training sample, and inputs the training sample to the distribution calculation module 503 for processing; when the mode switch 501 is "test", the apparatus is in a test state, and the deviation analyzer 50 inputs the value-to-ratio distribution of each keyword in the current round of test output by the key value calculator 40 to the deviation comparing module 504 for comparison.
The standard deviation library 502 is used for storing various value ratios of each keyword of the detected response message calculated by the distribution calculation module 503
Figure BDA0001874455480000101
The mean value μ and the standard deviation value σ.
The distribution calculation module 503 takes effect when the mode switch 501 is set to "train", and at this time, it summarizes the proportion combination matrix T of each keyword value of the multi-round test response messages output by the received key value calculator 40(KEY)Calculate each element
Figure BDA0001874455480000102
The mean μ and standard deviation σ that fit the gaussian distribution law are then written to the standard library of deviations 502 for storage.
The deviation comparing module 504 is effective when the mode switch 501 is set to "test", and at this time, it receives different ratios of each value of each keyword of the test response message of the current round output by the key value calculator 40, and compares the different ratios with the corresponding standard ratio data stored in the deviation standard library 502, if the test value falls outside (μ -3 σ, μ +3 σ), it indicates that the keyword ratio does not meet the test requirement, and the test does not pass.
Specifically, in this embodiment, the training phase includes:
1) setting a response message type, a message keyword and keyword value content to be tested in a detection configuration module 401 of the key value calculator 40;
2) releasing the version of the test environment into a stable version consistent with the current production environment;
3) the data acquisition generator 30 extracts a certain number of service request messages from the production environment and converts them into a message format that can be used by the test input of the test environment;
4) the data acquisition generator 30 inputs the converted service request message into a test environment, the key value calculator 40 acquires a corresponding service response message, calculates the proportion matrix combination of different values of each keyword in the response message to be tested corresponding to the test of the current round, and outputs the proportion matrix combination to the deviation analyzer 50;
5) repeating the operation of the step 4) for multiple rounds;
6) the deviation analyzer 50 takes the received keyword value ratio values of the multi-round tests as samples, and calculates that the values accord with the Gaussian scoreCloth law N (mu, sigma)2) And the standard deviation value sigma, and writes them into the standard deviation library 502 for storage.
After the training is finished, the corresponding service request message can be used in multiple tests, corresponding training is not required to be carried out before each test, and only when test case scene updating or service message format changing is carried out, test designers are required to intervene to carry out parameter configuration and sample training and calculate the corresponding mathematical expected value mu and the standard difference value sigma.
As shown in fig. 4, the service testing stage specifically includes:
the tester releases the version of the test environment into a version to be tested;
the data acquisition generator 30 inputs the previously extracted and converted service request message into a test environment, the key value calculator 40 calculates the occupation ratio values of different values of each keyword in the response message, and outputs the occupation ratio values to the deviation analyzer 50;
the deviation analyzer 50 compares the obtained ratio with the data stored in the deviation standard library 502, and if the ratio falls outside (μ -3 σ, μ +3 σ) (i.e., the probability interval in fig. 4), it indicates that the test result of the value corresponding to the keyword is abnormal, outputs the test failure result and related data to the tester for analysis, otherwise, the test is passed, and generates a test conclusion, an abnormal deviation list and an abnormal deviation key value list, and outputs the result.
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may invoke a computer program stored on the memory 830 and executable on the processor 810 to perform the fuzzy matching based regression testing methods provided by the embodiments described above, including, for example:
s1, the service request message in the production environment is input into the stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
s2, inputting the service request message into a test environment of the test version, obtaining a second service response message output by the test environment of the test version, and judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, the test is passed, and if not, the test is abnormal.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the regression testing method based on fuzzy matching provided in the foregoing embodiments when executed by a processor, for example, the method includes:
s1, the service request message in the production environment is input into the stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
s2, inputting the service request message into a test environment of the test version, obtaining a second service response message output by the test environment of the test version, and judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, the test is passed, and if not, the test is abnormal.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the regression testing method based on fuzzy matching as described above, for example, the method includes:
s1, the service request message in the production environment is input into the stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
s2, inputting the service request message into a test environment of the test version, obtaining a second service response message output by the test environment of the test version, and judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, the test is passed, and if not, the test is abnormal.
In summary, the regression testing method and apparatus based on fuzzy matching provided by the embodiments of the present invention extract a service request message of a production environment, convert and input the service request message into a testing environment with a stable version, configure and cut keyword value contents of a response message to be tested, use a first response message output by the testing environment with the stable version as a training sample, calculate the number ratio of each keyword value to form a standard expected testing result, and perform interval comparison between the keyword value number ratio obtained by the testing version and a standard value to obtain a testing conclusion; the regression case can be simply and quickly updated and fitted with actual production business, the analysis and judgment of the test result can be automatically adjusted along with the input change, the business scene design of professional testers is not needed, and the test coverage degree and the case updating efficiency are improved.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and 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.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A regression testing method based on fuzzy matching is characterized by comprising the following steps:
the method comprises the steps that a service request message in a production environment is input into a stable version test environment, and a first service response message output by the stable version test environment is obtained; calculating a keyword value ratio in the first service response message, training by taking the keyword value ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule, and constructing a key value ratio deviation interval based on the mean value and the standard difference value;
and inputting the service request message into a test version test environment, obtaining a second service response message output by the test version test environment, judging whether the value occupation ratio of the keywords in the second service response message is within the key value occupation ratio deviation interval, if so, passing the test, and otherwise, testing abnormally.
2. The regression testing method based on fuzzy matching according to claim 1, wherein the step of inputting the service request message in the production environment into the stable version testing environment specifically comprises:
releasing the version of the test environment into a stable version consistent with the current production environment to obtain a stable version test environment;
extracting a set number of service request messages from a production environment, converting the service request messages into a message format matched with the input of the stable version test environment, and acquiring a first service response message output by the stable version test environment.
3. The regression testing method based on fuzzy matching according to claim 1, wherein calculating a keyword value-to-ratio in the first service response packet specifically comprises:
formatting the first service response message to form a message type, keywords and a value-taking key value pair sequence;
calculating a ratio combination matrix of various values of the keywords:
Figure FDA0001874455470000011
Figure FDA0001874455470000021
in the formula (I), the compound is shown in the specification,
Figure FDA0001874455470000022
for the KEY word KEY in the first service response messageiSubmatrices of various value ratios, vi1~vimAs a keyword KEYiIs determined by the sequence of values of (c),
Figure FDA0001874455470000023
as a keyword KEYkThe number of the occurrences accounts for the value of the corresponding first service response message, and n is the number of the keywords in the first service response message.
4. The regression testing method based on fuzzy matching according to claim 3, wherein a mean value and a standard difference value which conform to a Gaussian distribution rule are obtained by training with the keyword value ratio as a sample, and a key value ratio deviation interval is constructed based on the mean value and the standard difference value, specifically comprising:
computing
Figure FDA0001874455470000024
And constructing a key value ratio deviation interval (mu-3 sigma, mu +3 sigma) based on the mean value mu and the standard deviation sigma, and writing the mean value mu and the standard deviation sigma into a standard deviation library for storage.
5. The regression testing method based on fuzzy matching according to claim 3, wherein before formatting said first service response packet, further comprising:
and configuring the message type, the keywords and the keyword values to be tested in the first service response message.
6. The regression testing method based on fuzzy matching according to claim 1, wherein judging whether a keyword value occupation ratio in the second service response packet is within the key value occupation ratio deviation interval specifically comprises:
and calculating the value occupation ratio of each keyword in the second service response message, and judging whether the value occupation ratio of each keyword is in the key value occupation ratio deviation interval.
7. The regression testing method based on fuzzy matching according to claim 6, wherein if said test is passed, otherwise said test is abnormal, specifically comprising:
if the value occupation ratio is within the key value occupation ratio deviation interval, judging that the value occupation ratio of the corresponding keyword meets the test requirement, and passing the test;
if the value occupation ratio is not in the key value occupation ratio deviation interval, judging that the value occupation ratio of the corresponding keyword does not meet the test requirement, failing the test, and outputting a test failure result and related data.
8. A regression testing device based on fuzzy matching is characterized by comprising:
the data acquisition generator is used for inputting the service request message extracted from the production environment into a stable version test environment in a training stage, acquiring a first service response message output by the stable version test environment, and inputting the service request message extracted from the production environment into a test version test environment in a test stage to acquire a second service response message output by the test version test environment;
the key value calculator is used for calculating the keyword value occupation ratio in the first service response message in the training stage, and training by taking the keyword value occupation ratio as a sample to obtain a mean value and a standard difference value which accord with a Gaussian distribution rule; calculating the keyword value occupation ratio of the second service response message in a test stage;
the deviation analyzer is used for writing the mean value and the standard deviation value obtained in the training stage into a standard deviation library and constructing a key value ratio deviation interval based on the mean value and the standard deviation value; and in the test stage, comparing whether the key word value occupation ratio in the two service response messages is in the key value occupation ratio deviation interval, if so, judging that the test is passed, and if not, judging that the test is not passed.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the fuzzy matching based regression testing method of any one of claims 1 to 7.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, implements the steps of the fuzzy matching based regression testing method according to any one of claims 1 to 7.
CN201811392842.0A 2018-11-21 2018-11-21 Regression testing method and device based on fuzzy matching Active CN111209180B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811392842.0A CN111209180B (en) 2018-11-21 2018-11-21 Regression testing method and device based on fuzzy matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811392842.0A CN111209180B (en) 2018-11-21 2018-11-21 Regression testing method and device based on fuzzy matching

Publications (2)

Publication Number Publication Date
CN111209180A true CN111209180A (en) 2020-05-29
CN111209180B CN111209180B (en) 2023-04-25

Family

ID=70788266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811392842.0A Active CN111209180B (en) 2018-11-21 2018-11-21 Regression testing method and device based on fuzzy matching

Country Status (1)

Country Link
CN (1) CN111209180B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930612A (en) * 2020-07-09 2020-11-13 北京皮尔布莱尼软件有限公司 Method and device for detecting code updating correctness and computing equipment
CN113553260A (en) * 2021-07-22 2021-10-26 工银科技有限公司 Test method, test apparatus, device, medium, and program product

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011034805A1 (en) * 2009-09-17 2011-03-24 Siemens Aktiengesellschaft Supervised fault learning using rule-generated samples for machine condition monitoring
CN104657248A (en) * 2013-11-21 2015-05-27 中国移动通信集团山东有限公司 Java thread stack analysis method and system
CN105046045A (en) * 2015-06-05 2015-11-11 河海大学 Bayesian combination-based Web service QoS prediction method
US20160140028A1 (en) * 2014-11-18 2016-05-19 King.Com Limited Testing systems and methods
JP2017134682A (en) * 2016-01-28 2017-08-03 株式会社Lifull Information processing system and information processing method
CN107066381A (en) * 2017-02-27 2017-08-18 网易(杭州)网络有限公司 Generate method, device and the equipment of the test analysis report based on image recognition
CN107086935A (en) * 2017-06-16 2017-08-22 重庆邮电大学 Flow of the people distribution forecasting method based on WIFI AP
CN108446711A (en) * 2018-02-01 2018-08-24 南京邮电大学 A kind of Software Defects Predict Methods based on transfer learning

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011034805A1 (en) * 2009-09-17 2011-03-24 Siemens Aktiengesellschaft Supervised fault learning using rule-generated samples for machine condition monitoring
CN102498445A (en) * 2009-09-17 2012-06-13 西门子公司 Supervised fault learning using rule-generated samples for machine condition monitoring
CN104657248A (en) * 2013-11-21 2015-05-27 中国移动通信集团山东有限公司 Java thread stack analysis method and system
US20160140028A1 (en) * 2014-11-18 2016-05-19 King.Com Limited Testing systems and methods
CN105046045A (en) * 2015-06-05 2015-11-11 河海大学 Bayesian combination-based Web service QoS prediction method
JP2017134682A (en) * 2016-01-28 2017-08-03 株式会社Lifull Information processing system and information processing method
CN107066381A (en) * 2017-02-27 2017-08-18 网易(杭州)网络有限公司 Generate method, device and the equipment of the test analysis report based on image recognition
CN107086935A (en) * 2017-06-16 2017-08-22 重庆邮电大学 Flow of the people distribution forecasting method based on WIFI AP
CN108446711A (en) * 2018-02-01 2018-08-24 南京邮电大学 A kind of Software Defects Predict Methods based on transfer learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴定海, 张培林, 任国全, 傅建平: "基于最大间隔超球分类器的柴油机异常检测研究" *
苏师师: "基于元数据的DNS异常检测系统设计与实现" *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930612A (en) * 2020-07-09 2020-11-13 北京皮尔布莱尼软件有限公司 Method and device for detecting code updating correctness and computing equipment
CN111930612B (en) * 2020-07-09 2024-03-19 北京皮尔布莱尼软件有限公司 Code updating correctness detection method and device and computing equipment
CN113553260A (en) * 2021-07-22 2021-10-26 工银科技有限公司 Test method, test apparatus, device, medium, and program product
CN113553260B (en) * 2021-07-22 2022-07-19 工银科技有限公司 Test method, test apparatus, device, and medium

Also Published As

Publication number Publication date
CN111209180B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
US8799869B2 (en) System for ensuring comprehensiveness of requirements testing of software applications
CN111858242B (en) System log abnormality detection method and device, electronic equipment and storage medium
CN112052172B (en) Rapid test method and device for third-party channel and electronic equipment
CN109002391A (en) The method of automatic detection embedded software interface testing data
CN110088744B (en) Database maintenance method and system
CN112199293A (en) Software quality evaluation method and device, terminal equipment and storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN111427928A (en) Data quality detection method and device
CN111209180B (en) Regression testing method and device based on fuzzy matching
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN113138808B (en) Integration method, device, computer equipment and storage medium
CN104574179A (en) Double-check verification system and double-check verification method for bank card capital settlement platform
CN113239006A (en) Log detection model generation method and device and log detection method and device
CN112817847A (en) Data processing task testing method and device, electronic equipment and storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN115098401A (en) HTML report verification method and device, electronic equipment and storage medium
CN114416596A (en) Application testing method and device, computer equipment and storage medium
US20240045752A1 (en) Methods and apparatuses for troubleshooting a computer system
CN114490413A (en) Test data preparation method and device, storage medium and electronic equipment
CN109508204B (en) Front-end code quality detection method and device
CN110716855B (en) Processor instruction set testing method and device
CN113220594B (en) Automatic test method, device, equipment and storage medium
CN113434408B (en) Unit test case sequencing method based on test prediction
US20220188494A1 (en) Computing device and method for developing a system model utilizing a simulation assessment module
CN116303029A (en) Analysis method and device for test cases, processor and electronic equipment

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