CN110502432B - Intelligent test method, device, equipment and readable storage medium - Google Patents
Intelligent test method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN110502432B CN110502432B CN201910667875.XA CN201910667875A CN110502432B CN 110502432 B CN110502432 B CN 110502432B CN 201910667875 A CN201910667875 A CN 201910667875A CN 110502432 B CN110502432 B CN 110502432B
- Authority
- CN
- China
- Prior art keywords
- test case
- test
- case data
- data
- algorithm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 238000010998 test method Methods 0.000 title claims description 28
- 238000012360 testing method Methods 0.000 claims abstract description 651
- 238000000034 method Methods 0.000 claims abstract description 66
- 238000012545 processing Methods 0.000 claims abstract description 47
- 238000004140 cleaning Methods 0.000 claims abstract description 45
- 238000012549 training Methods 0.000 claims abstract description 37
- 238000004364 calculation method Methods 0.000 claims abstract description 20
- 230000007787 long-term memory Effects 0.000 claims abstract description 14
- 230000006403 short-term memory Effects 0.000 claims abstract description 11
- 230000015654 memory Effects 0.000 claims description 20
- 238000010606 normalization Methods 0.000 claims description 13
- 238000001514 detection method Methods 0.000 claims description 3
- 230000002123 temporal effect Effects 0.000 claims description 3
- 238000013473 artificial intelligence Methods 0.000 abstract description 4
- 230000008569 process Effects 0.000 description 17
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000004458 analytical method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 238000012790 confirmation Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 239000012085 test solution Substances 0.000 description 1
- 238000005406 washing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3676—Test management for coverage analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to the technical field of artificial intelligence, and discloses an intelligent testing method, which comprises the following steps: cleaning the original test case data by adopting a cleaning algorithm to obtain test case data; training the test case data through each algorithm in the algorithm set of the preset calculation path to obtain an algorithm for processing the test case data according to the preset calculation path; randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set; processing the expansion data set through a long-term and short-term memory network to obtain a test case set to be executed; expanding the test case set to be executed through an exhaustion method; and executing the test case to obtain a test result. The invention also discloses an intelligent testing device, equipment and a computer readable storage medium. The intelligent testing method provided by the invention solves the technical problem of low testing quality.
Description
Technical Field
The present invention relates to the field of artificial intelligence, and in particular, to an intelligent testing method, apparatus, device, and computer readable storage medium.
Background
At present, in a real scene, based on objective reasons of limited project time and limited manpower, all conditions cannot be considered when a test case is designed manually, so that a tester generally designs and tests important cases according to analysis or experience, the coverage rate of the test case is low, and the test quality is low.
Disclosure of Invention
The invention mainly aims to provide an intelligent testing method, device and equipment and a computer readable storage medium, and aims to solve the technical problem of low testing quality.
In order to achieve the above object, the present invention provides an intelligent test method, which includes the steps of:
traversing the original test case data in sequence, and adopting a corresponding preset cleaning algorithm to clean the original test case data to obtain test case data;
training an initial candidate algorithm of a preset calculation path sequentially through the test case data to obtain a candidate algorithm, wherein the candidate algorithm at least comprises: algorithms of long-term and short-term memory networks, exhaustion methods and random algorithms;
randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set;
Processing the expansion data set through a long-short-term memory network to obtain a test case set to be executed;
judging whether the number of the test cases in the to-be-executed test case set is smaller than the number of the test cases required by the current test scene;
if the number of the to-be-executed test cases is smaller than the number of the test cases required by the current test scene, expanding the to-be-executed test cases through an exhaustion method until the number of the to-be-executed test cases is larger than or equal to the number of the test cases required by the current test scene, and if the number of the to-be-executed test cases is larger than or equal to the number of the test cases required by the current test scene, not processing the to-be-executed test cases;
and sequentially executing the test cases in the test case set to be executed to obtain a test result.
Optionally, the randomly acquiring the test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set includes:
randomly acquiring test case data through a random algorithm;
extracting keywords in the test case data through word frequency and reverse word frequency algorithms to obtain first keywords;
And matching the first keywords with preset keywords in a preset keyword lexicon through a hash algorithm to obtain second keywords, and replacing the first keywords to obtain an expanded data set.
Optionally, the step of cleaning the original test case data by using a corresponding preset cleaning algorithm according to the data type of the original test case data, where obtaining the test case data includes:
judging whether the data type of the original test case data is numerical;
if the data type of the original test case data is a numerical type, processing the original test case data by adopting a normalization algorithm, and if the data type of the original test case data is a non-numerical type, judging whether the data type of the original test case data is a category type;
if the data type of the original test case data is of a category type, processing the original test case data by adopting a discretization algorithm, and if the data type of the original test case data is of a non-category type, judging whether the data type of the original test case data is of a time type;
and if the data type of the original test case data is of a time type, processing the original test case data by adopting a time division method, and if the data type of the original test case data is of a non-time type, not processing.
Optionally, the intelligent test method further includes:
judging whether the cleaned original test case data has a missing value or not;
if the cleaned original test case data has a missing value, the missing value is interpolated by adopting a K nearest neighbor algorithm, and if the cleaned original test case data does not have a missing value, the processing is not performed.
Optionally, the intelligent test method further includes:
processing the test case data through a long-term and short-term memory network to obtain a first test case;
judging whether the number of the first test cases is smaller than the required number of the current test scene on the number of the test cases or not;
if the number of the first test cases is smaller than the demand of the current test scene for the number of the test cases, expanding the first test cases through an exhaustion method to obtain a second test case set, and if the number of the first test cases is larger than or equal to the demand of the current test scene for the number of the test cases, not processing;
and acquiring the test cases in the second test case set through a random algorithm, extracting keywords in the test cases, expanding the test cases according to the keywords, and obtaining the test cases to be executed.
Optionally, the intelligent test method further includes:
detecting codes of the test case data through a pre-built junit unit test framework to obtain code coverage rate of the test case data;
judging whether the code coverage rate of the test case data is smaller than a preset coverage rate or not;
if the code coverage rate of the test case data is smaller than the preset coverage rate, training the test case data according to the algorithm set of the preset calculation path until the code coverage rate of the output test case data is larger than or equal to the preset coverage rate, and if the code coverage rate of the test case data is larger than or equal to the preset coverage rate, not processing.
Further, to achieve the above object, the present invention also provides an intelligent test apparatus, including:
the cleaning module is used for traversing the original test case data in sequence, and cleaning the original test case data by adopting a corresponding preset cleaning algorithm to obtain test case data;
the first training module is used for training the initial candidate algorithm of the preset calculation path sequentially through the test case data to obtain a candidate algorithm;
The first expansion module is used for randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords and obtaining an expansion data set;
the first processing module is used for processing the expansion data set through a long-term and short-term memory network to obtain a test case set to be executed;
the first judging module is used for judging whether the number of the test cases in the to-be-executed test case set is smaller than the number of the test cases required by the current test scene;
the second expansion module is used for expanding the to-be-executed test cases through an exhaustion method if the number of to-be-executed test cases is smaller than the number of test cases required by the current test scene until the number of to-be-executed test cases is larger than or equal to the number of test cases required by the current test scene;
and the execution module is used for sequentially executing the test cases in the test case set to be executed to obtain a test result.
Optionally, the first expansion module includes:
the acquisition unit is used for randomly acquiring the test case data through a random algorithm;
the extraction unit is used for extracting keywords in the test case data through word frequency and reverse word frequency algorithms to obtain first keywords;
The matching unit is used for matching the first keywords with preset keywords in a preset keyword lexicon through a hash algorithm to obtain second keywords, and replacing the first keywords to obtain an expanded data set.
Optionally, the cleaning module specifically includes:
the classification unit is used for traversing the original test case data in sequence and classifying the original test case data to obtain the data types of the original test case data, wherein the data types comprise: numerical, categorical and temporal;
and the cleaning unit is used for cleaning the original test case data by adopting a corresponding preset cleaning algorithm according to the data type of the original test case data to obtain the test case data.
Optionally, the cleaning unit is specifically configured to:
judging whether the data type of the original test case data is numerical;
if the data type of the original test case data is a numerical type, processing the original test case data by adopting a normalization algorithm, and if the data type of the original test case data is a non-numerical type, judging whether the data type of the original test case data is a category type;
If the data type of the original test case data is of a category type, processing the original test case data by adopting a discretization algorithm, and if the data type of the original test case data is of a non-category type, judging whether the data type of the original test case data is of a time type;
and if the data type of the original test case data is time type, adopting a time division method to process the original test case data, and if not, not processing.
Optionally, the intelligent test device method further includes:
the second judging module is used for judging whether the cleaned original test case data has a missing value or not;
and the interpolation module is used for interpolating the missing value by adopting a K nearest neighbor algorithm if the cleaned original test case data has the missing value.
Optionally, the intelligent test device method further includes:
the second processing module is used for processing the test case data through the long-term and short-term memory network to obtain a first test case;
the third judging module is used for judging whether the number of the first test cases is smaller than the required number of the current test scenes on the number of the test cases or not;
The third expansion module is used for expanding the first test cases through an exhaustion method to obtain a second test case set if the number of the first test cases is smaller than the required number of the current test scenes on the number of the test cases;
and the fourth expansion module is used for acquiring the test cases in the second test case set through a random algorithm, extracting keywords in the test cases, expanding the test cases according to the keywords, and obtaining the test cases to be executed.
Optionally, the intelligent test method further includes:
the detection module is used for detecting codes of the test case data through a pre-built junit unit test frame to obtain the code coverage rate of the test case data;
a fourth judging module, configured to judge whether the code coverage rate of the test case data is less than a preset coverage rate;
and the second training module is used for continuing training the test case data according to the algorithm set of the preset calculation path if the code coverage rate of the test case data is smaller than the preset coverage rate until the code coverage rate of the output test case data is larger than or equal to the preset coverage rate.
Further, to achieve the above object, the present invention also provides an intelligent test apparatus, which includes a memory, a processor, and an intelligent test program stored on the memory and executable on the processor, the intelligent test program implementing the steps of the intelligent test method as set forth in any one of the above when executed by the processor.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an intelligent test program which, when executed by a processor, implements the steps of the intelligent test method as set forth in any one of the above.
According to the invention, a large number of test cases can be generated according to an exhaustion method through the test case model, so that the method can adapt to various test scenes, in addition, a random algorithm is adopted to analyze the acquired test cases so as to adapt to more actual scenes, and the accuracy of the test is increased. In addition, the coverage rate of the test cases is limited, the coverage rate is detected after the test cases are generated through the test case model each time, the newly generated test cases can completely cover the original test cases through the detection of the coverage rate, the accuracy of the test case generation of the test case model can be continuously optimized according to the coverage rate of the test cases, and the technical problems of low coverage rate and low test quality of the test cases are solved.
Drawings
FIG. 1 is a schematic structural diagram of an intelligent test equipment operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart of a first embodiment of the intelligent test method of the present invention;
FIG. 3 is a schematic diagram of a refinement flow chart of step S30 in FIG. 2;
fig. 4 is a schematic diagram of a refinement flow of step S10 in fig. 2:
FIG. 5 is a schematic diagram of a refinement flow chart of step S102 in FIG. 4;
FIG. 6 is a flow chart of a second embodiment of the intelligent test method of the present invention;
FIG. 7 is a flow chart of a third embodiment of the intelligent test method of the present invention;
FIG. 8 is a flow chart of a fourth embodiment of the intelligent test method of the present invention;
FIG. 9 is a schematic diagram of functional modules of an embodiment of the intelligent test apparatus of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides intelligent test equipment.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an operating environment of an intelligent test device according to an embodiment of the present invention.
As shown in fig. 1, the intelligent test apparatus includes: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware configuration of the intelligent test apparatus shown in fig. 1 does not constitute a limitation of the intelligent test apparatus, and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an intelligent test program may be included in a memory 1005, which is a computer-readable storage medium. The operating system is a program for managing and controlling intelligent test equipment and software resources, and supports the operation of the intelligent test program and other software and/or programs.
In the hardware architecture of the intelligent test apparatus shown in fig. 1, the network interface 1004 is mainly used for accessing a network; the user interface 1003 is mainly used for detecting confirmation instructions, editing instructions, and the like. And the processor 1001 may be used to call the smart test program stored in the memory 1005 and perform the operations of the following embodiments of the smart test method.
Based on the hardware structure of the intelligent test equipment, various embodiments of the intelligent test method are provided.
Referring to fig. 2, fig. 2 is a flow chart of an embodiment of the intelligent test method of the present invention. In this embodiment, the intelligent test method includes the following steps:
Step S10, traversing the original test case data in sequence, and adopting a corresponding preset cleaning algorithm to clean the original test case data to obtain test case data;
in this embodiment, the original test case data is traversed sequentially, and a corresponding preset cleaning algorithm is adopted to clean the original test case data to obtain the test case data, where in order to reduce interference of the invalid original test case data on the test result, the data needs to be cleaned before the original test case is input into the test case training algorithm. The manner of cleaning is not limited, e.g., cleaning is performed according to preset rules, e.g., providing for cleaning off test cases with spaces in a set of test cases. Data cleansing refers to the last procedure to find and correct identifiable errors in a data file, including checking for data consistency, processing invalid and missing values, etc.
Before this, the original test case data needs to be collected, and the manner of collecting the original test case data is not limited, and the collection may be performed through a preset API interface.
Step S20, training an initial candidate algorithm of a preset calculation path sequentially through the test case data to obtain a candidate algorithm, where the candidate algorithm at least includes: algorithms of long-term and short-term memory networks, exhaustion methods and random algorithms;
In this embodiment, a test case model is constructed based on the deep learning framework tensorflow. tensorflow is a framework for representing some type of computational abstraction (called a computational graph). Various algorithms can be preset in the calculation graph, and the calculation graph is a template of the executed calculation and lists the steps of the algorithm. In order to use the calculation map, a session is set, and the calculation result is output only after the session is started.
In the training algorithm process, a tensorflow gradient descent algorithm and a counter-propagation algorithm are mainly used. The specific process is as follows:
the gradient descent algorithm is formulated as: θ 1 =θ 0 - α J (θ), where J is a function of θ, θ 0 Representing the current position, θ 1 Representing the next step position, α is referred to as the learning rate or step size in the gradient descent algorithm, and v represents the direction in which the gradient descends fastest. The whole of this formula means that the input data is θ at the current position 0 Through one or more steps (iterations) to the next position theta 1 . For example, the case is input into a test case training algorithm: "input account number ABC, password: 123, login success ", i.e. the current position θ in the formula 0 The method comprises the steps of carrying out a first treatment on the surface of the During the second training, inputting an account abc and a password into a test case training algorithm: 123, successful login "," input account ABD, password: 123, login failure ", wherein the password is" input account abc: 123, the successful login "can be known that a new test case, namely the learning rate α in the formula, can be obtained through one training, and the account abc and the password are input: 123, successful login is the next position θ in the formula 1 The "input account abc" refers to the direction of the fastest gradient descent ∈, "the" input account ABD "causes a login failure, which indicates that the" input account ABD "is the opposite direction of the fastest gradient descent, and in this embodiment, the purpose of training the test case training algorithm is to let the test case training algorithm learn the direction of the fastest gradient descent ∈. The test case training algorithm learns under what conditions the login was successful and outputs test cases that were successful. In this embodiment, the input account ABC and the password are mainly input: 123, successful login ", finally find" input account ABC, password: 123, successful login "," input account abc, password: 123, successful login "," input account abc, password: 12, 3, successful login.
However, when training the test case training algorithm, the step length needs to be adjusted multiple times to obtain the password according to the input account ABC: 123, successfully login "find" input account abc, password: 123, login was successful ", a back propagation algorithm is therefore required in this embodiment.
When the gradient descent algorithm is used, the data of the test case is firstly input into the input layer, then is processed by the hidden layer, and finally is output at the output layer, for example, after the test case is output by the output layer, the user can refer to a preset rule, that is, whether space appears between the account and the password or not, whether the space appears between the account and the password is in a capitalization form or not can log in successfully. If the output result is "input account ABD, password: 123, the successful login "is not in accordance with the preset rule, because in this test case, the account number is wrong, so that it can be determined that an error occurs in the node of the hidden layer. Then the node of the hidden layer can be found out for this error and the weight of the node with the error can be adjusted according to the back propagation algorithm. For example, the hidden layer currently has two nodes c and d, and the node c passes through the input account ABC and password: 123, successfully logging in, and finding out an input account ABD and a password according to a gradient descent algorithm: 123, successful login, "d node finds" input account abc, password: 123, successful login ", according to the preset rule that the weight occupied by the node c is 60, the weight occupied by the node d is 40, and when outputting, outputting the result of the node with large weight occupied ratio, namely after the normalization algorithm processing, outputting an input account ABD and a password: 123, login is successful ", but the account is found to be wrong according to the preset rule, so that the preset rule is not met, a backward propagation algorithm is called, and the weights occupied by the node c and the node d are adjusted until the output result meets the preset rule.
In order for the test case training algorithm to learn as much data as possible for various test cases in different scenarios, a large number of multi-dimensional raw test cases need to be collected, alternatively these raw test case sets may contain interface test data: calling an interface: A. b, C, D, E and returning results A-a, B-B, C-C, D-D and E-E, namely, each interface return value is a combination form of an interface name and a lower case of the interface name, training the test case model according to the rule, and when F is input, returning the result to be F-F, thus the test case model can be considered to be successfully trained.
In addition, the system log data, the system state data, the link information data, the network information data and the error reporting system data can be used as original test case data to train the test case training algorithm.
Step S30, randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set;
in this embodiment, a random algorithm is adopted to analyze the test case data, and analysis rules for keywords, numbers and character strings can be preset; the parsing rule includes: presetting keywords, numbers and character strings to be analyzed; the method for analyzing the keywords, the numbers and the character strings is preset.
For example, for the test case: "upon dialog input 18, call the 18 # interface", "upon dialog input 19, call interface No. 19"......the test case of "call interface No. 30 when dialog box is entered 30", however, since these test cases cannot be fully tested if the interfaces in the actual scenario can be invoked normally, a random algorithm is added in this embodiment, first the numbers in the first and last test cases in the test cases are parsed, therefore, "18", "call" and "30" can be obtained, and then "18" can be resolved into "17" and "18" and "30" can be resolved into "31" and "30" according to the random algorithm, so that "call number 17 interface when the dialog box is input 17" and "call number 31 interface when the dialog box is input 31" are added on the basis of the original test case, and the test is more comprehensive.
"18" and "30" are boundary values for the entire test case set, and with two boundary values, it can be checked whether the interface can be invoked normally after exceeding the two boundary values.
Step S40, processing the expansion data set through a long-term and short-term memory network to obtain a test case set to be executed;
In this embodiment, the long-term memory network is pre-trained, and the long-term memory network can process the analysis test case data, and then obtain the test case to be executed, and the training process of the long-term memory network is as follows: for example, the test case resolution data is: 123. the long-short term memory network can obtain test cases of 'input password 123, successful login', 'input password 123, failed login' according to the initial weight. It should be noted that, the two test cases are not the finally output test cases to be executed, according to the manual test result, the "input password 123 and login success" are known, this case meets the current actual requirement, therefore, in this embodiment, a normalization algorithm is also adopted, the analysis test case data is processed through the normalization algorithm, so as to obtain the "input password 123, the probability of login success" is 20%, the probability of the "input password 123 and login failure" is 80%, according to the manual test result, the test cases of the "input password 123 and login success" are required, but the probability of the "input password 123 and login success" is smaller than the probability of the "input password 123 and login failure", so that the test cases of the "input password 123 and login failure" are required to be output, and in order to output the correct test cases, the weights occupied by the "input password 123, login success" and "input password 123 and login failure" are also required to be adjusted through a back propagation algorithm until the output result is the "input password 123 and login success".
Step S50, judging whether the number of the test cases in the to-be-executed test case set is smaller than the number of the test cases required by the current test scene;
in this embodiment, the number of test cases required in the current test scenario refers to that different test cases are tested when testing, and if some important test cases are omitted, the test result will be inaccurate. For example, a four-digit code, and all of which consist of digits, has a total of 10000 combinations, i.e. at most 9999 attempts are required to find the true code. If the scenario task in this example is made into test cases, at least 9999 test cases are required, and if there are only 9998 test cases, it is possible to miss important test cases, thereby affecting the test case execution results.
Step S60, expanding the to-be-executed test cases through an exhaustion method until the number of to-be-executed test cases is greater than or equal to the number of test cases required by the current test scene if the number of to-be-executed test cases is less than the number of test cases required by the current test scene, and not processing if the number of to-be-executed test cases is greater than or equal to the number of test cases required by the current test scene;
In this embodiment, the exhaustion method is used to develop test cases meeting the scene requirement according to the current scene, for example, a password that is four bits and is composed of numbers, if it passes through the manual work, 10000 test cases need to be made, if it passes through the exhaustion method, 10000 permutation and combination can be output one by one, and according to a large number of test cases, the number of test cases to be executed can be larger than the number of test cases required by the current test scene. In this embodiment, if the number of to-be-executed test cases is smaller than the number of test cases required by the current test scenario, expanding the to-be-executed test cases through an exhaustion method until the number of to-be-executed test cases is greater than or equal to the number of test cases required by the current test scenario, and if not, not processing.
Step S70, sequentially executing the test cases in the to-be-executed test case set to obtain a test result.
In this embodiment, since various test cases in the current scenario have been exhausted through the exhaustion method, the test cases in the set of test cases to be executed may be sequentially executed in turn, so as to obtain a test result, and thus some important test cases may not be omitted.
As is clear from step S30, the input "at dialog input 19", the test case model generates a test case of "call No. 17 interface when dialog input 17", "call No. 18 interface when dialog input 18", "call No. 19 interface when dialog input 19". The term "call No. 30 interface when dialog input 30", "call No. 31 interface when dialog input 31". In this embodiment, it is necessary to execute these test cases, that is, to check whether the interface No. 17 can be invoked when the dialog box is input 17, and whether the interface No. 18 can be invoked when the dialog box is input 18. And outputs a test result, for example, when the dialog box is input 17, the interface No. 17 cannot be called, when the dialog box is input 18, the interface No. 18 can be called.
Referring to fig. 3, fig. 3 is a schematic diagram of a refinement flow of step S30 in fig. 2. In this embodiment, the step S30 specifically includes the following steps:
step S301, randomly acquiring test case data through a random algorithm;
in this embodiment, a random algorithm is adopted to analyze the test case data, and analysis rules for keywords, numbers and character strings can be preset; the parsing rule includes: presetting keywords, numbers and character strings to be analyzed; the method for analyzing the keywords, the numbers and the character strings is preset.
For example, for the test case: "upon dialog input 18, call the 18 # interface", "upon dialog input 19, call interface No. 19"......the test case of "call interface No. 30 when dialog box is entered 30", however, since these test cases cannot be fully tested if the interfaces in the actual scenario can be invoked normally, a random algorithm is added in this embodiment, first the numbers in the first and last test cases in the test cases are parsed, therefore, "18", "call" and "30" can be obtained, and then "18" can be resolved into "17" and "18" and "30" can be resolved into "31" and "30" according to the random algorithm, so that "call number 17 interface when the dialog box is input 17" and "call number 31 interface when the dialog box is input 31" are added on the basis of the original test case, and the test is more comprehensive.
"18" and "30" are boundary values for the entire test case set, and with two boundary values, it can be checked whether the interface can be invoked normally after exceeding the two boundary values.
Step S302, extracting keywords in the test case data through word frequency and reverse word frequency algorithms to obtain first keywords;
In this embodiment, the weight of each word is calculated by using a word frequency and reverse word frequency algorithm, and the value obtained by calculating the word frequency and reverse word frequency algorithm is normalized. For example, three weights may be obtained for "enter password 1234," which is w 1 The code is w 2 "1234" is w 3 If after normalization, w 1 If the weight of the test case is the largest, other words related to the test case are searched from the keyword word stock according to the input, such as output, so that a new test case output password 1234 can be expanded, and expanded data is obtained.
Step S303, matching the first keywords with preset keywords in a preset keyword lexicon through a hash algorithm to obtain second keywords, and replacing the first keywords to obtain an expanded data set.
In this embodiment, each preset keyword in the preset keyword lexicon has a different first weight, and when the first keyword is calculated by the hash algorithm, a weight, that is, a second weight, is also obtained, and according to the second weight, the first weight matched with the weight is found from the preset keyword lexicon, and the keyword corresponding to the first weight is extracted, and the first keyword in the test case data is replaced.
Referring to fig. 4, fig. 4 is a schematic diagram of a refinement flow of step S10 in fig. 2. In this embodiment, the step S10 specifically includes the following steps:
step S101, traversing the original test case data in turn, and classifying the original test case data to obtain data types of the original test case data, where the data types include: numerical, categorical and temporal;
in this embodiment, the original test cases are sequentially traversed to obtain data types of the original test case data, where the data types include: in the present embodiment, the method of distinguishing between the numeric type, the category type and the time type is not limited, for example, marking a if the numeric type data is traversed, marking B if the category type data is traversed, and marking C if the time category data is traversed. For example, 17 or 18 belongs to numerical data; byte, short, int, long, float, double, boolean, char belongs to category data, and one year and one hour belong to time category data.
Step S102, cleaning the original test case data by adopting a corresponding preset cleaning algorithm according to the data type of the original test case data to obtain the test case data.
In this embodiment, since different raw test case data has different types, for example, the data types of the raw test case data include: numerical value type, category type and time type, and different types of original test case data need to be cleaned by different methods, so that according to the data type of the original test case data, a corresponding preset cleaning algorithm is adopted to clean the original test case data to obtain test case data, and the cleaning method comprises the following steps: normalization algorithms, discretization algorithms, and time division methods.
Referring to fig. 5, fig. 5 is a schematic diagram of a refinement flow of step S102 in fig. 4. In this embodiment, the step S102 specifically includes the following steps:
step S1021, judging whether the data type of the original test case data is a numerical type;
in this embodiment, in order to accurately clean the numerical data in the original test case data, therefore, the cleaning operation is required, and before cleaning, it is required to determine whether the data type of the original test case data is numerical. So as to process the data with different classifications by adopting different processing modes.
Step S1022, if the data type of the original test case data is a numerical type, processing the original test case data by adopting a normalization algorithm;
In this embodiment, if the data type of the original test case data is a numerical type, a normalization algorithm is used to process the original test case data, so that the cleaning operation is required to accurately clean the type data in the original test case data, and before cleaning, it is required to determine whether the data type of the original test case data is a type. So as to process the data with different classifications by adopting different processing modes. For example, normalization processing is performed on the numerical data, discretization processing is performed on the category data, and time division processing is performed on the time category data. For example, A {2,4, 6} is sequentially traversed over the original test case A and normalized to obtain A {4} which cleans out the data 2,6 and the remaining additional number 4.
Step S1023, if the data type of the original test case data is non-numerical, judging whether the data type of the original test case data is a category type;
in this embodiment, if the data type of the original test case data is non-numeric, it is determined whether the data type of the original test case data is of a category type.
Step S1024, if the data type of the original test case data is a category type, adopting a discretization algorithm to process the original test case data;
in this embodiment, in order to accurately clean the time-type data in the original test case data, therefore, the cleaning operation is required, and before cleaning, it is required to determine whether the data type of the original test case data is the time type. So as to process the data with different classifications by adopting different processing modes.
And if the data type of the original test case data is of a type, processing the original test case data by adopting a discretization algorithm, and if the data type of the original test case data is of a non-type, judging whether the data type of the original test case data is of a time type. For a set of data a {1, 2..18 } and another set of data B {19, 20..30 }, a can be classified as "young", B as "middle-aged", e.g., there is currently a set of "young" data C {17, 18, 20}, and by employing a discretization process, the value 20 can be washed from C to obtain C {17, 18}.
Step S1025, if the data type of the original test case data is a non-type, judging whether the data type of the original test case data is a time type;
In this embodiment, if the data type of the original test case data is non-type, it is determined whether the data type of the original test case data is time type.
In step S1026, if the data type of the original test case data is time-type, the time division method is used to process the original test case data, and if the data type of the original test case data is non-time-type, the processing is not performed.
In this embodiment, if the data type of the original test case data is time-type, the time division method is adopted to process the original test case data, and if not, the original test case data is not processed. When the normal working day cannot meet the working requirement, production activities can be carried out according to three shifts of early, middle and late, for example, 6:00-10:00 is early shift, 11:00-14:00 is middle shift, 14:00-18:00 is late shift, and 10:00-11:00 is rest time, so that time which does not accord with an actual scene can be washed according to a time division method.
Referring to fig. 6, fig. 6 is a flowchart illustrating a second embodiment of the intelligent test method according to the present invention. In this embodiment, after step S10 in fig. 2, the following steps are further included:
step S80, judging whether the cleaned original test case data has a missing value or not;
In this embodiment, during the cleaning process, there is a possibility that data conforming to the actual scene is cleaned, so it is necessary to determine in time whether there is a missing value in the original test case after cleaning, and if there is a missing value, it is necessary to use a certain processing method to process. It is therefore necessary to determine whether the cleaned raw test case data has missing values.
And step S90, if the cleaned original test case data has a missing value, interpolating the missing value by adopting a K nearest neighbor algorithm, and if the cleaned original test case data does not have the missing value, not processing.
In this embodiment, the algorithm of the k-value nearest neighbor method is described as follows: input: training data set: t= { (x 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ) X, where x i ∈R n ,y i ∈{c 1 ,c 2 ,...,c k And test data x.
And (3) outputting: the class to which instance x belongs. Based on a given distance metric, finding the k samples nearest to x in the training set T, the neighborhood of x covering the k points is denoted N k (x) At N k (x) The class y of x is determined according to classification rules (such as majority voting):
the classification decision rule is typically a majority vote, i.e. the class of the test sample is determined by the majority class of k adjacent samples of the test sample. The majority voting rules are explained as follows: given test sample x, its nearest k training examples form set N k (x) The classification loss function is 0-1 loss. If cover N k (x) The category of the region is c j The classification error rate is:
the classification error rate is small, i.e. the experience risk is minimal, so majority voting is equivalent to experience risk minimization.
Thus, according to the above formula, the classification to which the missing value belongs in the original test case data can be voted, e.g., the original test cases are input 17, input 18. After washing, the input was changed to input 18. After the k-value nearest neighbor method is adopted, the missing test cases can be known to be data in the numerical data classification, so that the missing test cases can be filled in the numerical mode.
Referring to fig. 7, fig. 7 is a flowchart of a third embodiment of the intelligent test method according to the present invention. In this embodiment, before step S70 in fig. 2, the method further includes the following steps:
step S100, processing test case data through a long-term and short-term memory network to obtain a first test case;
in this embodiment, the order of processing the data by different algorithms may be changed by changing the preset calculation path, and after the test case data is processed by the long-short-term memory network, a first test case may be obtained. For example, the test case resolution data is: 123. the long-short term memory network can obtain test cases of 'input password 123, successful login', 'input password 123, failed login' according to the initial weight. It should be noted that, the two test cases are not the finally output test cases to be executed, according to the manual test result, the "input password 123 and login success" are known, and this case meets the current actual requirement, so in this embodiment, a normalization algorithm is further adopted, the analysis test case data is processed through the normalization algorithm, so as to obtain the "input password 123, the probability of login success" is 20%, the probability of the "input password 123 and login failure" is 80%, according to the manual test result, the test cases of the "input password 123 and login success" are correct, but the probability of the "input password 123 and login success" is smaller than the probability of the "input password 123 and login failure", so if the test cases of the "input password 123 and login failure" are to be output, the weights occupied by the "input password 123, login success" and "input password 123 and login failure" are also required to be adjusted through a back propagation algorithm until the output result is "input password 123 and login success".
Step S110, judging whether the number of the first test cases is smaller than the required number of the current test scenes on the number of the test cases or not;
in this embodiment, in order to ensure accuracy of the test result, so as to need as many test cases as possible, it is determined whether the number of the first test cases is smaller than the required number of the test cases in the current test scenario. For example, if the number of the first test cases is 8000, and is smaller than the number of the test cases required by the current test scene, the correct password may be omitted, thereby affecting the test result. The number of first test cases must therefore be greater than or equal to the number of test cases required by the current test scenario.
Step S120, if the number of the first test cases is smaller than the required number of the current test scenes to the number of the test cases, expanding the first test cases through an exhaustion method to obtain a second test case set, and if the number of the first test cases is greater than or equal to the required number of the current test scenes to the number of the test cases, not processing the first test cases;
In this embodiment, new test cases need to be expanded according to different test scenarios and an exhaustion method. For example, if the number type is digital, all the test cases combined by the numbers need to be listed according to the permutation and combination of the numbers, for example, for the number combination 123, six combinations may be respectively: 123, 132, 231, 213, 321, 312.
If the number of the first test cases is smaller than the required number of the current test scenes to the number of the test cases, expanding the first test cases through an exhaustion method to obtain a second test case set, and if not, not processing. The number of test cases is increased by the exhaustion method.
Step S130, obtaining the test cases in the second test case set through a random algorithm, extracting keywords in the test cases, expanding the test cases according to the keywords, and obtaining the test cases to be executed.
In this embodiment, a random algorithm is adopted to obtain test cases from the second test case set, and extracted keywords are extracted from the randomly obtained test cases, and the test cases are expanded according to the extracted keywords to obtain new test cases, however, since after expansion by an exhaustion method, the second test case set already contains all the test cases in the test scene, then one of the test cases is randomly obtained by the random algorithm, it is possible to develop a test case overlapping with the test case in the second test case set, in order to avoid this occurrence, a keyword word library is preset, and only when keywords in the randomly obtained test cases are matched with keywords in the keyword word library, the test case is expanded. Keywords stored in the keyword lexicon are not limited, and are, for example, numerals, letters, punctuation marks, and the like. With this embodiment, the number of test cases is increased again.
Referring to fig. 8, fig. 8 is a flowchart of a fourth embodiment of the intelligent test method according to the present invention. In this embodiment, after step S20 in fig. 2, the following steps are further included:
step S140, detecting codes of the test case data through a pre-constructed junit unit test framework to obtain code coverage rate of the test case data;
in this embodiment, the test case code coverage is obtained by a pre-built junit unit test framework. By detecting the scanned code by the junit unit test framework, it is possible to detect what the code coverage is, for example, 90%. The purpose of detecting coverage is to facilitate having the newly generated code of the test case effectively cover the code of the original test case. If the codes of the original test cases are not effectively covered, the condition that the number of the newly generated test cases is insufficient is indicated.
Step S150, judging whether the code coverage rate of the test case data is smaller than a preset coverage rate;
in this embodiment, the preset coverage rate refers to a value of a preset coverage rate, for example, 90% or 80%, and the purpose of the judgment is to check whether the current code coverage rate of the test case is smaller than the preset coverage rate, for example, if the current code coverage rate of the test case is smaller than the preset coverage rate, it indicates that the current code coverage rate does not reach the requirement, and if the current code coverage rate of the test case is greater than the preset coverage rate, it indicates that the current code coverage rate has reached the requirement.
Step S160, if the code coverage rate of the test case data is smaller than the preset coverage rate, training the test case data according to the algorithm set of the preset calculation path is continued until the code coverage rate of the output test case data is larger than or equal to the preset coverage rate, and if the code coverage rate of the test case data is larger than or equal to the preset coverage rate, the test case data is not processed.
In this embodiment, the coverage of the test case code can be counted and displayed by means of the junit unit test framework integrated in the java engineering, so that the coverage of the test case code can be obtained. The method for integrating the junit unit test framework is to import the jar packet of junit into the engineering Lib and then use the jar packet according to the agreement of the framework. The regression test has the effect of judging whether the original function is correct or not by testing the original function so as to judge that the online of the new function can not influence the original function. By using an artificial intelligence + heuristic test solution framework, i.e., a test case model, the problem of regression test coverage can be solved after automatically executing the cases because the test case model has automatically generated a large number of test cases that cover all of the original functional tests. It should be noted that in a practical scenario, there may be a case where the test cases generated according to the preset conditions cannot completely cover the original test cases, for example, the code complexity of the test case 1 is too high, so that only 2, 3, and 4 can be generated through the exhaustion method. It follows that in some cases there may be cases where complete coverage is not possible, and therefore coverage needs to be set in advance. For example, it may be set that the coverage is not less than 90%, and if it is less than 90%, training the test case model is continued until the new test case generated completely covers the original test case; if the test case is higher than 90%, the newly generated test case completely covers the original test case, so that the functions of the original test case are not affected.
In the prior art, the regression test is required to be completely covered, which is difficult because the original functions are very many and have a large number of functional scenes, and the complete regression test is impossible under the condition of limited time and manpower, and only the main original functions can be selected for testing. Artificial intelligence testing has now been presented to enable complete regression testing coverage. For example, a test case is 1, 2, 3, and a test case 0, 1, 2, 3, 4 is generated after the test case model is input, so that the newly generated test case completely covers the original test case, and therefore the original test case is not affected.
The invention further provides an intelligent testing device.
Referring to fig. 9, fig. 9 is a schematic diagram of functional modules of an embodiment of the intelligent testing apparatus according to the present invention. In this embodiment, the intelligent test apparatus includes:
the cleaning module 10 is configured to sequentially traverse the original test case data, and clean the original test case data by adopting a corresponding preset cleaning algorithm to obtain test case data;
the first training module 20 is configured to train the initial candidate algorithm of the preset calculation path sequentially through the test case data, so as to obtain a candidate algorithm;
The first expansion module 30 is configured to randomly acquire test case data through a random algorithm, extract keywords in the test case data, and expand the test case data according to the keywords to obtain an expanded data set;
a first processing module 40, configured to process the extended data set through a long-short term memory network to obtain a to-be-executed test case set;
a first judging module 50, configured to judge whether the number of test cases in the set of test cases to be executed is smaller than the number of test cases required by the current test scenario;
the second expansion module 60 is configured to expand the to-be-executed test cases by an exhaustion method if the number of to-be-executed test cases is smaller than the number of test cases required by the current test scenario, until the number of to-be-executed test cases is greater than or equal to the number of test cases required by the current test scenario;
and the execution module 70 is configured to sequentially execute the test cases in the set of test cases to be executed, so as to obtain a test result.
In this embodiment, the cleaning module 10 is configured to sequentially traverse the original test case data, and clean the original test case data by adopting a corresponding preset cleaning algorithm to obtain test case data; the first training module 20 is configured to train the initial candidate algorithm of the preset calculation path sequentially through the test case data, so as to obtain a candidate algorithm; the first expansion module 30 is configured to randomly acquire test case data through a random algorithm, extract keywords in the test case data, and expand the test case data according to the keywords to obtain an expanded data set; the first processing module 40 is configured to process the extended data set through a long-short-term memory network to obtain a to-be-executed test case set; the first judging module 50 is configured to judge whether the number of test cases in the set of test cases to be executed is smaller than the number of test cases required by the current test scenario; the second expansion module 60 is configured to expand the to-be-executed test cases by an exhaustion method if the number of to-be-executed test cases is smaller than the number of test cases required by the current test scenario, until the number of to-be-executed test cases is greater than or equal to the number of test cases required by the current test scenario; the execution module 70 is configured to sequentially execute the test cases in the set of test cases to be executed, so as to obtain a test result. The scheme increases the number of test cases through an exhaustion method and a random algorithm, and solves the technical problem of low test quality.
The invention also provides a computer readable storage medium.
In this embodiment, the computer readable storage medium stores a smart test program, which when executed by a processor, implements the steps of the smart test method described in any one of the embodiments above.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM), comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server or a network device, etc.) to perform the method according to the embodiments of the present invention.
While the embodiments of the present invention have been described above with reference to the drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many modifications may be made thereto by those of ordinary skill in the art without departing from the spirit of the present invention and the scope of the appended claims, which are to be accorded the full scope of the present invention as defined by the following description and drawings, or by any equivalent structures or equivalent flow changes, or by direct or indirect application to other relevant technical fields.
Claims (8)
1. An intelligent test method is characterized by comprising the following steps:
traversing the original test case data in sequence, and adopting a corresponding preset cleaning algorithm to clean the original test case data to obtain test case data;
training an initial candidate algorithm of a preset calculation path sequentially through the test case data to obtain a candidate algorithm, wherein the candidate algorithm at least comprises: algorithms of long-term and short-term memory networks, exhaustion methods and random algorithms;
randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set;
the step of randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set comprises the following steps:
randomly acquiring test case data through a random algorithm;
extracting keywords in the test case data through word frequency and reverse word frequency algorithms to obtain first keywords;
matching the first keywords with preset keywords in a preset keyword lexicon through a hash algorithm to obtain second keywords, and replacing the first keywords to obtain an expanded data set;
Processing the expansion data set through a long-short-term memory network to obtain a test case set to be executed;
judging whether the number of the test cases in the to-be-executed test case set is smaller than the number of the test cases required by the current test scene;
if yes, expanding the to-be-executed test case set through an exhaustion method until the number of the test cases in the to-be-executed test case set is larger than or equal to the number of the test cases required by the current test scene;
sequentially executing the test cases in the test case set to be executed to obtain a test result;
detecting codes of the test case data through a pre-built junit unit test framework to obtain code coverage rate of the test case data;
judging whether the code coverage rate of the test case data is smaller than a preset coverage rate or not;
if yes, training the test case data according to the algorithm set of the preset calculation path until the code coverage rate of the output test case data is greater than or equal to the preset coverage rate.
2. The intelligent test method according to claim 1, wherein traversing the original test case data in turn cleans the original test case data using a corresponding preset cleaning algorithm, the obtaining the test case data comprising:
Traversing the original test case data in sequence, and classifying the original test case data to obtain the data types of the original test case data, wherein the data types comprise: numerical, categorical and temporal;
and cleaning the original test case data by adopting a corresponding preset cleaning algorithm according to the data type of the original test case data to obtain the test case data.
3. The intelligent test method according to claim 2, wherein the cleaning the original test case data by using a corresponding preset cleaning algorithm according to the data type of the original test case data, to obtain test case data includes:
judging whether the data type of the original test case data is numerical;
if the data type of the original test case data is a numerical type, processing the original test case data by adopting a normalization algorithm, and if the data type of the original test case data is a non-numerical type, judging whether the data type of the original test case data is a category type;
if the data type of the original test case data is of a category type, processing the original test case data by adopting a discretization algorithm, and if the data type of the original test case data is of a non-category type, judging whether the data type of the original test case data is of a time type;
And if the data type of the original test case data is time type, processing the original test case data by adopting a time division method.
4. The intelligent test method according to claim 1, wherein after the step of sequentially traversing the original test case data and cleaning the original test case data using a corresponding preset cleaning algorithm to obtain the test case data, further comprising:
judging whether the cleaned original test case data has a missing value or not;
if the missing value exists, the K nearest neighbor algorithm is adopted to interpolate the missing value.
5. The intelligent test method according to claim 1, further comprising, before the step of sequentially executing the test cases in the set of test cases to be executed to obtain test results:
processing the test case data through a long-term and short-term memory network to obtain a first test case;
judging whether the number of the first test cases is smaller than the required number of the current test scene on the number of the test cases or not;
if yes, expanding the first test case by an exhaustion method to obtain a second test case set;
and acquiring the test cases in the second test case set through a random algorithm, extracting keywords in the test cases, expanding the test cases according to the keywords, and obtaining the test cases to be executed.
6. An intelligent test apparatus, characterized in that the intelligent test apparatus comprises:
the cleaning module is used for traversing the original test case data in sequence, and cleaning the original test case data by adopting a corresponding preset cleaning algorithm to obtain test case data;
the first training module is used for training the initial candidate algorithm of the preset calculation path sequentially through the test case data to obtain a candidate algorithm;
the first expansion module is used for randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords and obtaining an expansion data set;
the step of randomly acquiring test case data through a random algorithm, extracting keywords in the test case data, expanding the test case data according to the keywords, and obtaining an expanded data set comprises the following steps:
randomly acquiring test case data through a random algorithm;
extracting keywords in the test case data through word frequency and reverse word frequency algorithms to obtain first keywords;
matching the first keywords with preset keywords in a preset keyword lexicon through a hash algorithm to obtain second keywords, and replacing the first keywords to obtain an expanded data set;
The first processing module is used for processing the expansion data set through a long-term and short-term memory network to obtain a test case set to be executed;
the first judging module is used for judging whether the number of the test cases in the to-be-executed test case set is smaller than the number of the test cases required by the current test scene;
the second expansion module is used for expanding the to-be-executed test cases through an exhaustion method if the number of to-be-executed test cases is smaller than the number of test cases required by the current test scene until the number of to-be-executed test cases is larger than or equal to the number of test cases required by the current test scene;
the execution module is used for sequentially executing the test cases in the test case set to be executed to obtain a test result;
the detection module is used for detecting codes of the test case data through a pre-built junit unit test frame to obtain the code coverage rate of the test case data;
a fourth judging module, configured to judge whether the code coverage rate of the test case data is less than a preset coverage rate;
and the second training module is used for continuing training the test case data according to the algorithm set of the preset calculation path if the code coverage rate of the test case data is smaller than the preset coverage rate until the code coverage rate of the output test case data is larger than or equal to the preset coverage rate.
7. A smart test device comprising a memory, a processor, and a smart test program stored on the memory and executable on the processor, the smart test program when executed by the processor implementing the steps of the smart test method of any one of claims 1-5.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a smart test program, which when executed by a processor, implements the steps of the smart test method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910667875.XA CN110502432B (en) | 2019-07-23 | 2019-07-23 | Intelligent test method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910667875.XA CN110502432B (en) | 2019-07-23 | 2019-07-23 | Intelligent test method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110502432A CN110502432A (en) | 2019-11-26 |
CN110502432B true CN110502432B (en) | 2023-11-28 |
Family
ID=68587619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910667875.XA Active CN110502432B (en) | 2019-07-23 | 2019-07-23 | Intelligent test method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110502432B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111597121B (en) * | 2020-07-24 | 2021-04-27 | 四川新网银行股份有限公司 | Precise test method based on historical test case mining |
CN113312258B (en) * | 2021-05-25 | 2024-09-27 | 平安壹钱包电子商务有限公司 | Interface testing method, device, equipment and storage medium |
CN113342683B (en) * | 2021-06-29 | 2024-04-09 | 深圳前海微众银行股份有限公司 | Test case processing method, device, platform and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101853202A (en) * | 2010-05-28 | 2010-10-06 | 浙江大学 | A Method for Automatically Generating Test Cases Based on Genetic Algorithm and Weighted Matching Algorithm |
CN105988920A (en) * | 2015-02-04 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Test case generating method and device based on data sets |
CN107886366A (en) * | 2017-11-22 | 2018-04-06 | 深圳市金立通信设备有限公司 | Generation method, sex fill method, terminal and the storage medium of Gender Classification model |
CN108170529A (en) * | 2017-12-26 | 2018-06-15 | 北京工业大学 | A kind of cloud data center load predicting method based on shot and long term memory network |
CN108768946A (en) * | 2018-04-27 | 2018-11-06 | 中山大学 | A kind of Internet Intrusion Detection Model based on random forests algorithm |
CN109379329A (en) * | 2018-09-05 | 2019-02-22 | 中国人民解放军战略支援部队信息工程大学 | LSTM-based network security protocol fuzzing method and system |
CN109389030A (en) * | 2018-08-23 | 2019-02-26 | 平安科技(深圳)有限公司 | Facial feature points detection method, apparatus, computer equipment and storage medium |
CN109947756A (en) * | 2019-03-18 | 2019-06-28 | 成都好享你网络科技有限公司 | Data cleaning method, device and equipment for Augmented Data |
-
2019
- 2019-07-23 CN CN201910667875.XA patent/CN110502432B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101853202A (en) * | 2010-05-28 | 2010-10-06 | 浙江大学 | A Method for Automatically Generating Test Cases Based on Genetic Algorithm and Weighted Matching Algorithm |
CN105988920A (en) * | 2015-02-04 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Test case generating method and device based on data sets |
CN107886366A (en) * | 2017-11-22 | 2018-04-06 | 深圳市金立通信设备有限公司 | Generation method, sex fill method, terminal and the storage medium of Gender Classification model |
CN108170529A (en) * | 2017-12-26 | 2018-06-15 | 北京工业大学 | A kind of cloud data center load predicting method based on shot and long term memory network |
CN108768946A (en) * | 2018-04-27 | 2018-11-06 | 中山大学 | A kind of Internet Intrusion Detection Model based on random forests algorithm |
CN109389030A (en) * | 2018-08-23 | 2019-02-26 | 平安科技(深圳)有限公司 | Facial feature points detection method, apparatus, computer equipment and storage medium |
CN109379329A (en) * | 2018-09-05 | 2019-02-22 | 中国人民解放军战略支援部队信息工程大学 | LSTM-based network security protocol fuzzing method and system |
CN109947756A (en) * | 2019-03-18 | 2019-06-28 | 成都好享你网络科技有限公司 | Data cleaning method, device and equipment for Augmented Data |
Also Published As
Publication number | Publication date |
---|---|
CN110502432A (en) | 2019-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019184557A1 (en) | Method and device for locating root cause alarm, and computer-readable storage medium | |
US10068176B2 (en) | Defect prediction method and apparatus | |
CN110502432B (en) | Intelligent test method, device, equipment and readable storage medium | |
CN111294819B (en) | A network optimization method and device | |
US20180075038A1 (en) | Anomaly detection by multi-level tolerance relations | |
US20180137150A1 (en) | Automatic entity resolution with rules detection and generation system | |
WO2011162841A1 (en) | Password checking | |
CN110889526B (en) | A method and system for predicting user upgrade complaint behavior | |
US20170206458A1 (en) | Computer-readable recording medium, detection method, and detection apparatus | |
CN109948122A (en) | Error correction method and device for input text and electronic equipment | |
KR102425525B1 (en) | System and method for log anomaly detection using bayesian probability and closed pattern mining method and computer program for the same | |
CN112416800A (en) | Intelligent contract testing method, device, equipment and storage medium | |
CN118353797A (en) | Network traffic prediction method, device, electronic device and storage medium | |
CN116482713A (en) | Navigation data verification method for Beidou navigation receiver | |
US12047247B2 (en) | Network data analysis method, network data analysis functional network element and communication system | |
KR102470364B1 (en) | A method for generating security event traning data and an apparatus for generating security event traning data | |
CN108933691B (en) | A method and computing device for obtaining a standard configuration template of a network device | |
CN113360300A (en) | Interface calling link generation method, device, equipment and readable storage medium | |
CN118170606A (en) | Log data detection method and device, electronic equipment and storage medium | |
US20230306343A1 (en) | Business process management system and method thereof | |
CN118804140A (en) | Network optimization method and device, electronic device and storage medium | |
JPWO2018203510A1 (en) | Question estimator | |
Venkataraman et al. | Towards identifying impacted users in cellular services | |
CN115829136A (en) | Optimization method, device and network equipment for a water quality prediction model | |
CN115437953A (en) | Test data generation method and device |
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 |