Nothing Special   »   [go: up one dir, main page]

CN108334439B - Pressure testing method, device, equipment and storage medium - Google Patents

Pressure testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN108334439B
CN108334439B CN201810209538.1A CN201810209538A CN108334439B CN 108334439 B CN108334439 B CN 108334439B CN 201810209538 A CN201810209538 A CN 201810209538A CN 108334439 B CN108334439 B CN 108334439B
Authority
CN
China
Prior art keywords
page
sequence number
target
test
dimension
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810209538.1A
Other languages
Chinese (zh)
Other versions
CN108334439A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810209538.1A priority Critical patent/CN108334439B/en
Publication of CN108334439A publication Critical patent/CN108334439A/en
Application granted granted Critical
Publication of CN108334439B publication Critical patent/CN108334439B/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/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3447Performance evaluation by modeling
    • 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/3676Test management for coverage analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a pressure testing method, a pressure testing device, pressure testing equipment and a storage medium. The method comprises the following steps: generating a current state vector according to the page sequence number where the current test step is executed; taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance; and determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped. The embodiment of the invention can realize higher test coverage rate by shorter execution steps, and has strong expansibility, high stability, low use cost and strong universality.

Description

Pressure testing method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a pressure testing method, a pressure testing device, pressure testing equipment and a storage medium.
Background
With the development of science and technology, more and more application software is available on mobile devices, and when a program associated with a clicked operation control area has a problem in the use process of a user, the application software will be in a flash back or dead halt due to program errors. In order to ensure the stability of the application software in the using process, it is necessary to perform stress test on the application software.
At present, the pressure test has two schemes, one is a scheme of completely randomizing the operation control, and the other is a scheme of randomizing based on some manually defined weight or rule, for example, a higher weight is given to a certain control to ensure that the control is operated more probably in the execution process of the pressure test.
Both of these prior art solutions have drawbacks. In the first scheme, the stability of the effect is poor due to the fact that the strategy is over-randomized, namely the test coverage rate of the best case and the test coverage rate of the worst case are greatly different; in addition, the maximum coverage rate achieved by this scheme is also relatively low. In the second scheme, the effect of manual rule configuration depends greatly on test experience, the cost of hands is high, and a special worker is needed to realize operation; due to the iteration of the test object, the maintenance cost of the rule is very large; different test objects (such as mobile phone apps) need to be configured with completely different rules, and the universality and expansibility of the scheme are poor.
Disclosure of Invention
The embodiment of the invention provides a pressure testing method, a pressure testing device, equipment and a storage medium, which can realize higher testing coverage rate by shorter execution steps and have the advantages of strong expansibility, high stability, low use cost and strong universality.
In a first aspect, an embodiment of the present invention provides a pressure testing method, including:
generating a current state vector according to the page sequence number where the current test step is executed;
taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
and determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped.
In a second aspect, an embodiment of the present invention further provides a pressure testing apparatus, where the apparatus includes:
the state vector module is used for generating a current state vector according to the page sequence number where the current test step is executed;
the target page sequence number module is used for taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped, which is predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
and the target control serial number module is used for determining the serial number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the serial number of the target page to be jumped.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the stress testing method as described above.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the program, when executed by a processor, implements the pressure testing method as described above.
The embodiment of the invention trains a test path model based on a deep reinforcement learning basic model in advance, generates a current state vector according to a page sequence number where a current test step is executed, inputs the current state vector into the test path model to obtain a target page sequence number to be jumped, and can determine the target control sequence number to be tested according to a jump relation between a control and a page which is constructed in advance according to a historical test record and the target page sequence number to be jumped. The technical scheme provided by the embodiment of the invention applies the Deep Q Learning algorithm in the field of Deep reinforcement Learning to the pressure test, can realize higher test coverage rate by shorter execution steps, and has the advantages of strong expansibility, high stability, low use cost and strong universality.
Drawings
FIG. 1 is a flow chart of a pressure testing method according to a first embodiment of the present invention;
FIG. 2 is a diagram illustrating a deep enhanced learning base model according to a first embodiment of the present invention;
FIG. 3 is a flow chart of a pressure testing method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a pressure testing apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a pressure testing method according to a first embodiment of the present invention, where the present embodiment is applicable to a pressure testing situation, the method may be executed by a pressure testing apparatus, and the apparatus may be implemented in a software and/or hardware manner, for example, the apparatus may be configured in a device. The method specifically comprises the following steps:
s110, generating a current state vector according to the page sequence number where the current test step is executed.
The test is a pressure test, i.e., a Monkey test, which is a program that can run in a simulator or in actual equipment, and can send a random pseudo input event stream (e.g., gesture input, key input, touch screen input, etc.) to the system, so as to implement the pressure test, i.e., the stability test, on the application program. The stability test is a test for testing whether an application has stability under a plurality of long-time operations by operating the application through a plurality of (thousands of) long-time continuous operations.
In this embodiment, in the pressure test execution process, that is, in the pressure test process, the sequence number of the control operated in each execution step and the sequence number of the page where the control is located may be recorded. The sequence number of the page is the unique identifier of the page where the control is located, and the method may be to adopt an Xpath path of the control, that is, for each page, the Xpath of the previous preset numerical value components on the upper left of the page may be used as the sequence number of the page. The method is different according to different operating systems, for example, at an ios end, the sequence number of a page may be Xpath of the top-left 5 components; at the android end, the sequence number of the page may be the name attribute of the page plus Xpath of the top-left five components. The Xpath is a language for searching information in the XML document, and can navigate elements and attributes in the XML document by using a path expression, and the Xpath includes a standard function library.
Specifically, the page number where the current test step is executed, the page number traversed in the round of test, the control number operated in the current test step, the reward value of the current test step, and the page number jumped to after the current test step are used as samples corresponding to the current test step, and the current state vector can be calculated according to the samples. Wherein the dimension of the state vector may be equal to the total number of pages appearing in the sample, and the bonus value may be defined as: if the page which is not traversed is jumped to after the step is executed, the reward value is 1; otherwise it is 0.
In this embodiment, according to the target jump page sequence number of each sample, a target state vector of each sample and a filter vector of each sample may be generated, where the filter vector is a vector having the same dimension as the current state vector, the value of the filter vector in the dimension corresponding to the target jump page after the current testing step is 1, and all other dimensions are 0.
And S120, taking the current state vector as the input of a test path model to obtain the sequence number of the target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a depth-enhanced learning basic model in advance.
The test path model may be obtained by training based on a Deep Reinforcement Learning base model in advance, and Deep Reinforcement Learning (Deep Reinforcement Learning) is an algorithm that may combine Deep Learning and Reinforcement Learning to implement end-to-end Learning from Perception (Perception) to Action (Action), for example, as with a human, Perception information such as vision is input, and then Action is directly output through a Deep neural network without manual work in the middle. Reinforcement learning is trial and error learning, and because there is no direct guiding information, the agent needs to continuously interact with the environment, and obtains the optimal strategy in a trial and error manner, that is, the strategy (Policy) needs to be improved according to a series of samples, so that the feedback value (Reward) in the obtained samples is better.
Q-Learning is one of reinforcement Learning, the Q value table represents the current learned experience, the Q value calculated according to the formula is a score (target Q value) obtained by the agent through interaction with the environment and summary of own experience, and the training process can be regarded as a process of infinitely approximating the Q value to the target Q value. The Deep Q Learning algorithm is trained by replacing a Q value table with a neural network, so as to obtain an optimal strategy.
Fig. 2 is a schematic diagram of a deep reinforcement learning base model according to a first embodiment of the present invention, and as shown in fig. 2, the current state vector may be represented by input _ status; the filter vector (mask) is a vector with the same dimension as the input _ status, the value of the filter vector (mask) in the dimension corresponding to the target jump page after the current testing step is 1, and the other dimensions are 0; the vector inner product layer can be represented by dot _ product; the multi-layer Fully Connected neural Network (full Connected Network) can be represented by FC, the input layer and the output layer of the FC are both in the same dimension as input _ status, the number of hidden layers and the number of nodes need to be dynamically adjusted according to the total number of pages, and the parameters contained in the FC are parameters which need to be trained in this embodiment; the state vector after performing the current test step may be denoted as target _ status, i.e. the target state vector; the maximum value (max) represents the dimension for solving the maximum value in all dimensions in the output vector; the reward value for the current test step may be expressed in reward; the loss function can be represented by Cost; the result value corresponding to the current state vector can be represented by Predict; the target result value corresponding to the target state vector can be represented by a Label.
As shown in fig. 2, a random gradient descent method may be used to input a sample into the deep reinforcement learning base model, and each layer parameter of the FC may be obtained through training, where the specific process may be: taking a sample as an example, respectively taking input _ status and target _ status in the sample as input of an FC to obtain corresponding output vector 1 and output vector 2, performing dot product operation on the output vector 1 and a mask to obtain a Predict only retaining the dimension of a target jump page, solving the dimension (max) of the maximum value in all dimensions in the output vector 2, adding the dimension (max) and an incentive value of the current testing step to obtain a Label, and calculating the Predict and the Label according to a preset formula to obtain the Cost. And inputting a series of samples into the deep reinforcement learning base model for training to minimize a loss function, and obtaining the parameters of each layer of the FC at the moment to be used in the test path model. The random gradient descent method is characterized in that a sample is randomly selected from a training set for learning each time, so that model parameters are updated, and an optimal solution is obtained.
Specifically, when the control operation is required in the pressure test, a current state vector is obtained according to S110 and is used as an input of a test path model, that is, the current state vector is input into the FC trained in fig. 2, the output vector is a prediction result, the prediction result is an x-dimensional vector, where x is the total number of pages, the value of each dimension represents the recommended strength of the model for jumping to the page, and the page with the highest recommended strength is used as the sequence number of the target page to be jumped, which is predicted by the test path model.
In addition, in the process of training the test path model, the positive samples generated in S110 may be traversed and a proportional value may be set to generate negative samples, and the product of the number of positive samples and the proportional value is used as the number of negative samples. The format of the negative sample is the same as the sample, and the specific process may include: for any historical test step, determining a page which can be jumped to the page when the step is executed according to the historical test record; selecting one page from other pages except the page capable of being jumped as a target jumped page of the step; and taking the page serial number where the step is executed, the target jump page serial number of the page and the reward value of the step as negative samples corresponding to the testing step. The control operated in the negative sample does not exist, so the value of the operation control sequence number can be set to-1, and the practical significance is not realized. The significance of the negative sample generation is that the negative sample is input into the test path model for training, and the test path model is prevented from making a prediction result which cannot be executed actually.
S130, determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped.
The historical test record comprises the sequence number of the control operated in each execution step and the sequence number of the page where the control is located, and statistics is carried out according to the recorded data of the sequence number of the control operated in each execution step and the sequence number of the page where the control is located, and the jump relation between the control and the page is constructed.
Specifically, the sequence number of the target control to be tested may be determined according to the sequence number of the target page to be skipped predicted in S120 and the skip relationship between the control and the page that is constructed in advance.
In this embodiment, in the pressure test process to which the test path model is applied, data of each execution step is continuously acquired, the training steps are repeated according to a certain period, and the accuracy of the model can still be maintained under the condition that the application (such as a mobile phone app) of the terminal to be tested is continuously changed (such as upgrade iteration) through iterative training.
In this embodiment, a test path model is trained in advance based on a deep reinforcement learning base model, a current state vector is generated according to a page sequence number where a current test step is executed, the current state vector is input into the test path model, a target page sequence number to be skipped is obtained, and a target control sequence number to be tested can be determined according to a skip relationship between a control and a page, which is established in advance according to a historical test record, and the target page sequence number to be skipped. The technical scheme provided by the embodiment applies the Deep Q Learning algorithm in the field of Deep reinforcement Learning to the pressure test, can realize higher test coverage rate by shorter execution steps, and has strong expansibility, high stability, low use cost and strong universality.
Optionally, the generating the current state vector according to the page sequence number where the current testing step is executed may include: taking the total number of pages contained in each sample in the test path model as the dimension of the current state vector; for each dimension in the current state vector, if the page corresponding to the dimension is not traversed, the value of the dimension is a first numerical value; if the page corresponding to the dimension is traversed and is not the current page, the value of the dimension is a second numerical value; and if the page corresponding to the dimension is the current page, the value of the dimension is a third numerical value.
Example two
Fig. 3 is a flowchart of a pressure testing method according to a second embodiment of the invention. The present embodiment further optimizes the pressure testing method based on the above embodiments. Correspondingly, the method of this embodiment may specifically include:
and S210, taking the total number of pages contained in each sample in the test path model as the dimension of the current state vector.
The test path model can be obtained by training in advance based on a deep reinforcement learning basic model, and the deep reinforcement learning basic model is shown in fig. 2. The construction process of the sample can be as follows: and taking the page sequence number where the current testing step is executed, the page sequence number traversed in the round of testing, the control sequence number operated in the current testing step, the reward value of the current testing step and the sequence number of the page jumped to after the current testing step is executed as samples corresponding to the current testing step.
Specifically, the total number of pages included in each sample in the test path model is used as the dimension of the current state vector, that is, the current state vector has x dimensions, where x is the total number of pages appearing in the sample.
S220, aiming at each dimension in the current state vector, if the page corresponding to the dimension is not traversed, the value of the dimension is a first numerical value; if the page corresponding to the dimension is traversed and is not the current page, the value of the dimension is a second numerical value; and if the page corresponding to the dimension is the current page, the value of the dimension is a third numerical value.
Wherein the first value is preferably-1, the second value is preferably 0, and the third value is preferably 1.
Specifically, for each dimension in the current state vector, each dimension corresponds to one page, and if the page corresponding to the dimension is not traversed, the value of the dimension may be-1; if the page corresponding to the dimension has already been traversed and is not the current page, the value of the dimension may be 0; if the page corresponding to the dimension is the current page, the value of the dimension may be 1. That is, in the current state vector, there is only one page with dimension value of 1, and there may be multiple pages with dimension value of-1 or 0.
And S230, taking the current state vector as the input of a test path model to obtain the sequence number of the target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a depth-enhanced learning basic model in advance.
Specifically, when control operation is required in the pressure test, a current state vector can be obtained according to S210 and S220 and is used as an input of a test path model, that is, the current state vector is input into the FC trained in fig. 2, the output vector is a prediction result, the prediction result is an x-dimensional vector, where x is the total number of pages, the magnitude of the value of each dimension represents the recommendation intensity of the model for jumping to the page, and the page with the maximum recommendation intensity is used as the sequence number of the target page to be jumped predicted by the test path model.
In addition, in the process of training the test path model, a negative sample can be generated and input into the test path model, so that the test path model can be prevented from making a prediction result which cannot be executed actually.
S240, determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped.
Specifically, the sequence number of the target control to be tested may be determined according to the sequence number of the target page to be jumped predicted in S230 and a jump relationship between the control and the page that is constructed in advance.
In this embodiment, data of each execution step is continuously acquired in the pressure test process to which the test path model is applied, the training steps are repeated according to a certain period, and the accuracy of the model can be still maintained under the condition that the application (such as a mobile phone app) of the terminal to be tested is continuously changed (such as upgrade iteration) through iterative training.
In this embodiment, a test path model is trained in advance based on a deep reinforcement learning base model, a sample corresponding to a current test step is generated according to a page sequence number where the current test step is executed, so that a corresponding current state vector can be calculated and input into the test path model to obtain a target page sequence number to be skipped, and the target control sequence number to be tested can be determined according to a skip relationship between a pre-constructed control and a page and the target page sequence number to be skipped. According to the technical scheme provided by the embodiment, the sample and the negative sample are trained based on the deep reinforcement learning test path model respectively, so that prediction results which cannot be actually executed can be prevented from being made, an optimal test path is summarized, higher test coverage rate is realized by a shorter test path, and the method is strong in expansibility, high in stability, low in use cost and high in universality.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a pressure testing apparatus according to a third embodiment of the present invention, where the apparatus may include:
a state vector module 310, configured to generate a current state vector according to a page sequence number where the current test step is executed;
a target page sequence number module 320, configured to use the current state vector as an input of a test path model, to obtain a target page sequence number to be skipped, which is predicted by the test path model, where the test path model is obtained by training based on a deep reinforcement learning base model in advance;
the target control sequence number module 330 is configured to determine a target control sequence number to be tested according to a jump relationship between a control and a page, which is previously constructed according to a historical test record, and a target page sequence number to be jumped.
Further, the target page sequence number module 320 may include a negative sample unit, where the negative sample unit may specifically be configured to: in the course of training the test path model,
for any historical test step, determining a page which can be jumped of a page when the step is executed according to the historical test record;
selecting one page from other pages except the page capable of being jumped as a target jumped page of the step;
and taking the page serial number where the step is executed, the target jump page serial number of the page and the reward value of the step as negative samples corresponding to the testing step.
Further, the historical test record may include a sequence number of the control operated in each execution step and a sequence number of the page where the control is located, which are recorded during the stress test.
Further, the state vector module 310 may specifically be configured to:
taking the total number of pages contained in each sample in the test path model as the dimension of the current state vector;
for each dimension in the current state vector, if the page corresponding to the dimension is not traversed, the value of the dimension is a first numerical value; if the page corresponding to the dimension is traversed and is not the current page, the value of the dimension is a second numerical value; and if the page corresponding to the dimension is the current page, the value of the dimension is a third numerical value.
Further, the target page sequence number module 320 may further include a filtering vector unit, where the filtering vector unit may be specifically configured to: in the course of training the test path model,
and generating a target state vector of each sample and a filtering vector of each sample according to the target jump page sequence number of each sample.
Further, for each page, Xpath of a top-left preset number of components of the page may be used as a serial number of the page.
The pressure testing device provided by the embodiment of the invention can execute the pressure testing method provided by any embodiment of the invention, and has the following beneficial effects: the test training model in the embodiment of the invention can summarize the optimal execution path in any state from all historical execution processes through the deep reinforcement learning thought, so that higher test coverage can be realized by relatively shorter execution steps; the expansibility is strong, and when the structure of the terminal to be tested changes, the technical scheme provided by the embodiment of the invention can keep the effect by using an iterative training mode; the stability is high, the technical scheme provided by the embodiment of the invention solidifies the trained execution strategy in a model mode, and the problem of unstable coverage rate caused by randomness is reduced to a great extent; compared with the traditional mode that a large amount of test experience and manual strategy are needed to make cost, the manual work of the technical scheme provided by the embodiment of the invention is only to simply adjust the parameters in the test training model, and the rest can be automatically trained by a machine, so that the cost is greatly saved; the technical scheme provided by the embodiment of the invention has no relation with the specific implementation mode, the specific architecture and the like of the terminal, and can be conveniently applied to terminal tests of various systems.
The pressure testing device provided by the embodiment of the invention can execute the pressure testing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary device 412 suitable for use in implementing embodiments of the present invention. The device 412 shown in fig. 5 is only an example and should not impose any limitation on the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 5, device 412 is in the form of a general purpose computing device. The components of device 412 may include, but are not limited to: one or more processors 416, a system memory 428, and a bus 418 that couples the various system components (including the system memory 428 and the processors 416).
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and processor 416, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 428 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)430 and/or cache memory 432. The device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Memory 428 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, the device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 420. As shown, network adapter 420 communicates with the other modules of device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 416 executes various functional applications and data processing by executing programs stored in the system memory 428, for example, implementing a stress testing method provided by an embodiment of the present invention, the method including:
generating a current state vector according to the page sequence number where the current test step is executed;
taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
and determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped.
EXAMPLE five
The fifth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the pressure testing method provided in the fifth embodiment of the present invention, where the method includes:
generating a current state vector according to the page sequence number where the current test step is executed;
taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
and determining the sequence number of the target control to be tested according to the jump relation between the control and the page, which is constructed in advance according to the historical test record, and the sequence number of the target page to be jumped.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A pressure testing method, comprising:
generating a current state vector according to the page sequence number where the current test step is executed;
taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
determining a target control serial number to be tested according to a jump relation between a control and a page which is constructed in advance according to a historical test record and a target page serial number to be jumped;
wherein, the generating the current state vector according to the page sequence number where the current testing step is executed comprises:
taking the total number of pages contained in each sample in the test path model as the dimension of the current state vector;
for each dimension in the current state vector, if the page corresponding to the dimension is not traversed, the value of the dimension is a first numerical value; if the page corresponding to the dimension is traversed and is not the current page, the value of the dimension is a second numerical value; and if the page corresponding to the dimension is the current page, the value of the dimension is a third numerical value.
2. The method of claim 1, wherein in training the test path model, comprising:
for any historical test step, determining a page which can be jumped of a page when the step is executed according to the historical test record;
selecting one page from other pages except the page capable of being jumped as a target jumped page of the step;
and taking the page serial number where the step is executed, the target jump page serial number of the page and the reward value of the step as negative samples corresponding to the testing step.
3. The method according to claim 1, wherein the historical test record comprises a sequence number of the control operated in each execution step and a sequence number of the page where the control is located in the process of stress test.
4. The method of claim 1, wherein in training the test path model, further comprising:
and generating a target state vector of each sample and a filtering vector of each sample according to the target jump page sequence number of each sample.
5. The method of claim 1, wherein for each page, the Xpath of the top-left preset number of elements of the page is used as the sequence number of the page.
6. A pressure testing device, comprising:
the state vector module is used for generating a current state vector according to the page sequence number where the current test step is executed;
the target page sequence number module is used for taking the current state vector as the input of a test path model to obtain the sequence number of a target page to be jumped, which is predicted by the test path model, wherein the test path model is obtained by training based on a deep reinforcement learning basic model in advance;
the target control serial number module is used for determining a target control serial number to be tested according to a jump relation between a control and a page which is constructed in advance according to a historical test record and a target page serial number to be jumped;
wherein the state vector module is specifically configured to:
taking the total number of pages contained in each sample in the test path model as the dimension of the current state vector;
for each dimension in the current state vector, if the page corresponding to the dimension is not traversed, the value of the dimension is a first numerical value; if the page corresponding to the dimension is traversed and is not the current page, the value of the dimension is a second numerical value; and if the page corresponding to the dimension is the current page, the value of the dimension is a third numerical value.
7. The apparatus of claim 6, wherein the target page sequence number module comprises a negative sample unit, and wherein the negative sample unit is specifically configured to: in the course of training the test path model,
for any historical test step, determining a page which can be jumped of a page when the step is executed according to the historical test record;
selecting one page from other pages except the page capable of being jumped as a target jumped page of the step;
and taking the page serial number where the step is executed, the target jump page serial number of the page and the reward value of the step as negative samples corresponding to the testing step.
8. The apparatus according to claim 6, wherein the historical test record includes a sequence number of the control operated in each execution step and a sequence number of the page where the control is located in the process of stress test.
9. The apparatus of claim 6, wherein the target page sequence number module further comprises a filter vector unit, and wherein the filter vector unit is specifically configured to: in the course of training the test path model,
and generating a target state vector of each sample and a filtering vector of each sample according to the target jump page sequence number of each sample.
10. The apparatus of claim 6, wherein for each page, the Xpath of the top-left preset number of elements of the page is used as the sequence number of the page.
11. An electronic device, characterized in that the device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the stress testing method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of pressure testing according to any one of claims 1-5.
CN201810209538.1A 2018-03-14 2018-03-14 Pressure testing method, device, equipment and storage medium Active CN108334439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810209538.1A CN108334439B (en) 2018-03-14 2018-03-14 Pressure testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810209538.1A CN108334439B (en) 2018-03-14 2018-03-14 Pressure testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108334439A CN108334439A (en) 2018-07-27
CN108334439B true CN108334439B (en) 2021-06-04

Family

ID=62930911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810209538.1A Active CN108334439B (en) 2018-03-14 2018-03-14 Pressure testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108334439B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111027579A (en) * 2018-10-10 2020-04-17 百度在线网络技术(北京)有限公司 Method, device, equipment and medium for determining hyper-parameters
CN109684207B (en) * 2018-12-14 2022-09-02 平安科技(深圳)有限公司 Method and device for packaging operation sequence, electronic equipment and storage medium
CN109739764A (en) * 2018-12-29 2019-05-10 中国联合网络通信集团有限公司 A kind of applied program testing method and device
CN109901994B (en) * 2019-01-21 2020-05-15 阿里巴巴集团控股有限公司 Test script generation method and device based on reinforcement learning
CN109782667B (en) * 2019-01-25 2024-08-02 苏州华兴源创科技股份有限公司 Pressure test system and method, computer device and readable storage medium
CN109977029A (en) * 2019-04-09 2019-07-05 科大讯飞股份有限公司 A kind of training method and device of page jump model
CN110221959B (en) * 2019-04-16 2022-12-27 创新先进技术有限公司 Application program testing method, device and computer readable medium
CN112350878A (en) * 2019-08-07 2021-02-09 阿里巴巴集团控股有限公司 Pressure test system
CN110764984A (en) * 2019-09-30 2020-02-07 上海游族信息技术有限公司 Pressurizing data multiplexing method for server performance pressure test
CN111078579A (en) * 2019-12-31 2020-04-28 河北省科学院应用数学研究所 Monkey testing method and device and terminal equipment
CN111694753B (en) * 2020-07-30 2023-04-11 北京字节跳动网络技术有限公司 Application program testing method and device and computer storage medium
CN111694756B (en) * 2020-07-31 2023-05-23 北京字节跳动网络技术有限公司 Application program testing method and device
CN111694755B (en) * 2020-07-31 2023-07-18 抖音视界有限公司 Application program testing method and device, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488539A (en) * 2015-12-16 2016-04-13 百度在线网络技术(北京)有限公司 Generation method and device of classification method, and estimation method and device of system capacity
CN106228314A (en) * 2016-08-11 2016-12-14 电子科技大学 The workflow schedule method of study is strengthened based on the degree of depth
CN106663038A (en) * 2014-06-30 2017-05-10 亚马逊科技公司 Feature processing recipes for machine learning
CN107003977A (en) * 2014-06-27 2017-08-01 亚马逊技术股份有限公司 System, method and apparatus for organizing the photo of storage on a mobile computing device
CN107705557A (en) * 2017-09-04 2018-02-16 清华大学 Road network signal control method and device based on depth enhancing network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10216954B2 (en) * 2016-06-27 2019-02-26 International Business Machines Corporation Privacy detection of a mobile application program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107003977A (en) * 2014-06-27 2017-08-01 亚马逊技术股份有限公司 System, method and apparatus for organizing the photo of storage on a mobile computing device
CN106663038A (en) * 2014-06-30 2017-05-10 亚马逊科技公司 Feature processing recipes for machine learning
CN105488539A (en) * 2015-12-16 2016-04-13 百度在线网络技术(北京)有限公司 Generation method and device of classification method, and estimation method and device of system capacity
CN106228314A (en) * 2016-08-11 2016-12-14 电子科技大学 The workflow schedule method of study is strengthened based on the degree of depth
CN107705557A (en) * 2017-09-04 2018-02-16 清华大学 Road network signal control method and device based on depth enhancing network

Also Published As

Publication number Publication date
CN108334439A (en) 2018-07-27

Similar Documents

Publication Publication Date Title
CN108334439B (en) Pressure testing method, device, equipment and storage medium
CN108304324B (en) Test case generation method, device, equipment and storage medium
CN107506300B (en) User interface testing method, device, server and storage medium
US11347631B1 (en) Method, apparatus, and computer program product for predictive API test suite selection
US9009183B2 (en) Transformation of a system change set from machine-consumable form to a form that is readily consumable by a human
US10146531B2 (en) Method and apparatus for generating a refactored code
CN111814951B (en) Debugging deep neural network
US8225287B2 (en) Method for testing a system
CN109799985A (en) Front-end code generation method and device, storage medium and electronic equipment
CN114529019B (en) Spare part guarantee probability determining method and device based on task success rate
CN118114771B (en) Function tool calling method and device in trusted execution environment, medium and equipment
CN110737509B (en) Thermal migration processing method and device, storage medium and electronic equipment
US10380313B1 (en) Implementation and evaluation of designs for heterogeneous computing platforms with hardware acceleration
CN104025089B (en) The method and system creeped based on situation
CN112199261A (en) Application program performance analysis method and device and electronic equipment
CN104346174B (en) A kind of description of online polar plot modeling process and replay method
CN111708681B (en) Log processing method, device, equipment and storage medium
US10440154B2 (en) Method and system for predictive loading of software resources
CN116168403A (en) Medical data classification model training method, classification method, device and related medium
US8965826B2 (en) Dynamic backjumping in constraint satisfaction problem solving
US20220253690A1 (en) Machine-learning systems for simulating collaborative behavior by interacting users within a group
CN113448822B (en) Test method, test device, computer readable medium and electronic equipment
CN116149978A (en) Service interface testing method and device, electronic equipment and storage medium
KR101587637B1 (en) Method for assisting programming based upon icon and apparatus for controlling the same
CN116341633B (en) Model deployment method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant