CN112882948A - Stability testing method, device and system for application and storage medium - Google Patents

Stability testing method, device and system for application and storage medium Download PDF

Info

Publication number
CN112882948A
CN112882948A CN202110277663.8A CN202110277663A CN112882948A CN 112882948 A CN112882948 A CN 112882948A CN 202110277663 A CN202110277663 A CN 202110277663A CN 112882948 A CN112882948 A CN 112882948A
Authority
CN
China
Prior art keywords
test
application
tested
stability
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110277663.8A
Other languages
Chinese (zh)
Inventor
刘京京
李鹏
郑伟田
李安琪
张嘉真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Digital Guangdong Network Construction Co Ltd
Original Assignee
Digital Guangdong Network Construction Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Digital Guangdong Network Construction Co Ltd filed Critical Digital Guangdong Network Construction Co Ltd
Priority to CN202110277663.8A priority Critical patent/CN112882948A/en
Publication of CN112882948A publication Critical patent/CN112882948A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

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)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the disclosure discloses a method, a device and a system for testing stability of an application and a storage medium. The method comprises the following steps: acquiring test configuration data corresponding to an application to be tested; generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested; and acquiring a request result fed back by the source server, and generating a test log based on the request result. According to the scheme, the stability test system can be used for accurately and efficiently testing the stability of the application to be tested, and is beneficial to visually monitoring the stability of the application to be tested according to the test log.

Description

Stability testing method, device and system for application and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular relates to a method, a device and a system for testing stability of an application and a storage medium.
Background
With the rapid development of internet applications, various network applications are emerging. Technologies such as APP, small programs, H5, RESTful API and the like, and complex and various network links enable development and testing personnel to have certain limitations and bottlenecks in stability verification and tracking of software and hardware full links such as database query, interface layers, network layers and the like. In actual production application, the internet application stability lacks a plug-and-play visual monitoring service, lacks monitoring application early warning and message reminding media, and the service stability-oriented delivery is easy to have blind spots.
Disclosure of Invention
The embodiment of the disclosure provides an application stability test method, device and system and a storage medium, which can accurately and efficiently test the stability of an application through a stability test system and visually monitor the stability of the application according to a test log.
In a first aspect, an embodiment of the present disclosure provides an application stability testing method, which is applied to a stability testing system, and includes:
acquiring test configuration data corresponding to an application to be tested;
generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested;
and acquiring a request result fed back by the source server, and generating a test log based on the request result.
In a second aspect, an embodiment of the present disclosure further provides an applied stability testing apparatus, which is applied to a stability testing system, and includes:
the configuration data acquisition module is used for acquiring test configuration data corresponding to the application to be tested;
the test request generation module is used for generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data and sending the HTTP test request to a source server of the application to be tested;
and the test log generation module is used for acquiring the request result fed back by the source server and generating a test log based on the request result.
In a third aspect, an embodiment of the present disclosure further provides a stability testing system, where the stability testing system includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the stability testing method for the application according to the embodiment of the disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer readable medium, on which a computer program is stored, where the computer program, when executed by a processing device, implements a stability testing method for an application according to the disclosed embodiments.
The embodiment of the disclosure provides a stability test scheme applied to an application of a stability test system, and test configuration data corresponding to an application to be tested is acquired; generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested; and acquiring a request result fed back by the source server, and generating a test log based on the request result. According to the technical scheme provided by the embodiment of the disclosure, the stability test system can be used for accurately and efficiently testing the stability of the application to be tested, and the visual monitoring of the stability of the application to be tested according to the test log is facilitated.
Drawings
FIG. 1 is a flow chart of a method for stability testing of an application in one embodiment of the present disclosure;
FIG. 2 is a flow chart of a stability testing method for an application in another embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for stability testing of an application in yet another embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of a stability testing apparatus for an application in another embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a stability testing system in another embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart of a method for testing stability of an application according to an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case of performing a stability test on an application, and the method may be performed by an application stability testing apparatus, which may be composed of hardware and/or software and may be generally integrated in a stability testing system or a stability testing platform having an application stability testing function. As shown in fig. 1, the method specifically includes the following steps:
step 110, obtaining test configuration data corresponding to the application to be tested.
In the embodiment of the present disclosure, the application to be tested is an application to be subjected to a stability test, wherein the application to be tested may include various network applications, such as an application program, an applet, an H5 application, an API interface, and the like. The test configuration data may include configuration information corresponding to when a certain test task is executed on the application to be tested, for example, the test configuration data may include configuration information such as a name, a request type, a request parameter, and an assertion of the test application.
In the embodiment of the present disclosure, test configuration data corresponding to an application to be tested is obtained. Specifically, test configuration data corresponding to the application to be tested may be read from a pre-stored test configuration database; and test configuration data corresponding to the application to be tested and input by developers or testers can be received in real time. Each application to be tested has a plurality of service functions, and stability test can be performed on each service function of the application to be tested, so that a corresponding test task can be established for each service function of the application to be tested, that is, each task to be tested can correspond to a plurality of test tasks, and each test task corresponds to a group of test configuration data. Therefore, the obtained test configuration data may be one group or multiple groups, that is, at least one group of test configuration data corresponding to the application to be tested is obtained. In addition, the number of applications to be tested may be one or more. It should be noted that, in the embodiment of the present disclosure, the number of applications to be tested and the number of test configuration data corresponding to each application to be tested are not limited.
And 120, generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested.
In the embodiment of the present disclosure, based on the test configuration data corresponding to the application to be tested, an HTTP (HyperText Transfer Protocol) test request corresponding to the test configuration data is generated. It can be understood that the test configuration data corresponding to the application to be tested is encapsulated into the HTTP test request according to the HTTP format, where the HTTP test request includes the test configuration data. For example, at least two sets of test configuration data corresponding to a certain application to be tested are obtained, and an HTTP test request corresponding to the set of test configuration data is generated for each set of test configuration data. It will be appreciated that each set of test configuration data corresponds to an HTTP test request.
Optionally, generating a corresponding hypertext transfer protocol HTTP test request based on the test configuration data includes: carrying out syntax analysis on the test configuration data to generate an HTTP request syntax tree; and generating an HTTP test request based on the parameter information corresponding to each node in the HTTP request syntax tree. The advantage of this arrangement is that HTTP test requests can be generated quickly. Specifically, the test configuration data is parsed, and an HTTP request syntax tree is constructed according to the parsing result. It is understood that the HTTP request syntax tree reflects the structure of the test configuration data, and each node of the HTTP request syntax tree includes parameter information in the test configuration data. And extracting parameter information corresponding to each node in the HTTP request syntax tree, and generating an HTTP test request based on the parameter information according to an HTTP form.
In the embodiment of the disclosure, after the HTTP test request is generated, the HTTP test request is sent to the source server of the application to be tested, so as to perform the stability test on the application to be tested. The source server of the application to be tested can be understood as a server providing various services for the application to be tested. After receiving the HTTP test request, the source server of the application to be tested can analyze the HTTP test request and obtain a test result corresponding to the HTTP test request. For example, the source server of the application to be tested may analyze a header and/or a body of the HTTP test request, obtain content information obtained by the HTTP test request, if the content information can be successfully obtained, use the obtained content information as a test result corresponding to the HTTP test request, and if the content information cannot be successfully obtained, use error information as a test result corresponding to the HTTP test request. Optionally, before sending the HTTP test request to the source server of the application to be tested, domain name connectivity verification and correctness verification may be performed on the HTTP test request, where the domain name connectivity verification may effectively ensure that the HTTP test request may successfully access the source server of the application to be tested, and the correctness verification may effectively ensure that the HTTP test request is a test request generated for the application to be tested, so as to prevent access to the source server of other applications (applications not to be tested) based on the HTTP request.
And step 130, obtaining a request result fed back by the source server, and generating a test log based on the request result.
In the embodiment of the disclosure, a request result corresponding to the HTTP request fed back by the source server is obtained. Wherein, the test result may include: when the source server is capable of providing a service corresponding to the HTTP test request, request response data corresponding to the HTTP test request may further include: and when the source server cannot provide the service corresponding to the HTTP test request, requesting the feedback information of failure. Illustratively, a test log is generated based on a request result fed back by the source server, so that the stability test of the application to be tested is realized. The stability test is to verify that the application to be tested can continuously and normally output ideal results facing various business requirements when being used continuously in production. The test log may record not only the request result, but also test information related to the request result, such as feedback time of the request result, type of the request result, name of the request result, and test related parameter information of the test application corresponding to the request result.
The embodiment of the disclosure provides a stability test method applied to an application of a stability test system, which is used for acquiring test configuration data corresponding to an application to be tested; generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested; and acquiring a request result fed back by the source server, and generating a test log based on the request result. According to the technical scheme, the stability test system can accurately and efficiently test the stability of the application to be tested, the availability of the application to be tested is improved, and the visual monitoring of the stability of the application to be tested according to the test log is facilitated.
In some embodiments, obtaining test configuration data corresponding to an application to be tested includes: in response to an application stability test instruction, polling and detecting the switch state of each test application, and taking the test application in the open state as an application to be tested; and loading the test configuration data corresponding to the application to be tested from a pre-stored test configuration database based on a hot loading mode. Specifically, when an application stability test instruction input by a tester or a developer is received, a characterization application stability test event is triggered, at this time, the on-off state of each test application is polled and detected, and the test application in the on state is used as the current application to be tested. It can be understood that the stability testing system or the stability testing platform may perform the stability testing on a plurality of applications, but at a certain time, a tester or a developer needs to test one or more of the applications, and therefore, the on-off state of each test application may be polled to determine which applications need to be tested at the current time. After the application to be tested needing stability testing is determined, the test configuration data corresponding to the application to be tested is loaded from the pre-stored test configuration database based on the hot loading mode. Because a tester or a developer may modify the pre-stored test configuration data in the test configuration database according to the test requirements, and load the test configuration data corresponding to the application to be tested based on a hot loading mode, the modified test configuration data can be effectively ensured to be effective in time, thereby ensuring that the latest test configuration data corresponding to the application to be tested is obtained from the test configuration database, realizing the plug-and-play visual monitoring of the stability of the application to be tested, and solving the technical problem of low application test data building efficiency.
In some embodiments, the applications to be tested are at least two; before loading the test configuration data corresponding to the application to be tested from the pre-stored test configuration database, the method further includes: starting at least two stability test processes of the application to be tested; loading test configuration data corresponding to the application to be tested from a pre-stored test configuration database, wherein the test configuration data comprises: and based on each stability test process, loading the test configuration data corresponding to the application to be tested in parallel from a pre-stored test configuration database. The stability test method has the advantages that stability test can be conducted on multiple applications to be tested in parallel, the technical problem that the multiple applications are separately tested and high in cost is solved, and the stability test efficiency of the multiple applications is effectively improved. Specifically, the number of the applications to be tested may be one or multiple, and when the number of the applications to be tested is at least two, the stability test processes of the at least two applications to be tested are established, it can be understood that the number of the stability test processes is the same as the number of the applications to be tested. And based on each stability test process, loading the test configuration data corresponding to each application to be tested in parallel from a pre-stored test configuration database.
In some embodiments, before polling and detecting the switch state of each test application in response to an application stability test instruction, the method further includes obtaining a test case of each test application; aiming at the test cases of the test applications, converting the test cases into basic character strings in an HTTP format, and taking the basic character strings as test configuration data corresponding to the test applications; and storing the test configuration data corresponding to each test application in a test configuration database. Specifically, a test case of each test application input by a tester or a developer is obtained, where the test case is a description of a certain test task of an application to be tested, the content of the test case may include a test target, a test environment, input data, test steps, an expected result, a test script, and other relevant information, and the test case is intended to be a set of test input, execution conditions, and an expected result compiled for a certain special target and used to verify whether a requirement of the application to be tested is met. For example, for a test case of each test application, the test case may be converted into a basic character string in the HTTP format based on a filter in a special format (e.g., a filter in the HTTP format), and the basic character string is used as test configuration data corresponding to the test application. The test configuration data corresponding to each test application is stored in the test configuration database, and it can be understood that the test configuration database stores the test configuration data in the HTTP format corresponding to each test application. The test configuration database may be a MySQL database.
In some embodiments, after generating the test log based on the request result, further comprising: calculating a stability value of the application to be tested based on a test log generated in a preset time period; and when the stability value is smaller than a preset threshold value, carrying out early warning prompt. The advantage that sets up like this lies in, through carrying out stability test to the application that awaits measuring, when confirming that the application stability that awaits measuring is unusual, can carry out the early warning suggestion, can effectively guarantee the stability of the application that awaits measuring. Specifically, within a preset time period, the application stability test scheme provided by the embodiment of the present disclosure may be used to send the HTTP test request to the source server of the application to be tested for multiple times, and obtain a request result fed back by the source server for each HTTP test request, so that a test log generated within the preset time period may include a result of each request. And calculating the stability value of the application to be tested based on the request result of the test log generated in the preset time period. Optionally, calculating the stability value of the application to be tested based on the test log generated in the preset time period includes: and calculating a request success rate or an assertion success rate aiming at the HTTP test request based on a test log generated in a preset time period, and taking the request success rate or the assertion success rate as a stability value of the application to be tested. Specifically, the HTTP test request may be a service request for obtaining service data, or may be an assertion request for determining whether the result of the HTTP test request is consistent with the assertion result. When the HTTP test request is a service request, the request success rate of the HTTP test request can be calculated based on a test log generated in a preset time period, and the request success rate is used as the stability value of the application to be tested, wherein the higher the request success rate is, the better the stability of the application to be tested is represented. The request success rate is a ratio of the number of times of request success (the source server can feed back correct request data for the HTTP test request) to the total number of times of sending the HTTP test request, where the request result fed back for the HTTP test request within a preset time period is. When the HTTP test request is an assertion request, the assertion success rate of the HTTP test request can be calculated based on a test log generated in a preset time period, and the assertion success rate is used as a stability value of the application to be tested, wherein the higher the assertion success rate is, the better the stability of the application to be tested is represented. The assertion success rate is a ratio of the number of times of successful assertion (the request result fed back by the source server for the HTTP test request and the request result of a constant assertion result) to the total number of times of sending the HTTP test request. The advantage of setting in this way is that by adopting assertion detection, the detection of key use cases can be covered, and abnormal capture which cannot cover a service layer such as data loss is solved. And judging whether the stability value of the application to be tested is smaller than a preset threshold value, if so, indicating that the stability of the application to be tested is poor, and performing early warning prompt. The early warning prompting mode may include a voice early warning mode, or a flashing prompting mode for the identifier of the application to be tested, and it should be noted that the early warning prompting mode is not limited in the embodiments of the present disclosure.
Optionally, when the stability value is smaller than the preset threshold, performing an early warning prompt, including: when the stability is smaller than a preset threshold value, inputting the test log into a stability analysis module, and determining an analysis result with poor stability according to an output result of the stability analysis module; when the analysis result is not caused by network fluctuation, early warning prompt can be carried out. Optionally, when the analysis result is that the stability of the application to be tested is poor due to network fluctuation, the early warning prompt may not be performed. The stability analysis module is a machine learning model capable of rapidly determining reasons causing poor stability of the application to be tested. Specifically, a large number of test logs of applications with different poor stability and the reasons for generating the corresponding poor stability of the applications can be obtained, the data are used as training samples of the stability analysis model, and the training samples are input into a preset machine learning model to generate the stability analysis model. The advantage of setting up like this can solve the invalid early warning that leads to because of network fluctuation through data model analysis to promote the availability and the rate of accuracy of using.
Optionally, when the number of the applications to be tested is at least two, or the test configuration data corresponding to the applications to be tested is multiple, the stability value of the applications to be tested may be calculated based on the test log in the preset time period, and then a request result tree is constructed based on the stability value and the parameter information in the test log, where the request result tree includes related information such as a test name, a test type, and a stability value corresponding to each application to be tested. And traversing the request result tree, determining the application to be tested with the request result tree stability value smaller than a preset threshold value, and calling an early warning module to perform early warning prompt.
Fig. 2 is a flowchart of a stability testing method for an application in another embodiment of the present disclosure, as shown in fig. 2, the method includes the following steps:
step 210, obtaining a test case of each test application.
Step 220, aiming at the test case of each test application, converting the test case into a basic character string in the HTTP format, and taking the basic character string as test configuration data corresponding to the test application.
Step 230, responding to the application stability test instruction, polling and detecting the switch state of each test application, and taking the test application in the open state as the application to be tested; wherein, the number of the applications to be tested is at least two.
Step 240, starting the stability test processes of at least two applications to be tested.
And 250, based on each stability test process, parallelly loading test configuration data corresponding to the application to be tested from a pre-stored test configuration database in a hot loading mode.
Step 260, performing syntax analysis on the test configuration data to generate an HTTP request syntax tree.
And 270, generating an HTTP test request based on the parameter information corresponding to each node in the HTTP request syntax tree, and sending the HTTP test request to the source server of the application to be tested.
Step 280, obtaining a request result fed back by the source server, and generating a test log based on the request result.
Step 290, calculating a request success rate or an assertion success rate for the HTTP test request based on the test log generated within the preset time period, and using the request success rate or the assertion success rate as a stability value of the application to be tested.
And step 2100, when the stability value is smaller than a preset threshold value, performing early warning prompt.
The embodiment of the disclosure provides a stability testing scheme applied to a stability testing system, which can accurately and efficiently test the stability of an application to be tested through the stability testing system, and is beneficial to visually monitoring the stability of the application to be tested according to a test log. In addition, the test configuration data of each test application is stored in the database in advance, when the stability test is needed, the on-off state of each test application is detected through polling, the application to be tested is determined from each test application, and the test configuration data of each application to be tested is loaded in parallel based on a hot loading mode from the configuration database, so that the latest test configuration data corresponding to the application to be tested can be obtained from the test configuration database, the plug-and-play visual monitoring on the stability of the application to be tested is realized, the stability test can be performed on a plurality of applications to be tested in parallel, and the technical problem of high cost of individually testing the plurality of applications is solved. In addition, when the application stability determined based on the test log is low, early warning prompt can be performed, and the stability of the application to be tested can be effectively guaranteed.
FIG. 3 is a flow chart of a stability testing method for one application in the practice of the present disclosure. As shown in fig. 3, the stability test system obtains test cases of the application to be tested, which are input by a tester or a developer, and stores each test case in the MySQL database. The application to be tested can be managed in groups according to the function of the application to be tested.
Illustratively, the group management further includes the following: classifying the test cases to be tested according to the first-level function, grouping the test cases into a first-level father-class test column, classifying the test cases after the test in the first-level father-class test column, grouping the test cases into a first-level subclass test column, classifying the test cases after the test in the first-level subclass test column, grouping the test cases into a first-level sub-subclass test column, setting the test of the second-level function according to the specific test requirement until the first-level function is completely tested, distributing the test cases to be tested to the second-level father-class test column, and similarly, completing the test of the second-level function. For example, functions such as home page, personal service, legal service, government affair disclosure and the like are first-level functions and are allocated to a first-level parent class test column, wherein passports, drivers licenses, housekeeping, marits and the like corresponding to the home page are first-level subclass functions and are allocated to a first-level subclass test column, and endorsements, queries, records and the like corresponding to the passport functions are first-level subclass test functions and are allocated to a first-level subclass test column until all the first-level function tests are finished. And if the first-stage function home page contains other websites, setting the other website test as a second-stage function test according to the test configuration data. Therefore, the purpose of quickly calling the test cases of the application to be tested according to different functional groups can be achieved, and the test efficiency is improved.
Illustratively, the application to be tested comprises 5 functions, each function comprises a corresponding sub-function, wherein the 5 functions respectively correspond to one large test case, each large test case comprises a plurality of sub-test cases, and each sub-test case respectively corresponds to each sub-function under the function. And based on each function of the application to be tested, grouping and managing the test cases with different functions. When the stability test is performed on the application to be tested, the corresponding functions can be tested in parallel based on each test case. When the sub-functions under each function are tested, the corresponding sub-functions can be tested in parallel based on each sub-test case in the test case. The advantage of this arrangement is that the efficiency of the stability test for the application under test can be effectively provided.
In the embodiment of the invention, the MySQL database can be used for carrying out persistent storage on each test case; then, loading each test case from the database, and converting the test case into corresponding test configuration data in the HTTP format through a filter, for example, four test cases may be converted into corresponding test configuration data (test configuration data 1, test configuration data 2, test configuration data 3, and test configuration data 4) based on four different filters (filter 1, filter 2, filter 3, and filter 4), and storing each test configuration data in the MySQL database; when one or more applications in the test applications need to be subjected to stability test, loading test configuration data corresponding to the applications to be tested from the MySQL database, testing the stability of the applications to be tested based on the test configuration data, and generating a test log. For example, a corresponding HTTP test request may be generated based on the test configuration data, the HTTP test request is sent to the source server of the application to be tested, a request result fed back by the source server is obtained, and a test log is generated based on the request result. And then storing the test log in a MySQL database, and loading the test log from the MySQL database and displaying the test log when the test log needs to be displayed. In addition, a stability value to be applied can be estimated based on the test log, wherein the stability value can be a request success rate or an assertion success rate, and whether to perform early warning is judged according to the stability value, and if the stability value is smaller than a preset threshold value, the early warning is performed. The early warning modes for different applications to be tested can be the same or different.
Fig. 4 is a schematic structural diagram of an applied stability testing apparatus according to another embodiment of the present disclosure. As shown in fig. 4, the apparatus includes: a configuration data acquisition module 410, a test request generation module 420 and a test log generation module 430.
A configuration data obtaining module 410, configured to obtain test configuration data corresponding to an application to be tested;
a test request generating module 420, configured to generate a corresponding hypertext transfer protocol HTTP test request based on the test configuration data, and send the HTTP test request to a source server of the application to be tested;
and the test log generating module 430 is configured to obtain a request result fed back by the source server, and generate a test log based on the request result.
The embodiment of the disclosure provides a stability testing device applied to an application of a stability testing system, which is used for acquiring test configuration data corresponding to an application to be tested; generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested; and acquiring a request result fed back by the source server, and generating a test log based on the request result. According to the technical scheme provided by the embodiment of the disclosure, the stability test system can be used for accurately and efficiently testing the stability of the application to be tested, and the visual monitoring of the stability of the application to be tested according to the test log is facilitated.
Optionally, the test request generating module is configured to:
carrying out syntax analysis on the test configuration data to generate an HTTP request syntax tree;
and generating an HTTP test request based on the parameter information corresponding to each node in the HTTP request syntax tree.
Optionally, the configuration data obtaining module includes:
the device comprises an application to be tested determining unit, a test application switching unit and a test application switching unit, wherein the application to be tested determining unit is used for responding to an application stability test instruction, polling and detecting the switching state of each test application, and taking the test application in the starting state as the application to be tested;
and the configuration data loading unit is used for loading the test configuration data corresponding to the application to be tested from a pre-stored test configuration database based on a hot loading mode.
Optionally, the number of the applications to be tested is at least two;
the device further comprises:
the test process starting module is used for starting the stability test processes of at least two applications to be tested before loading the test configuration data corresponding to the applications to be tested from a pre-stored test configuration database;
the configuration data loading unit is configured to:
and based on each stability test process, loading the test configuration data corresponding to the application to be tested in parallel from a pre-stored test configuration database.
Optionally, also include
The test case acquisition module is used for acquiring the test cases of the test applications before responding to the application stability test instruction and polling and detecting the switch states of the test applications;
the test case conversion module is used for converting the test cases into basic character strings in an HTTP format aiming at the test cases of the test applications, and taking the basic character strings as test configuration data corresponding to the test applications;
and the configuration data storage module is used for storing the test configuration data corresponding to each test application in the test configuration database.
Optionally, the apparatus further comprises:
the stability value calculation module is used for calculating the stability value of the application to be tested based on the test log generated in a preset time period after the test log is generated based on the request result;
and the early warning prompting module is used for carrying out early warning prompting when the stability value is smaller than a preset threshold value.
Optionally, the stability value calculating module is configured to:
and calculating a request success rate or an assertion success rate aiming at the HTTP test request based on a test log generated in a preset time period, and taking the request success rate or the assertion success rate as a stability value of the application to be tested.
The device can execute the methods provided by all the embodiments of the disclosure, and has corresponding functional modules and beneficial effects for executing the methods. For technical details which are not described in detail in the embodiments of the present disclosure, reference may be made to the methods provided in all the aforementioned embodiments of the present disclosure.
Referring now to FIG. 5, a schematic diagram of a stability testing system 500 suitable for use in implementing embodiments of the present disclosure is shown. The stability test system in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like, or various forms of servers such as a stand-alone server or a server cluster. The stability testing system shown in fig. 5 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the stability testing system 500 may include a processing device (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a read-only memory device (ROM)502 or a program loaded from a storage device 505 into a random access memory device (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the stability testing system 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the stability testing system 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates the stability testing system 500 with various devices, it is to be understood that not all of the illustrated devices are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program containing program code for performing a method for recommending words. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 505, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP, and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the stability testing system; or may exist alone without being assembled into the stability testing system.
The computer readable medium carries one or more programs which, when executed by the stability testing system, cause the stability testing system to: acquiring test configuration data corresponding to an application to be tested; generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested; and acquiring a request result fed back by the source server, and generating a test log based on the request result. Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, an embodiment of the present disclosure provides an application stability testing method, including:
acquiring test configuration data corresponding to an application to be tested;
generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested;
and acquiring a request result fed back by the source server, and generating a test log based on the request result.
Further, generating a corresponding hypertext transfer protocol HTTP test request based on the test configuration data includes:
carrying out syntax analysis on the test configuration data to generate an HTTP request syntax tree;
and generating an HTTP test request based on the parameter information corresponding to each node in the HTTP request syntax tree.
Further, obtaining test configuration data corresponding to the application to be tested includes:
in response to an application stability test instruction, polling and detecting the switch state of each test application, and taking the test application in the open state as an application to be tested;
and loading the test configuration data corresponding to the application to be tested from a pre-stored test configuration database based on a hot loading mode.
Further, the number of the applications to be tested is at least two;
before loading the test configuration data corresponding to the application to be tested from the pre-stored test configuration database, the method further includes:
starting at least two stability test processes of the application to be tested;
loading test configuration data corresponding to the application to be tested from a pre-stored test configuration database, wherein the test configuration data comprises:
and based on each stability test process, loading the test configuration data corresponding to the application to be tested in parallel from a pre-stored test configuration database.
Further, before polling and detecting the switch state of each test application in response to the application stability test instruction, the method also comprises the step of
Obtaining a test case of each test application;
aiming at the test cases of the test applications, converting the test cases into basic character strings in an HTTP format, and taking the basic character strings as test configuration data corresponding to the test applications;
and storing the test configuration data corresponding to each test application in a test configuration database.
Further, after generating a test log based on the request result, the method further includes:
calculating a stability value of the application to be tested based on a test log generated in a preset time period;
and when the stability value is smaller than a preset threshold value, carrying out early warning prompt.
Further, calculating a stability value of the application to be tested based on a test log generated within a preset time period, including:
and calculating a request success rate or an assertion success rate aiming at the HTTP test request based on a test log generated in a preset time period, and taking the request success rate or the assertion success rate as a stability value of the application to be tested.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (10)

1. An application stability test method is applied to a stability test system, and comprises the following steps:
acquiring test configuration data corresponding to an application to be tested;
generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data, and sending the HTTP test request to a source server of the application to be tested;
and acquiring a request result fed back by the source server, and generating a test log based on the request result.
2. The method of claim 1, wherein generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data comprises:
carrying out syntax analysis on the test configuration data to generate an HTTP request syntax tree;
and generating an HTTP test request based on the parameter information corresponding to each node in the HTTP request syntax tree.
3. The method of claim 1, wherein obtaining test configuration data corresponding to an application under test comprises:
in response to an application stability test instruction, polling and detecting the switch state of each test application, and taking the test application in the open state as an application to be tested;
and loading the test configuration data corresponding to the application to be tested from a pre-stored test configuration database based on a hot loading mode.
4. The method of claim 3, wherein the applications to be tested are at least two;
before loading the test configuration data corresponding to the application to be tested from the pre-stored test configuration database, the method further includes:
starting at least two stability test processes of the application to be tested;
loading test configuration data corresponding to the application to be tested from a pre-stored test configuration database, wherein the test configuration data comprises:
and based on each stability test process, loading the test configuration data corresponding to the application to be tested in parallel from a pre-stored test configuration database.
5. The method of claim 3, further comprising prior to polling the switch states of the respective test applications in response to application stability test instructions, polling
Obtaining a test case of each test application;
aiming at the test cases of the test applications, converting the test cases into basic character strings in an HTTP format, and taking the basic character strings as test configuration data corresponding to the test applications;
and storing the test configuration data corresponding to each test application in a test configuration database.
6. The method of claim 1, after generating a test log based on the request result, further comprising:
calculating a stability value of the application to be tested based on a test log generated in a preset time period;
and when the stability value is smaller than a preset threshold value, carrying out early warning prompt.
7. The method of claim 1, wherein calculating the stability value of the application under test based on the test log generated within a preset time period comprises:
and calculating a request success rate or an assertion success rate aiming at the HTTP test request based on a test log generated in a preset time period, and taking the request success rate or the assertion success rate as a stability value of the application to be tested.
8. An applied stability testing device, which is applied to a stability testing system, comprises:
the configuration data acquisition module is used for acquiring test configuration data corresponding to the application to be tested;
the test request generation module is used for generating a corresponding hypertext transfer protocol (HTTP) test request based on the test configuration data and sending the HTTP test request to a source server of the application to be tested;
and the test log generation module is used for acquiring the request result fed back by the source server and generating a test log based on the request result.
9. A stability testing system, characterized in that the stability testing system comprises:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement a stability testing method for an application as claimed in any one of claims 1 to 7.
10. A computer-readable medium, on which a computer program is stored, which program, when being executed by processing means, is adapted to carry out a stability testing method for an application according to any one of claims 1-7.
CN202110277663.8A 2021-03-15 2021-03-15 Stability testing method, device and system for application and storage medium Pending CN112882948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110277663.8A CN112882948A (en) 2021-03-15 2021-03-15 Stability testing method, device and system for application and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110277663.8A CN112882948A (en) 2021-03-15 2021-03-15 Stability testing method, device and system for application and storage medium

Publications (1)

Publication Number Publication Date
CN112882948A true CN112882948A (en) 2021-06-01

Family

ID=76042054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110277663.8A Pending CN112882948A (en) 2021-03-15 2021-03-15 Stability testing method, device and system for application and storage medium

Country Status (1)

Country Link
CN (1) CN112882948A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220588A (en) * 2021-06-02 2021-08-06 北京锐安科技有限公司 Automatic testing method, device and equipment for data processing and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897219A (en) * 2017-02-14 2017-06-27 深圳市广和通无线通信软件有限公司 mobile terminal system stability test method and device
CN107301122A (en) * 2017-05-10 2017-10-27 深圳市小牛在线互联网信息咨询有限公司 interface test method, device, storage medium and computer equipment
CN107480040A (en) * 2016-06-08 2017-12-15 阿里巴巴集团控股有限公司 Workflow stability test method and apparatus
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device
CN109656799A (en) * 2017-10-10 2019-04-19 北京京东尚科信息技术有限公司 Test method and device
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN112463598A (en) * 2020-11-18 2021-03-09 中信银行股份有限公司 Pressure measurement method and device, electronic equipment and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480040A (en) * 2016-06-08 2017-12-15 阿里巴巴集团控股有限公司 Workflow stability test method and apparatus
CN106897219A (en) * 2017-02-14 2017-06-27 深圳市广和通无线通信软件有限公司 mobile terminal system stability test method and device
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device
CN107301122A (en) * 2017-05-10 2017-10-27 深圳市小牛在线互联网信息咨询有限公司 interface test method, device, storage medium and computer equipment
CN109656799A (en) * 2017-10-10 2019-04-19 北京京东尚科信息技术有限公司 Test method and device
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN112463598A (en) * 2020-11-18 2021-03-09 中信银行股份有限公司 Pressure measurement method and device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220588A (en) * 2021-06-02 2021-08-06 北京锐安科技有限公司 Automatic testing method, device and equipment for data processing and storage medium

Similar Documents

Publication Publication Date Title
CN109685089B (en) System and method for evaluating model performance
Syer et al. Continuous validation of performance test workloads
US10956257B2 (en) Dynamic failure-resolution computing engine
CN104579830B (en) service monitoring method and device
CN109543891B (en) Method and apparatus for establishing capacity prediction model, and computer-readable storage medium
CN112291121B (en) Data processing method and related equipment
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN112882948A (en) Stability testing method, device and system for application and storage medium
CN115221033A (en) Interface protocol testing method and device, computer readable medium and electronic equipment
CN116662193A (en) Page testing method and device
CN116361121A (en) Abnormal interface alarm method, device, electronic equipment and computer readable medium
CN114281704A (en) Website testing method and device, electronic equipment and medium
CN115203178A (en) Data quality inspection method and device, electronic equipment and storage medium
CN115941432A (en) Domain name alarm information sending method and device, electronic equipment and computer readable storage medium
CN113726779A (en) Rule false alarm test method and device, electronic equipment and computer storage medium
CN113704079A (en) Interface testing method and device based on Protobuf
CN111371745B (en) Method and apparatus for determining SSRF vulnerability
CN112084440B (en) Data verification method, device, electronic equipment and computer readable medium
CN117234951B (en) Function test method and device of application system, computer equipment and storage medium
CN115237816B (en) System function verification method and device, electronic equipment and readable storage medium
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN118041804A (en) Communication equipment networking data detection method and device, electronic equipment and readable medium
CN117056191A (en) Assertion program processing method, device, equipment, medium and product
CN118035065A (en) Interface testing method and device
CN115629983A (en) Test case set generation method, device, equipment and 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