CN116126699A - Pressure testing method, device, equipment, storage medium and product - Google Patents
Pressure testing method, device, equipment, storage medium and product Download PDFInfo
- Publication number
- CN116126699A CN116126699A CN202211702419.2A CN202211702419A CN116126699A CN 116126699 A CN116126699 A CN 116126699A CN 202211702419 A CN202211702419 A CN 202211702419A CN 116126699 A CN116126699 A CN 116126699A
- Authority
- CN
- China
- Prior art keywords
- test
- pressure
- program
- configuration information
- target application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 780
- 238000013515 script Methods 0.000 claims abstract description 122
- 238000000034 method Methods 0.000 claims abstract description 44
- 230000008569 process Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 18
- 230000015654 memory Effects 0.000 claims description 15
- 238000003825 pressing Methods 0.000 claims description 9
- 238000010998 test method Methods 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 230000004044 response Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000036541 health Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 239000000919 ceramic Substances 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000011981 development test Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 238000009662 stress testing Methods 0.000 description 1
- 239000010409 thin film Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- 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)
- Measuring Fluid Pressure (AREA)
Abstract
The application provides a pressure test method, a pressure test device, pressure test equipment, a pressure test storage medium and a pressure test product, and belongs to the technical field of software test. The method comprises the following steps: acquiring first test configuration information of a target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information; configuring a reference test script based on first test configuration information to obtain a first test script, wherein the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information; the method comprises the steps of building a test environment of a target application program through a building program, simulating pressure test indexes of the target application program through a first test program, and performing pressure test on the target application program in the test environment based on the pressure test indexes. The pressure test device can improve the efficiency of pressure test.
Description
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to a pressure testing method, device, apparatus, storage medium, and product.
Background
Before the application program is put into use or before the load of the application program reaches the maximum limit, the reliability and stability of the application program are known by executing the pressure test, and then the reliability and stability of the application program are improved, so that the downtime of the application program and the loss caused by downtime are reduced.
In the related art, a tester is required to build an operating environment of the application in a test server and then operate the application in the operating environment for a long time or with an excessive load to test the reliability and stability of the application. However, because it often takes a long time for a tester to manually build an application, the efficiency of the stress test is low.
Disclosure of Invention
The embodiment of the application provides a pressure test method, a device, equipment, a storage medium and a product, which can improve the efficiency of pressure test. The technical scheme is as follows:
in one aspect, a pressure testing method is provided, the method comprising:
acquiring first test configuration information of a target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information;
configuring a reference test script based on the first test configuration information to obtain a first test script, wherein the test configuration information of the first test script is the first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information;
And building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the first test program, and performing pressure test on the target application program in the test environment based on the pressure test index.
In one possible implementation manner, the building the test environment of the target application program through the building program, simulating, through the first test program, a pressure test index of the target application program, and performing, based on the pressure test index, a pressure test on the target application program in the test environment, where the pressure test includes:
building a test environment of the target application program in pressure test equipment based on the building program;
simulating the pressure test index of the target application program in a pressure application device through the first test program, so that the pressure application device applies pressure to the pressure test device based on the pressure test index, and the pressure test device is used for running the target application program in the test environment based on the pressure applied by the pressure application device to realize pressure test of the target application program.
In another possible implementation, the method further includes:
and controlling the pressure applying device to establish test connection with the pressure testing device based on the device address, the pressure testing account number and the password of the pressure applying device, wherein the test connection is used for the pressure applying device to apply pressure to the pressure testing device based on the pressure testing index.
In another possible implementation manner, the building the test environment of the target application program in the stress test device based on the building program includes:
if the target application program is an application program in a distributed system, respectively building test environments of the target application program in a plurality of pressure test devices included in the distributed system based on the building program;
the pressure application device is further used for respectively applying pressure to the plurality of pressure test devices based on the pressure test indexes, and the plurality of pressure test devices are used for running the target application program in the test environment based on the pressure applied by the pressure application device so as to realize pressure test of the target application program.
In another possible implementation, the method further includes:
acquiring a pressure test report of the target application program, wherein the pressure test report comprises pressure performance indexes of the target application program;
modifying the first test configuration information to obtain second test configuration information under the condition that the pressure performance index does not reach the standard, wherein the second test configuration information comprises the environment configuration information and second pressure configuration information;
configuring the reference test script based on the second test configuration information to obtain a second test script, wherein the test configuration information of the second test script is the second test configuration information, the second test script comprises the building program and a second test program, and the pressure test index of the second test program is a pressure test index corresponding to the second pressure configuration information;
and building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the second test program, and performing pressure test on the target application program in the test environment based on the pressure test index until a pressure test report with the pressure performance index reaching the standard is obtained.
In another possible implementation, the environment configuration information includes at least one of an interface address, a request data, a request mode, a request header, a test step, and a device address of the pressure applying device;
the first pressure configuration information comprises at least one of a thread number and an execution duration;
wherein the interface address is an interface address between the pressure applying device and a pressure testing device;
the request data is the data requested by the target application program;
the request mode is the mode of requesting data;
the request header is a request header for requesting the request data;
the testing step is a step of performing pressure testing on the target application program;
the pressure applying device is a device for applying pressure to the pressure testing device;
the thread number is the thread number of the target application program running simultaneously in the process of performing the pressure test;
the execution time period is the time period when the pressure applying device applies pressure to the pressure testing device.
In another aspect, a pressure testing apparatus is provided, the apparatus comprising:
the first acquisition module is used for acquiring first test configuration information of the target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information;
The configuration module is used for configuring a reference test script based on the first test configuration information to obtain a first test script, wherein the test configuration information of the first test script is the first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information;
the test module is used for building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the first test program, and carrying out pressure test on the target application program in the test environment based on the pressure test index.
In a possible implementation manner, the test module is configured to build a test environment of the target application program in a pressure test device based on the building program;
simulating the pressure test index of the target application program in a pressure application device through the first test program, so that the pressure application device applies pressure to the pressure test device based on the pressure test index, and the pressure test device is used for running the target application program in the test environment based on the pressure applied by the pressure application device to realize pressure test of the target application program.
In another possible implementation, the apparatus further includes:
the connection module is used for controlling the pressure applying device to establish test connection with the pressure testing device based on the device address, the pressure testing account number and the password of the pressure applying device, and the test connection is used for enabling the pressure applying device to apply pressure to the pressure testing device based on the pressure testing index.
In another possible implementation manner, the test module is configured to, in a case where the target application program is an application program in a distributed system, respectively build test environments of the target application program in a plurality of pressure test devices included in the distributed system based on the build program;
the pressure application device is further used for respectively applying pressure to the plurality of pressure test devices based on the pressure test indexes, and the plurality of pressure test devices are used for running the target application program in the test environment based on the pressure applied by the pressure application device so as to realize pressure test of the target application program.
In another possible implementation, the apparatus further includes:
The second acquisition module is used for acquiring a pressure test report of the target application program, wherein the pressure test report comprises pressure performance indexes of the target application program;
the modification module is used for modifying the first test configuration information to obtain second test configuration information under the condition that the pressure performance index does not reach the standard, wherein the second test configuration information comprises the environment configuration information and the second pressure configuration information;
the configuration module is further configured to configure the reference test script based on the second test configuration information to obtain a second test script, wherein the test configuration information of the second test script is the second test configuration information, the second test script comprises the building program and a second test program, and a pressure test index of the second test program is a pressure test index corresponding to the second pressure configuration information;
the test module is further configured to build a test environment of the target application program through the building program, simulate a pressure test index of the target application program through the second test program, and perform a pressure test on the target application program in the test environment based on the pressure test index until a pressure test report that the pressure performance index meets the standard is obtained.
In another possible implementation, the environment configuration information includes at least one of an interface address, a request data, a request mode, a request header, a test step, and a device address of the pressure applying device;
the first pressure configuration information comprises at least one of a thread number and an execution duration;
wherein the interface address is an interface address between the pressure applying device and a pressure testing device;
the request data is the data requested by the target application program;
the request mode is the mode of requesting data;
the request header is a request header for requesting the request data;
the testing step is a step of performing pressure testing on the target application program;
the pressure applying device is a device for applying pressure to the pressure testing device;
the thread number is the thread number of the target application program running simultaneously in the process of performing the pressure test;
the execution time period is the time period when the pressure applying device applies pressure to the pressure testing device.
In another aspect, a control device is provided, the control device including one or more processors and one or more memories, the one or more memories having stored therein at least one program code loaded and executed by the one or more processors to implement the pressure testing method of any of the above implementations.
In another aspect, a computer readable storage medium having at least one program code stored therein is provided, the at least one program code loaded and executed by a processor to implement the pressure testing method of any of the above implementations.
In another aspect, a computer program product is provided, the computer program product comprising computer program code, the computer program code being stored in a computer readable storage medium, from which a processor of a control device reads the computer program code, the processor executing the computer program code, causing the control device to perform the pressure testing method according to any one of the above implementations.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured according to the first test configuration information of the target application program, so that the obtained first test script has the capability of building the test environment corresponding to the first test configuration information, and therefore, the test environment of the application program can be built through the first test script, further, the subsequent pressure test can be performed, and thus, the test environment does not need to be built manually, the time required for building the test environment is reduced, and the efficiency of the pressure test is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of a pressure testing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a pressure testing method provided in an embodiment of the present application;
FIG. 3 is a flow chart of another pressure testing method provided by an embodiment of the present application;
FIG. 4 is a flow chart of another pressure testing method provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a pressure testing method according to an embodiment of the present application;
FIG. 6 is a block diagram of a pressure testing apparatus provided in an embodiment of the present application;
fig. 7 is a block diagram of a control apparatus according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to in this application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, the first test configuration information and the like referred to in this application are all acquired with sufficient authorization.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims of this application and in the drawings, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
FIG. 1 is a schematic diagram of an implementation environment of a pressure testing method according to an embodiment of the present application; referring to fig. 1, the implementation environment includes: a control device 101, a pressure application device 102, and a pressure test device 103. The control device 101, the pressure applying device 102 and the pressure testing device 103 communicate with each other by wireless or wired communication means. The control device 101 is used for performing relevant configuration operations on the pressure test, for example, the control device 101 configures a test environment in the pressure test device 103 and configures a pressure test index in the pressure application device 102. The pressure applying device 102 is configured to apply pressure to the pressure testing device 103 based on the pressure testing index. The pressure testing device 103 is used for performing pressure testing on the target application program in the testing environment based on the pressure applied by the pressure applying device 102.
The target application may be any application to be subjected to a stress test; for example, the target application may be an elevator application, a health service application, a game application, or a social application, and in the embodiment of the present application, the target application is not specifically limited.
It should be noted that, the target application program may be an application program in a distributed system, or may be an application program in a non-distributed system; in case the target application is an application in a distributed system, a plurality of pressure testing devices 103 are included in the implementation environment, i.e. the number of pressure testing devices 103 in the implementation environment is one or more.
Another point to be noted is that the stress test may also be referred to as a strength test or a load test.
The control device 101 may be configured as a terminal, which may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, an intelligent voice interaction, an in-vehicle control device 101, or the like, but is not limited thereto. The pressure applying device 102 and the pressure testing device 103 may be configured as servers, which may be independent physical servers, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), and basic cloud computing services such as big data and artificial intelligence platforms.
Fig. 2 is a flowchart of a pressure testing method provided in an embodiment of the present application, where an execution body of the method is a control device; referring to fig. 2, the method includes:
step 201: first test configuration information of a target application program is obtained, wherein the first test configuration information comprises environment configuration information and first pressure configuration information.
The control equipment displays a configuration interface, wherein the configuration interface is used for inputting first test configuration information of the target application program, and a tester can input the first test configuration information in the configuration interface; the control device acquires the inputted first test configuration information. The first test configuration information comprises environment configuration information and first pressure configuration information, wherein the environment configuration information is used for configuring the test environment of the target application program, and the first pressure configuration information is used for configuring the pressure test index of the target application program.
Step 202: and configuring the reference test script based on the first test configuration information to obtain a first test script.
The test configuration information of the first test script is first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information.
The test script programmed by the tester is called a reference test script, and the test configuration information of the reference test script is empty, so that the first test script meeting the test requirement can be obtained by configuring the reference test script. The programming language of the benchmark test script may be python (a computer design language), and the programming language of the benchmark test script may also be C language, c++ or VB language, etc., and in the embodiment of the present application, the programming language of the benchmark test script is not specifically limited.
Step 203: the method comprises the steps of building a test environment of a target application program through a building program, simulating pressure test indexes of the target application program through a first test program, and performing pressure test on the target application program in the test environment based on the pressure test indexes.
The control equipment builds a test environment of the target application program in the test equipment through a building program; simulating a pressure test index of the target application program in the pressure applying device through the first test program; the pressure applying device applies pressure to the pressure testing device based on the pressure application index; the pressure testing device performs pressure testing on the target application program in the testing environment based on the pressure applied by the pressure applying device.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured according to the first test configuration information of the target application program, so that the obtained first test script has the capability of building the test environment corresponding to the first test configuration information, and therefore, the test environment of the application program can be built through the first test script, further, the subsequent pressure test can be performed, and thus, the test environment does not need to be built manually, the time required for building the test environment is reduced, and the efficiency of the pressure test is improved.
FIG. 3 is a flow chart of a pressure testing method provided in an embodiment of the present application; referring to fig. 3, the method includes:
step 301: the control device obtains first test configuration information of the target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information.
The control equipment displays a configuration interface, wherein the configuration interface is used for inputting first test configuration information of the target application program, and a tester can input the first test configuration information in the configuration interface; the control device acquires the inputted first test configuration information. The first test configuration information comprises environment configuration information and first pressure configuration information, wherein the environment configuration information is used for configuring the test environment of the target application program, and the first pressure configuration information is used for configuring the pressure test index of the target application program.
The environment configuration information includes at least one of an interface address, request data, a request mode, a request header, a test step, and a device address of the pressure applying device. Wherein the interface address is an interface address between the pressure applying device and the pressure testing device. The request data is the data requested by the target application program; for example, the target application is an elevator application, and the request data is elevator dispatch data; for another example, if the target application is a health service application, the request data is health service information of the user. The request mode is a mode for requesting the request data; for example, the request mode is get or post. The request header is a request header for requesting data; for example, the request header may be Accept (type of data received), accept-Language, accept-Encoding (Encoding method of target application), connection (long Connection or short Connection), and the like. The testing step is a step of performing pressure test on the target application program; for example, the target application is an elevator application, and the testing step includes triggering a plurality of dispatch requests to the elevator application for requesting dispatch of an elevator to floor 3, for requesting dispatch of an elevator to floor 4, for requesting dispatch of an elevator to floor 6, and so on, respectively. The pressure applying device is a device that applies pressure to the pressure testing device.
The first pressure configuration information includes at least one of a thread number and an execution duration; the thread number is the thread number of the target application program running simultaneously in the process of performing the pressure test; the execution time period is a time period during which the pressure application device applies pressure to the pressure test device.
Step 302: the control device configures the reference test script based on the first test configuration information to obtain a first test script.
The test configuration information of the first test script is first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information.
The test script programmed by the tester is called a reference test script, and the test configuration information of the reference test script is empty, so that the first test script meeting the test requirement can be obtained by configuring the reference test script. The programming language of the benchmark test script may be python (a computer design language), and the programming language of the benchmark test script may also be C language, c++ or VB language, etc., and in the embodiment of the present application, the programming language of the benchmark test script is not specifically limited.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured through the first test configuration information of the target application program, so that the obtained first test script has the capability of building a test environment corresponding to the first test configuration information; compared with the pressure test tool which is developed by using open source or customized in the related technology, the method does not need frequent tool parameter configuration and modification, and does not need test scripts of maintenance tools and secondary development test tools; in addition, in the embodiment of the application, the test configuration is separated from the test script, so that the maintenance of the test configuration is facilitated, the efficiency and the accuracy of the pressure test are improved, and a large amount of manpower time is saved.
Step 303: the control device builds a test environment of the target application program in the pressure test device based on the building program.
The first implementation mode: the control equipment sends a first test script to the pressure test equipment; the pressure test equipment receives the first test script, and builds a test environment of the target application program based on a building program in the first test script.
In the embodiment of the application, the control equipment directly sends the first test script to the pressure test equipment, the pressure test equipment analyzes the building program from the first test script, and then builds the test environment based on the building program, so that the pressure of the control equipment is dispersed into the pressure test equipment, and the pressure of the control equipment is reduced.
The second implementation mode: the control equipment analyzes a building program from the first test script and sends the building program to the pressure test equipment; the pressure test equipment receives a building program, and builds a test environment of the target application program based on the building program.
In the embodiment of the application, the control device only sends the building program in the first test script to the pressure test device, and does not need to send the whole first test script to the pressure test device, so that the information transmission quantity is reduced, and the transmission efficiency is improved.
Step 304: the control device simulates the stress test index of the target application program in the stress application device through the first test program.
The pressure test index comprises at least one of thread number and execution duration; for example, the pressure test index includes the number of threads, and the number of threads is 3, and the control device simulates 3 threads in the pressure applying device through the first test program; for another example, the pressure test index includes an execution duration, and the execution duration is 20 minutes; the control device simulates a 20 minute pressure test in the pressure applying device by the first test program.
The first implementation mode: the control device sends a first test script to the pressure applying device; the pressure application device receives the first test script and simulates the pressure test index of the target application program based on the first test program in the first test script.
In the embodiment of the application, the control device directly sends the first test script to the pressure application device, the pressure application device analyzes the first test program from the first test script, and then the pressure test index of the target application program is simulated based on the first test program, so that the pressure of the control device is dispersed into the pressure application device, and the pressure of the control device is reduced.
The second implementation mode: the control device analyzes a first test program from the first test script and sends the first test program to the pressure applying device; the pressure applying device receives the first test program and simulates the pressure test index of the target application program based on the first test program.
In the embodiment of the application, the control device only sends the first test program in the first test script to the pressure test device, and does not need to send the whole first test script to the pressure test device, so that the information transmission quantity is reduced, and the transmission efficiency is improved.
Step 305: the pressure applying device applies pressure to the pressure testing device based on the pressure testing index.
For example, the pressure test index includes the thread number, and the thread number is 3, and the pressure applying device sends 3 paths of request data to the pressure test device at the same time; for another example, the pressure test index includes an execution duration, and the execution duration is 20 minutes; the duration of the pressure application device applying pressure to the pressure test device was 20 minutes.
Before the pressure application device applies pressure to the pressure test device based on the pressure test indicator, the pressure application device needs to establish a test connection with the pressure test device for the pressure application device to apply pressure to the pressure test device based on the pressure test indicator. Wherein the process of establishing a test connection between the pressure applying device and the pressure testing device comprises: the control device controls the pressure applying device to establish a test connection with the pressure testing device based on the device address, the pressure testing account number and the password of the pressure applying device. The device address of the pressure applying device may be an IP (Internet Protocol Address, internet protocol) address of the pressure applying device, among others.
In the embodiment of the application, the control device controls the pressure applying device to establish test connection with the pressure testing device through the pressure testing account number and the password, so that the safety can be improved.
Step 306: the pressure testing device runs the target application program in the testing environment based on the pressure applied by the pressure applying device so as to realize the pressure test of the target application program.
For example, the pressure test index includes a thread number, and the thread number is 3; the stress test equipment processes 3-way request data simultaneously in the test environment. For another example, the pressure test index includes an execution duration, and the execution duration is 20 minutes; the duration of the continued operation of the target application in the test environment by the pressure test device was 20 minutes.
Step 307: the stress test equipment obtains a stress test report of the target application program, wherein the stress test report comprises stress performance indexes of the target application program.
The pressure performance index includes at least one of TPS (Throughput), a response time period to the request data, and an error rate of the response to the request data.
Step 308: the pressure test device sends the pressure test report to the control device.
After the pressure test device acquires the pressure test report, the pressure test report is sent to the control device, and the control device analyzes the pressure test report.
Step 309: and the control equipment receives the pressure test report, and modifies the first test configuration information under the condition that the pressure performance index does not reach the standard to obtain second test configuration information.
For example, the pressure performance index includes TPS, and the control device determines that TPS does not reach the standard if TPS is smaller than a preset value; under the condition that TPS is not smaller than a preset value, the control equipment determines that TPS reaches the standard. For another example, the pressure performance index includes a response time length to the request data, and the control device determines that the response time length does not reach the standard under the condition that the response time length exceeds a preset time length; and under the condition that the response time does not exceed the preset time, the control equipment determines that the response time meets the standard. For another example, the pressure performance index includes an error rate in response to the request data, and the control device determines that the error rate does not reach the standard if the error rate exceeds a preset error rate; in the case that the error rate does not exceed the preset error rate, the control device determines that the error rate meets the standard.
It should be noted that, in the case where the pressure performance index includes a plurality of indexes, in the case where each index meets the standard, the control device determines that the pressure performance index meets the standard; and if any index of the plurality of indexes does not reach the standard, the control equipment determines that the pressure performance index does not reach the standard.
Another point to be noted is that, in the case where the pressure performance index does not reach the standard, the control device may modify the environmental information and the first pressure configuration information in the first test configuration information, or may modify only the first pressure configuration information in the first test configuration information. In the embodiment of the present application, the control device is taken as an example to modify only the first pressure configuration information in the first test configuration information; the second test configuration information includes environmental configuration information and second pressure configuration information.
The other point to be described is that the pressure test device may not send the pressure test report to the control device after the pressure test report is obtained; and determining whether the pressure performance index meets the standard based on the pressure test; and sending a determination result to the control equipment, wherein the determination result is that the pressure performance index meets or does not meet. The control equipment receives the determination result, and the pressure test process is ended under the condition that the determination result is that the pressure performance index reaches the standard; and if the determined result is that the pressure performance index does not reach the standard, modifying the first test configuration information to obtain second test configuration information, and then executing step 309.
Step 310: and the control equipment configures the reference test script based on the second test configuration information to obtain a second test script.
The test configuration information of the second test script is second test configuration information, the second test script comprises a building program and a second test program, and the pressure test index of the second test program is a pressure test index corresponding to the second pressure configuration information.
Step 311: the control equipment builds a test environment of the target application program through the building program, simulates the pressure test index of the target application program through the second test program, and performs pressure test on the target application program in the test environment based on the pressure test index until a pressure test report with the pressure performance index reaching the standard is obtained.
The implementation process of this step is similar to the process of the control device in steps 303-306, in which the test environment of the target application program is set up by the set-up program, the pressure test index of the target application program is simulated by the first test program, and the pressure test is performed on the target application program in the test environment based on the pressure test index, which is not described herein.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured according to the first test configuration information of the target application program, so that the obtained first test script has the capability of building the test environment corresponding to the first test configuration information, and therefore, the test environment of the application program can be built through the first test script, further, the subsequent pressure test can be performed, and thus, the test environment does not need to be built manually, the time required for building the test environment is reduced, and the efficiency of the pressure test is improved.
FIG. 4 is a flow chart of a pressure testing method provided in an embodiment of the present application; referring to fig. 4, the method includes:
step 401: the control device obtains first test configuration information of the target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information.
For example, referring to fig. 5, a tester inputs first test configuration information to a control device.
Step 402: the control device configures the reference test script based on the first test configuration information to obtain a first test script.
It should be noted that steps 401 to 402 are the same as steps 301 to 302, respectively, and will not be described herein. For example, with continued reference to fig. 5, the control device generates a second test script.
Another point to be described is that after the control device obtains the first test script, the control device determines whether the target application is an application in the distributed system, and in the case where the target application is an application in the distributed system, step 403 is executed; in the case where the target application is not an application in a distributed system, it may be performed as in steps 303-311 in the above embodiments. For example, with continued reference to fig. 5, the control device determines whether the target application is an application in the distributed system.
Wherein, the control device stores an identification set of an application program in the distributed system; in the case that the program identifier of the target application program is included in the identifier set, the control device determines that the target application program is an application program in the distributed system; in the case where the program identification of the target application is not included in the identification set, the control device determines that the target application is not an application in the distributed system.
Step 403: in the case where the target application is an application in the distributed system, the control device builds a test environment of the target application in each of a plurality of pressure test devices included in the distributed system based on the build program.
The test environments in the plurality of pressure test devices can be the same or different; in the embodiment of the present application, description will be given taking the case that the test environments in the plurality of pressure test apparatuses are the same. Correspondingly, the step of the control device building the test environment of the target application program in the plurality of pressure test devices included in the distributed system based on the building program may be:
the control equipment sends first test scripts to the plurality of pressure test equipment respectively; each pressure test device receives the first test script, and builds a test environment of the target application program based on a building program in the first test script; or,
The control equipment analyzes the building program from the first test script and respectively sends the building program to a plurality of pressure test equipment; each pressure test device receives a building program, and builds a test environment of the target application program based on the building program.
For example, with continued reference to fig. 5, in the case where the target application is an application in a distributed system, the control device controls the pressure applying device to establish test connections with a plurality of pressure test devices, and then builds a test environment in the plurality of pressure test devices.
Step 404: the control device simulates the stress test index of the target application program in the stress application device through the first test program.
It should be noted that, the present step is the same as step 304, and will not be described herein.
With continued reference to fig. 5, the control device sends a first test script to the pressure application device, the pressure application device receives the first test script, and simulates the pressure test index of the target application program based on the first test script.
Step 405: the pressure applying device applies pressure to the plurality of pressure testing devices, respectively, based on the pressure testing index.
The pressure applied by the pressure applying device to the plurality of pressure testing devices may be the same or different; the first implementation mode: the pressure applied by the pressure applying device to the plurality of pressure testing devices is the same, and the step of applying the pressure by the pressure applying device to the plurality of pressure testing devices based on the pressure test index may be: for any pressure testing device, the pressure applying device applies pressure to the pressure testing device based on the pressure testing index, and the process is the same as step 305, and will not be described herein.
The second implementation mode: the pressure applied by the pressure applying device to the plurality of pressure testing devices is different, and the step of applying the pressure by the pressure applying device to the plurality of pressure testing devices based on the pressure test index may be: for any pressure testing device, the pressure applying device applies pressure to the pressure testing device based on the pressure testing index corresponding to the pressure testing device.
For example, the plurality of pressure test devices are a first pressure test device and a second pressure test device, respectively; and if the number of threads included in the pressure test index corresponding to the first pressure test equipment is 2, the pressure applying equipment simultaneously sends 2 paths of request data to the first pressure test equipment. And the number of threads included in the pressure test index corresponding to the second pressure test equipment is 4, and the pressure applying equipment simultaneously sends 4 paths of request data to the second pressure test equipment.
Step 406: the plurality of pressure testing devices run the target application program in the testing environment based on the pressure applied by the pressure applying device so as to realize the pressure test of the target application program.
For any pressure testing device, the pressure testing device runs the target application program in the testing environment based on the pressure applied by the pressure applying device, so as to realize the pressure test of the target application program, and the process is the same as step 306, and will not be described herein.
For example, the first pressure testing device runs the target application in the testing environment based on the pressure applied by the pressure applying device to achieve the pressure test of the target application. The second pressure testing device runs the target application program in the testing environment based on the pressure applied by the pressure applying device so as to realize the pressure test of the target application program.
Step 407: the plurality of stress test devices obtain stress test reports for the target application, the stress test reports including stress performance indicators for the target application.
For example, the first stress test device obtains a first stress test report of the target application program, where the first stress test report includes a stress performance index obtained by stress testing of the target application program in the first stress test device. The second pressure test equipment acquires a second pressure test report of the target application program, wherein the second pressure test report comprises pressure performance indexes obtained by the pressure test of the target application program in the second pressure test equipment.
It should be noted that, the process of the first pressure test device obtaining the first pressure test report and the process of the second pressure test device obtaining the second pressure test report are the same as the step 307, and are not described herein again.
For example, with continued reference to FIG. 5, the plurality of stress test devices generate test reports including TPS, response time, and error Rate.
Step 408: the plurality of stress test devices send the stress test report to the control device.
For example, the first stress test device sends a first stress test report to the control device. The second pressure test device sends a second pressure test report to the control device, and the process is the same as step 308, and will not be described again.
Step 409: the control device receives the pressure test reports of the plurality of pressure test devices and determines a target pressure test device based on the pressure test reports of the plurality of pressure test devices.
The target pressure test equipment is pressure test equipment with pressure performance indexes not reaching standards.
Step 410: the control device modifies the first test configuration information to obtain second test configuration information.
For example, the control device receives a first pressure test report and a second pressure test report; and under the condition that the pressure performance index included in the first pressure test report does not reach the standard or under the condition that the pressure performance index included in the second pressure test report does not reach the standard, modifying the first test configuration information to obtain the second test configuration information.
It should be noted that, the process of modifying the first test configuration information by the control device to obtain the second test configuration information is the same as that of step 309, and will not be described herein.
For example, with continued reference to fig. 5, in the event that any of the stress test reports fails, the tester re-enters test configuration information, which is referred to as second test configuration information for ease of distinction.
Step 411: and the control equipment configures the reference test script based on the second test configuration information to obtain a second test script.
It should be noted that, this step is the same as step 310, and will not be described here again.
Step 412: and the control equipment performs pressure test on the target application program in the target pressure test equipment through the second test script until a pressure test report with the pressure performance index reaching the standard is obtained.
The control equipment builds a test environment of the target application program in the target pressure test equipment through a building program, and simulates a pressure test index of the target application program in the pressure application equipment through a second test program; the pressure applying device applies pressure to the target pressure testing device based on the pressure testing index; the target application device performs pressure test on the target application program in the test environment based on the pressure applied by the pressure application device until a pressure test report that the pressure performance index meets the standard is obtained.
For example, if the pressure performance index included in the first test report does not reach the standard, the control device builds a test environment of the target application program in the first pressure test device by building a program, simulates the pressure test index of the target application program in the pressure application device by a second test program, and the pressure application device applies pressure to the first pressure test device based on the pressure test index; the first pressure testing device runs the target application program in the testing environment based on the pressure applied by the pressure applying device so as to realize pressure testing of the target application program.
It should be noted that in this step, the control device may also not re-build the test environment of the target application program in the first pressure test device, and only simulate the pressure test index of the target application program in the application device through the second test program, thereby reducing the operation and improving the efficiency of the pressure test.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured according to the first test configuration information of the target application program, so that the obtained first test script has the capability of building the test environment corresponding to the first test configuration information, and therefore, the test environment of the application program can be built through the first test script, further, the subsequent pressure test can be performed, and thus, the test environment does not need to be built manually, the time required for building the test environment is reduced, and the efficiency of the pressure test is improved.
Fig. 6 is a block diagram of a pressure testing apparatus according to an embodiment of the present application, where the apparatus includes:
a first obtaining module 601, configured to obtain first test configuration information of a target application program, where the first test configuration information includes environment configuration information and first pressure configuration information;
the configuration module 602 is configured to configure the reference test script based on the first test configuration information to obtain a first test script, where the test configuration information of the first test script is the first test configuration information, the first test script includes a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information;
the test module 603 is configured to build a test environment of the target application program by using the build program, simulate a pressure test index of the target application program by using the first test program, and perform a pressure test on the target application program in the test environment based on the pressure test index.
In one possible implementation, the test module 603 is configured to build a test environment of the target application program in the pressure test device based on the build program;
And simulating the pressure test index of the target application program in the pressure application device through the first test program, so that the pressure application device applies pressure to the pressure test device based on the pressure test index, and the pressure test device is used for running the target application program in a test environment based on the pressure applied by the pressure application device so as to realize the pressure test of the target application program.
In another possible implementation, the apparatus further includes:
the connection module is used for controlling the pressure applying device to establish test connection with the pressure testing device based on the device address, the pressure testing account number and the password of the pressure applying device, and the test connection is used for enabling the pressure applying device to apply pressure to the pressure testing device based on the pressure testing index.
In another possible implementation manner, the test module 603 is configured to, in a case where the target application is an application in the distributed system, respectively build, based on the build program, test environments of the target application in a plurality of pressure test devices included in the distributed system;
the pressure application device is further used for respectively applying pressure to the plurality of pressure test devices based on the pressure test indexes, and the plurality of pressure test devices are used for running the target application program in the test environment based on the pressure applied by the pressure application device so as to realize the pressure test of the target application program.
In another possible implementation, the apparatus further includes:
the second acquisition module is used for acquiring a pressure test report of the target application program, wherein the pressure test report comprises pressure performance indexes of the target application program;
the modification module is used for modifying the first test configuration information to obtain second test configuration information under the condition that the pressure performance index does not reach the standard, wherein the second test configuration information comprises environment configuration information and second pressure configuration information;
the configuration module 602 is further configured to configure the reference test script based on the second test configuration information, so as to obtain a second test script, where the test configuration information of the second test script is the second test configuration information, the second test script includes a setup program and a second test program, and a pressure test index of the second test program is a pressure test index corresponding to the second pressure configuration information;
the test module 603 is further configured to build a test environment of the target application program by using the build program, simulate a pressure test index of the target application program by using the second test program, and perform a pressure test on the target application program in the test environment based on the pressure test index until a pressure test report that the pressure performance index meets the standard is obtained.
In another possible implementation, the environment configuration information includes at least one of an interface address, request data, a request mode, a request header, a test step, and a device address of the pressure applying device;
the first pressure configuration information includes at least one of a thread number and an execution duration;
the interface address is the interface address between the pressure applying device and the pressure testing device;
the request data is the data requested by the target application program;
the request mode is a mode of requesting data;
the request header is a request header for requesting the request data;
the testing step is a step of performing pressure test on the target application program;
the pressure applying device is a device for applying pressure to the pressure testing device;
the thread number is the thread number of the target application program running simultaneously in the process of performing the pressure test;
the execution time period is a time period during which the pressure application device applies pressure to the pressure test device.
In the embodiment of the application, a reference test script is developed, and the reference test script is configured according to the first test configuration information of the target application program, so that the obtained first test script has the capability of building the test environment corresponding to the first test configuration information, and therefore, the test environment of the application program can be built through the first test script, further, the subsequent pressure test can be performed, and thus, the test environment does not need to be built manually, the time required for building the test environment is reduced, and the efficiency of the pressure test is improved.
It should be noted that: in the pressure test device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the pressure testing device and the pressure testing method provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 7 shows a block diagram of a control apparatus 700 provided in an exemplary embodiment of the present invention. The control device 700 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. The control device 700 may also be referred to by other names as user device, portable terminal, laptop terminal, desktop terminal, etc.
In general, the control apparatus 700 includes: a processor 701 and a memory 702.
In some embodiments, the control device 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 703 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 704, a display 705, a camera assembly 706, audio circuitry 707, and a power supply 708.
A peripheral interface 703 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 701 and memory 702. In some embodiments, the processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 704 is configured to receive and transmit RF (Radio Frequency) signals, also referred to as electromagnetic signals. The radio frequency circuitry 704 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 704 may communicate with other control devices via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 704 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 705 is a touch display, the display 705 also has the ability to collect touch signals at or above the surface of the display 705. The touch signal may be input to the processor 701 as a control signal for processing. At this time, the display 705 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 705 may be one, providing a front panel of the control device 700; in other embodiments, the display 705 may be at least two, respectively disposed on different surfaces of the control device 700 or in a folded design; in still other embodiments, the display 705 may be a flexible display disposed on a curved surface or a folded surface of the control device 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 705 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 706 is used to capture images or video. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is disposed on a front panel of the control device, and the rear camera is disposed on a rear surface of the control device. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing, or inputting the electric signals to the radio frequency circuit 704 for voice communication. The microphones may be provided in a plurality of different portions of the control apparatus 700 for the purpose of stereo sound collection or noise reduction. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 707 may also include a headphone jack.
The power supply 708 is used to power the various components in the control device 700. The power source 708 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power source 708 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the control device 700 further includes one or more sensors 709. The one or more sensors 709 include, but are not limited to: acceleration sensor 710, gyro sensor 711, pressure sensor 712, optical sensor 713, and proximity sensor 714.
The acceleration sensor 710 may detect the magnitudes of accelerations on three coordinate axes of the coordinate system established by the control device 700. For example, the acceleration sensor 710 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 701 may control the display screen 705 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 710. Acceleration sensor 710 may also be used for the acquisition of motion data of a game or user.
The gyro sensor 711 may detect a body direction and a rotation angle of the control apparatus 700, and the gyro sensor 711 may collect a 3D motion of the user on the control apparatus 700 in cooperation with the acceleration sensor 710. The processor 701 may implement the following functions according to the data collected by the gyro sensor 711: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 712 may be disposed on a side frame of the control device 700 and/or below the display screen 705. When the pressure sensor 712 is disposed at a side frame of the control apparatus 700, a grip signal of the control apparatus 700 by a user may be detected, and the processor 701 performs a left-right hand recognition or a quick operation according to the grip signal collected by the pressure sensor 712. When the pressure sensor 712 is disposed at the lower layer of the display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The optical sensor 713 is used to collect the intensity of ambient light. In one embodiment, the processor 701 may control the display brightness of the display screen 705 based on the ambient light intensity collected by the optical sensor 713. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 705 is turned up; when the ambient light intensity is low, the display brightness of the display screen 705 is turned down. In another embodiment, the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 713.
A proximity sensor 714, also known as a distance sensor, is typically provided on the front panel of the control device 700. The proximity sensor 714 is used to capture the distance between the user and the front face of the control device 700. In one embodiment, when the proximity sensor 714 detects that the distance between the user and the front face of the control device 700 gradually decreases, the processor 701 controls the display screen 705 to switch from the bright screen state to the off screen state; when the proximity sensor 714 detects that the distance between the user and the front surface of the control device 700 gradually increases, the processor 701 controls the display screen 705 to switch from the off-screen state to the on-screen state.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is not limiting of the control device 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
The embodiment of the application also provides a computer readable storage medium, wherein at least one program code is stored in the computer readable storage medium, and the at least one program code is loaded and executed by a processor to realize the pressure testing method according to any implementation manner. Alternatively, the storage medium may be a non-transitory computer readable storage medium, for example, a ROM (Read-Only Memory), a RAM (Random Access Memory ), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
The embodiment of the application also provides a computer program product, the computer program product comprises computer program code, the computer program code is stored in a computer readable storage medium, a processor of the electronic device reads the computer program code from the computer readable storage medium, and the processor executes the computer program code to enable the electronic device to execute the pressure testing method of any implementation mode.
In some embodiments, the computer program product according to the embodiments of the present application may be deployed to be executed on one electronic device or on a plurality of electronic devices located at one site, or alternatively, may be executed on a plurality of electronic devices distributed at a plurality of sites and interconnected by a communication network, where the plurality of electronic devices distributed at the plurality of sites and interconnected by the communication network may constitute a blockchain system.
The foregoing is illustrative of the present invention and is not to be construed as limiting thereof, but rather as being included within the spirit and principles of the present invention.
Claims (10)
1. A method of pressure testing, the method comprising:
Acquiring first test configuration information of a target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information;
configuring a reference test script based on the first test configuration information to obtain a first test script, wherein the test configuration information of the first test script is the first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information;
and building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the first test program, and performing pressure test on the target application program in the test environment based on the pressure test index.
2. The method of claim 1, wherein the building the test environment of the target application by the building program, simulating the stress test index of the target application by the first test program, and performing stress test on the target application in the test environment based on the stress test index, comprises:
Building a test environment of the target application program in pressure test equipment based on the building program;
simulating the pressure test index of the target application program in a pressure application device through the first test program, so that the pressure application device applies pressure to the pressure test device based on the pressure test index, and the pressure test device is used for running the target application program in the test environment based on the pressure applied by the pressure application device to realize pressure test of the target application program.
3. The method according to claim 2, wherein the method further comprises:
and controlling the pressure applying device to establish test connection with the pressure testing device based on the device address, the pressure testing account number and the password of the pressure applying device, wherein the test connection is used for the pressure applying device to apply pressure to the pressure testing device based on the pressure testing index.
4. The method according to claim 2, wherein the building the test environment of the target application in the stress test device based on the build program comprises:
If the target application program is an application program in a distributed system, respectively building test environments of the target application program in a plurality of pressure test devices included in the distributed system based on the building program;
the pressure application device is further used for respectively applying pressure to the plurality of pressure test devices based on the pressure test indexes, and the plurality of pressure test devices are used for running the target application program in the test environment based on the pressure applied by the pressure application device so as to realize pressure test of the target application program.
5. The method according to claim 1, wherein the method further comprises:
acquiring a pressure test report of the target application program, wherein the pressure test report comprises pressure performance indexes of the target application program;
modifying the first test configuration information to obtain second test configuration information under the condition that the pressure performance index does not reach the standard, wherein the second test configuration information comprises the environment configuration information and second pressure configuration information;
configuring the reference test script based on the second test configuration information to obtain a second test script, wherein the test configuration information of the second test script is the second test configuration information, the second test script comprises the building program and a second test program, and the pressure test index of the second test program is a pressure test index corresponding to the second pressure configuration information;
And building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the second test program, and performing pressure test on the target application program in the test environment based on the pressure test index until a pressure test report with the pressure performance index reaching the standard is obtained.
6. The method of claim 1, wherein the environment configuration information includes at least one of an interface address, a request data, a request mode, a request header, a test step, and a device address of the pressure applying device;
the first pressure configuration information comprises at least one of a thread number and an execution duration;
wherein the interface address is an interface address between the pressure applying device and a pressure testing device;
the request data is the data requested by the target application program;
the request mode is the mode of requesting data;
the request header is a request header for requesting the request data;
the testing step is a step of performing pressure testing on the target application program;
the pressure applying device is a device for applying pressure to the pressure testing device;
The thread number is the thread number of the target application program running simultaneously in the process of performing the pressure test;
the execution time period is the time period when the pressure applying device applies pressure to the pressure testing device.
7. A pressure testing device, the device comprising:
the first acquisition module is used for acquiring first test configuration information of the target application program, wherein the first test configuration information comprises environment configuration information and first pressure configuration information;
the configuration module is used for configuring a reference test script based on the first test configuration information to obtain a first test script, wherein the test configuration information of the first test script is the first test configuration information, the first test script comprises a building program and a first test program, a building object of the building program is a test environment corresponding to the environment configuration information, and a pressure test index of the first test program is a pressure test index corresponding to the first pressure configuration information;
the test module is used for building a test environment of the target application program through the building program, simulating a pressure test index of the target application program through the first test program, and carrying out pressure test on the target application program in the test environment based on the pressure test index.
8. A control device comprising one or more processors and one or more memories, the one or more memories having stored therein at least one program code loaded and executed by the one or more processors to implement the pressure testing method of any of claims 1-6.
9. A computer readable storage medium having stored therein at least one program code, the at least one program code loaded and executed by a processor to implement the pressure testing method of any one of claims 1 to 6.
10. A computer program product, characterized in that the computer program product comprises a computer program code, which is stored in a computer readable storage medium, from which computer program code a processor of a control device reads, which processor executes the computer program code, so that the control device performs the pressure testing method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211702419.2A CN116126699A (en) | 2022-12-28 | 2022-12-28 | Pressure testing method, device, equipment, storage medium and product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211702419.2A CN116126699A (en) | 2022-12-28 | 2022-12-28 | Pressure testing method, device, equipment, storage medium and product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116126699A true CN116126699A (en) | 2023-05-16 |
Family
ID=86309449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211702419.2A Pending CN116126699A (en) | 2022-12-28 | 2022-12-28 | Pressure testing method, device, equipment, storage medium and product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116126699A (en) |
-
2022
- 2022-12-28 CN CN202211702419.2A patent/CN116126699A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111177013B (en) | Log data acquisition method, device, computer equipment and storage medium | |
CN111045931B (en) | Application program testing method, device, equipment and storage medium | |
CN110837473B (en) | Application program debugging method, device, terminal and storage medium | |
CN113204298B (en) | Method and device for displaying release progress, electronic equipment and storage medium | |
CN109445577B (en) | Virtual room switching method and device, electronic equipment and storage medium | |
CN111241499B (en) | Application program login method, device, terminal and storage medium | |
CN110392375B (en) | WiFi network channel modification method, terminal, server and storage medium | |
CN110784370B (en) | Method and device for testing equipment, electronic equipment and medium | |
CN111858382A (en) | Application program testing method, device, server, system and storage medium | |
CN111290896A (en) | Server pressure testing method, device, equipment and medium | |
CN113051015A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN110045958B (en) | Texture data generation method, device, storage medium and equipment | |
CN113377647B (en) | Page processing method, device, server, terminal and readable storage medium | |
CN112529871B (en) | Method and device for evaluating image and computer storage medium | |
CN111128115B (en) | Information verification method and device, electronic equipment and storage medium | |
CN112988254B (en) | Method, device and equipment for managing hardware equipment | |
CN113518261A (en) | Method and device for guiding video playing, computer equipment and storage medium | |
CN114594751B (en) | Method, device and equipment for testing vehicle functions and computer readable storage medium | |
CN112764824B (en) | Method, device, equipment and storage medium for triggering identity verification in application program | |
CN116126699A (en) | Pressure testing method, device, equipment, storage medium and product | |
CN112612540A (en) | Data model configuration method and device, electronic equipment and storage medium | |
CN111666214B (en) | Client fault tolerance test method, device, terminal, server and storage medium | |
CN114816187B (en) | Control display method, device, computer equipment and medium | |
CN112035823B (en) | Data acquisition method, device, terminal and storage medium | |
CN110164450B (en) | Login method, login device, playing 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 |