Application function test method and device, storage medium and electronic device
Through the testing method of loading and associating data dependencies from the data resource pool, the problem of cumbersome and inefficient functional testing process is solved, efficient test data generation and synchronization is achieved, and testing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411213665.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-17
AI Technical Summary
In the prior art, the functional testing process is cumbersome and inefficient. Test engineers need to manually construct a large amount of test data, which is prone to errors and time-consuming, increasing the work costs of developers.
Provides a test method of application functions, which can load target data from the data resource pool by receiving the data requirements, correlate data dependencies, and synchronize test results on the visual interface, simplify the test process and improve efficiency.
Through the machining platform, the test data is prepared in advance and the dependent business data is directly generated, which improves the operation efficiency of testers and the testing efficiency of target applications, and reduces manual errors and development costs.
Smart Images

Figure CN119149418A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method, device, storage medium and electronic device for testing application functions. Background Art
[0002] In the software testing process, test data is a very important part, which can be used to verify the functions and performance of the software system. Test engineers often need to construct a large amount of test data to execute test cases. Manually constructing test data is time-consuming and labor-intensive, especially when the project schedule is tight or a large amount of test data is required. The task of manual data generation is arduous and prone to errors. For a test engineer, if data generation can be achieved with one click, it will greatly improve work efficiency and reduce the probability of errors. Therefore, building a data generation platform is a very necessary solution for test engineers. At the same time, if every data generation scenario requires the assistance of developers, this will reduce the cost of testers but greatly increase the work cost for developers.
[0003] Therefore, in view of the problem that the current functional testing process in the related technology is cumbersome and inefficient, no effective solution has been proposed. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for testing application functions, so as to at least solve the problem that the current function testing process in the related art is cumbersome and inefficient.
[0005] According to an embodiment of the present application, a method for testing an application function is provided, comprising: upon receiving a number-generating requirement input by a target object, loading target number-generating data from a number-generating resource pool according to the number-generating requirement; associating the target number-generating data with a first function corresponding to the number-generating requirement, and acquiring a second function that has a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data; upon determining to perform a test on the second function, synchronizing the target number-generating data as the test result of the first function to the second function, and displaying a first prompt message indicating that the application function test of the second function meets a test condition on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0006] In an exemplary embodiment, before loading the target number-making data from the number-making resource pool according to the number-making demand, the method further includes: determining the operation conditions preset on the visual operation interface; wherein the operation conditions include at least one of the following: preconditions, postconditions; and determining the target mode for loading data from the number-making resource pool according to the operation conditions.
[0007] In an exemplary embodiment, a target mode for loading data from the number-generating resource pool is determined based on the operating condition, including: when it is determined that the operating condition is a precondition, determining to perform data processing on the real-time data loaded from the number-generating resource pool through a weakly typed language to obtain first processed data; when it is determined that data control is currently required, identifying multiple control types of an application programming interface associated with the number-generating resource pool, wherein each control type corresponds to a type of script in a script database; selecting a first control mode that matches the data control from the multiple control types, generating a target controller, and processing the first processed data through the target controller to obtain second processed data; and determining a target mode for loading data from the number-generating resource pool based on a preset data loading mode corresponding to the second processed data.
[0008] In an exemplary embodiment, a target method for loading data from the number-generating resource pool is determined based on the operating condition, including: when it is determined that the operating condition is a post-condition, determining that there are at least two data loading paths for an application programming interface associated with the number-generating resource pool; and when it is determined that a first path among the at least two data loading paths has completed data loading and there is third processed data, allowing a second path among the at least two data loading paths to start data loading.
[0009] In an exemplary embodiment, before the second path in at least two data loading paths is allowed to start data loading, the above method also includes: extracting target parameters corresponding to the first path, wherein the extraction is implemented in at least one of the following ways: regular expression, JSONPath, XPath; adjusting the initial parameters of the second path according to the target parameters.
[0010] In an exemplary embodiment, after synchronizing the target number-generating data as the test result of the first function to the second function, and displaying a first prompt message on a visual interface associated with the target application that the application function test of the second function meets the test conditions, the above method also includes: when it is determined that the second function has completed the test, obtaining the function test result corresponding to the second function; when the function test result indicates that the second function has passed the test, determining that the target application test including the first function and the second function has succeeded; when the function test result indicates that the second function has not passed the test, determining that the target application test including the first function and the second function has failed.
[0011] In an exemplary embodiment, after determining that the target application including the first function and the second function has failed the test, the method further includes: sending a second prompt message to the target object, wherein the second prompt message is used to indicate that the current target application test of the target object has failed and the target number generation data is to be checked; receiving a target instruction from the target object for target improvement information feedback; when the target instruction indicates retesting, reloading data from the number generation resource pool; when the target instruction indicates the end of the test, identifying the target application as an application to be corrected.
[0012] According to another embodiment of the embodiment of the present application, there is also provided a testing device for application functions, including: a loading module, for loading target number-making data from a number-making resource pool according to a number-making requirement input by a target object upon receiving the number-making requirement; an acquisition module, for associating the target number-making data with a first function corresponding to the number-making requirement, and acquiring a second function having a data dependency relationship with the first function, wherein the second function uses the test result of the first function as input data; a display module, for synchronizing the target number-making data as the test result of the first function to the second function upon determining to perform a test on the second function, and displaying a first prompt message indicating that the application function test of the second function meets the test conditions on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the test method of the above-mentioned application function when running.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned method for testing the application function through the computer program.
[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps in any of the above-mentioned application function test method embodiments when the computer program is executed by a processor.
[0016] In an embodiment of the present application, when a number-making demand input by a target object is received, target number-making data is loaded from a number-making resource pool according to the number-making demand; the target number-making data is associated with a first function corresponding to the number-making demand, and a second function having a data dependency relationship with the first function is obtained, wherein the second function uses the test result of the first function as input data; when it is determined to perform a test on the second function, the target number-making data is synchronized to the second function as the test result of the first function, and a first prompt message that the application function test of the second function meets the test condition is displayed on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application. The above technical solution solves the problem that the current function test process is cumbersome and inefficient. Furthermore, the required data for the test is prepared in advance through the number-making platform, and the dependent business data is directly generated at the beginning of the test, which improves the operating efficiency of the tester and the test efficiency for the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 It is a hardware environment diagram of a method for testing an application function in an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for testing an application function according to an embodiment of the present application;
[0021] Figure 3 This is a schematic diagram of a data processing structure of an API interface according to an embodiment of the present application;
[0022] Figure 4 This is a schematic diagram of the overall structure of a low-code automated number-making system according to an embodiment of the present application;
[0023] Figure 5This is a flow chart of a method for low-code automated number generation according to an embodiment of the present application;
[0024] Figure 6 is a structural block diagram of a testing device for an application function according to an embodiment of the present application;
[0025] Figure 7 is a block diagram of a computer system structure of an electronic device according to an embodiment of the present application;
[0026] Figure 8 An electronic device is provided for implementing a testing method for an application function according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to one aspect of an embodiment of the present application, a method for testing an application function is provided. The method for testing an application function is widely used in smart home, smart home, smart home device ecology, smart residential (Intelli gence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for testing an application function can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0030] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0031] In this embodiment, a method for testing application functions is provided, which can be applied to a computer terminal or an IoT cloud. Figure 2 : is a flow chart of a method for testing an application function according to an embodiment of the present application, the flow includes the following steps:
[0032] Step S202, when receiving a number generation requirement input by a target object, loading target number generation data from a number generation resource pool according to the number generation requirement;
[0033] As an optional real-time method, when receiving the number-making demand input by the target object from the visual operation interface, the corresponding application programming interface is called according to the number-making demand; the target number-making data is loaded from the number-making resource pool through the application programming interface;
[0034] It can be understood that according to the parsed number-making demand information, the system calls the corresponding API to generate virtual data that meets the requirements, including text data, image data, video data, etc. By system parsing and calling API to generate virtual data, the probability of human error is reduced and the accuracy and reliability of data are improved. In short, in the process of loading the target number-making data in the number-making resource pool, the API interface is used to load the target number-making data from the number-making resource pool. This interface should include parameters for requesting the target number-making data and the format for returning the target number-making data. And it can obtain the corresponding data from the resource pool according to the passed in parameters and return the data to the caller. By calling the implemented API interface in the application and passing in the necessary parameters, the target number-making data can be obtained.
[0035] Optionally, the necessary parameters may include the ID, type, and filter conditions of the target data. The API interface needs to receive these parameters and obtain corresponding data from the resource pool based on these parameters.
[0036] For example, suppose there is a number-making resource pool that stores different types of target number-making data. If you need to load a target number-making data from the resource pool and use it in an application, first define an API interface. Then, implement this API interface and call it in the application. In this way, you can efficiently load the target number-making data from the resource pool and use it in the application. At the same time, if you need to load other target number-making data in the future, you only need to modify the implementation of the API interface. This can improve the flexibility and maintainability of the code.
[0037] Step S204, associating the target number-generating data with the first function corresponding to the number-generating requirement, and acquiring a second function having a data dependency relationship with the first function, wherein the second function uses the test result of the first function as input data;
[0038] Step S206, when it is determined that the test is to be performed on the second function, the target number-generating data is synchronized to the second function as the test result of the first function, and a first prompt message indicating that the application function test of the second function meets the test conditions is displayed on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0039] Through the above steps, when receiving the number-making demand input by the target object, the target number-making data is loaded from the number-making resource pool according to the number-making demand; the target number-making data is associated with the first function corresponding to the number-making demand, and the second function with a data dependency relationship with the first function is obtained, wherein the second function uses the test result of the first function as input data; when it is determined to perform a test on the second function, the target number-making data is synchronized to the second function as the test result of the first function, and the first prompt message that the application function test of the second function meets the test condition is displayed on the visual interface associated with the target application, wherein the first function and the second function belong to the same target application. The above technical solution solves the problem that the current function test process is cumbersome and inefficient. Then, the data required for the test is prepared in advance through the number-making platform, and the dependent business data is directly generated at the beginning of the test, which improves the operating efficiency of the tester and the test efficiency of the target application.
[0040] In an exemplary embodiment, before loading the target number-making data from the number-making resource pool according to the number-making demand, the method further includes: determining the operation conditions preset on the visual operation interface; wherein the operation conditions include at least one of the following: preconditions, postconditions; and determining the target mode for loading data from the number-making resource pool according to the operation conditions.
[0041] Optionally, in a data analysis application, the user needs to load the target number-making data from the number-making resource pool for analysis. On the operation interface, the user needs to preset preconditions and postconditions. According to the preconditions, the application programming interface determines the way to load data from the number-making resource as data extraction according to the data source and filtering conditions selected by the user. According to the postconditions, after the data is loaded, the data is transferred to the analysis module for further processing and output. Through such steps, the user can clearly understand the operations that need to be performed before loading the data, and at the same time ensure that the data loading method meets the user's needs, thereby improving the accuracy and efficiency of data analysis.
[0042] As an optional implementation, in an actual application scenario, the data architecture of the above preconditions and postconditions is as follows: Figure 3 As shown, Figure 3 : is a schematic diagram of a data processing structure of an API interface according to an embodiment of the present application, wherein the above-mentioned precondition is the data processing performed when calling the API, and there are three specific processing methods, as follows:
[0043] The first one is to use front-end script processing, which is to process data using a weakly typed language.
[0044] The second method is to use SQL scripts. When executing an API, you need to query or write some data from the database to support the execution of the API.
[0045] The third method is to use a loop controller. If some data needs to be processed, such as executing the same operation multiple times, a loop controller can be used.
[0046] Optionally, the above post-condition is to complete another API, and then process the data returned by the completed API to facilitate use by the next API. There are four specific processing methods, as follows:
[0047] The first one is to use post-script processing, which is to process data using a weakly typed language.
[0048] The second method is to use SQL scripts. When executing an API, you need to query or write some data from the database to support the execution of the API.
[0049] The third method is to use a loop controller. If some data needs to be processed, such as executing the same operation multiple times, a loop controller can be used.
[0050] The fourth method is to extract parameters. During the execution of an API, you need to retrieve the response of the previous API, which is called extracting parameters.
[0051] In an exemplary embodiment, a target mode for loading data from the number-generating resource pool is determined based on the operating condition, including: when it is determined that the operating condition is a precondition, determining to perform data processing on the real-time data loaded from the number-generating resource pool through a weakly typed language to obtain first processed data; when it is determined that data control is currently required, identifying multiple control types of an application programming interface associated with the number-generating resource pool, wherein each control type corresponds to a type of script in a script database; selecting a first control mode that matches the data control from the multiple control types, generating a target controller, and processing the first processed data through the target controller to obtain second processed data; and determining a target mode for loading data from the number-generating resource pool based on a preset data loading mode corresponding to the second processed data.
[0052] Optionally, when the operation condition is determined as a precondition, the data when calling the API is processed using a weakly typed language. This mainly includes beanShell, python, groovey, and js, which are relatively easy to learn. Another way is that when executing an API, some data needs to be queried from or written to the database to support the execution of the API. Some data needs to be controlled, such as if the same operation needs to be executed multiple times, a loop controller can be used.
[0053] In an exemplary embodiment, a target method for loading data from the number-generating resource pool is determined based on the operating condition, including: when it is determined that the operating condition is a post-condition, determining that there are at least two data loading paths for an application programming interface associated with the number-generating resource pool; and when it is determined that a first path among the at least two data loading paths has completed data loading and there is third processed data, allowing a second path among the at least two data loading paths to start data loading.
[0054] It is understandable that, when the operating condition is determined as a post-condition, the system can have two data loading paths at the same time, and select the appropriate path for data loading according to the actual situation. If the first path has completed data loading and there is third processing data, the system can allow the second path to start data loading, realize parallel processing, and improve the efficiency of data loading. In this way, the performance and response speed of the system can be improved while ensuring the accuracy of data loading.
[0055] In an exemplary embodiment, before the second path in at least two data loading paths is allowed to start data loading, the above method also includes: extracting target parameters corresponding to the first path, wherein the extraction is implemented in at least one of the following ways: regular expression, JSONPath, XPath; adjusting the initial parameters of the second path according to the target parameters.
[0056] Optionally, the above regular expression is a tool for matching string patterns, by defining a rule to match the content in the target string that meets the rule. For example, a regular expression can be used to match email addresses or phone numbers in a specific format. In regular expressions, some special characters and syntax are usually used to represent matching rules, such as "." means matching any character, "\d" means matching numbers, etc.
[0057] Optionally, the above JSONPath is a query language for extracting data from a JSON data structure, similar to XPath for XML. By using JSONPath expressions, you can locate and extract qualified data in a JSON data structure. For example, you can use JSONPath to get the value of a field in a JSON object or an element in an array. JSONPath expressions are usually composed of some specific symbols and paths, for example, "$..key" means getting the values of all fields containing "key".
[0058] Optionally, the above XPath is a query language for locating and extracting data in XML documents, similar to JSONPath for JSON. XPath locates elements or attributes in XML documents by using path expressions, and supports some basic logical operations and functions. For example, XPath can be used to obtain the text content or attribute value of a node in an XML document. XPath expressions consist of some basic path syntax and operators, such as " / / node" means obtaining all nodes, " / node" means obtaining the root node, etc.
[0059] In an exemplary embodiment, after synchronizing the target number-generating data as the test result of the first function to the second function, and displaying a first prompt message on a visual interface associated with the target application that the application function test of the second function meets the test conditions, the above method also includes: when it is determined that the second function has completed the test, obtaining the function test result corresponding to the second function; when the function test result indicates that the second function has passed the test, determining that the target application test including the first function and the second function has succeeded; when the function test result indicates that the second function has not passed the test, determining that the target application test including the first function and the second function has failed.
[0060] It is understandable that by performing application function testing on the second function, it is possible to verify whether the function works properly as designed. This helps ensure the quality and reliability of the entire target application. By determining whether the target application test containing the first function and the second function succeeds or fails, the status of the entire application can be intuitively understood. This helps to discover and solve potential problems in a timely manner. Using the target numerical data as input data for functional testing can quickly and accurately simulate actual usage scenarios and improve testing efficiency. By integrating the testing of the first function and the second function, the interaction and overall performance between the two functions can be better evaluated to ensure the functional integrity of the application.
[0061] In an exemplary embodiment, after determining that the target application including the first function and the second function has failed the test, the method further includes: sending a second prompt message to the target object, wherein the second prompt message is used to indicate that the current target application test of the target object has failed and the target number generation data is to be checked; receiving a target instruction from the target object for target improvement information feedback; when the target instruction indicates retesting, reloading data from the number generation resource pool; when the target instruction indicates the end of the test, identifying the target application as an application to be corrected.
[0062] It is understandable that by sending a second prompt message to the target object, the target object can be quickly notified of the failure of the current target application test, reducing communication time and improving problem solving efficiency. Receiving the target instruction of the target object's feedback on the second prompt message can ensure that the target object fully understands the test situation, reduces the possibility of misunderstanding and erroneous operation, and improves test accuracy. In the case where the target instruction instructs retesting, reloading data from the data resource pool can quickly obtain new test data, avoid duplication of work, and improve data loading efficiency. In the case where the target instruction instructs the end of the test, the target application is identified as an application to be corrected, which is conducive to subsequent problem tracking and repair, and improves test management efficiency.
[0063] In order to better understand the process of the testing method of the above-mentioned application function, the implementation method flow of the testing of the above-mentioned application function is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0064] In the related technologies, Python scripts are usually used to implement number generation, and there are also some number generation platforms. However, the above related technologies do not solve the core problem of testers. Specifically, in the related technologies, Python is used to write automated scripts, which can only be run locally and the environment must be configured and not shared. In addition, the threshold of the automated number generation platform is high, requiring developers to learn the development language in depth. At the same time, different businesses must be connected and new development must be carried out. After the development is completed, testing and packaging and release are required, which increases the learning cost. It will bring additional learning costs to testers, making the labor cost of testing application functions high.
[0065] In order to solve the above problems, an optional embodiment of the present application proposes a low-code automated number-making method. Specifically, during the test process, the user accesses the operation page of the number-making server through a browser, creates an automated number-making scenario and edits the settings, writes a custom script, executes the number-making scenario, and finally views the result processing. With the above technical solution, users can intuitively create and edit automated number-making scenarios without complicated command line operations, thereby reducing the complexity of operations. At the same time, customized requirements are realized through simple custom scripts, saving time in learning programming languages and frameworks. Executing number-making scenarios can automatically generate a large amount of data, improving data generation efficiency; and the results can be viewed immediately to identify problems and optimize number-making scenarios. This low-code automated number-making method simplifies the operating process and improves efficiency and real-time performance.
[0066] Optional, Figure 4 is a schematic diagram of the overall structure of a low-code automated number-making system according to an embodiment of the present application; Figure 4 As shown in the figure, gateway is a gateway used to distribute requests to different services; nacos is used as a registration center and configuration center to implement RPC calls between services and dynamic configuration of services; project settings, scene number generation, system settings, dateStreaming, and NodeController are five microservices. Among them, system settings and project settings are basic functions of the system, including authority management, user management, and project management; number generation scenarios are the main functions of the platform, which realize the number generation process; dateStreaming service performs data processing, obtains scene number generation result data from kafka, processes it, and stores it in the mysql database; NodeController provides a test resource pool of independent node types for scene number generation. In addition, the data storage of the above system is mysql, the file service is OSS, the cache is Red is, the message transmission is kafka, and Docker Engine provides a jmeter container operating environment for NodeController, which is used to start and stop jmeter.
[0067] Optional, Figure 5 This is a flow chart of a method for low-code automated number generation according to an embodiment of the present application. Figure 5 As you can see, the number generation server mainly provides users with operation pages, creates automated number generation scenarios, writes scripts, and executes number generation scenarios; automated scenario number generation is executed through the jmeter component; the number generation execution results are completed through the kafka and dataStreaming components. Each component is interconnected to complete the number generation process. The specific automated number generation process includes the following steps:
[0068] Step 1: Access the Zaoshu server platform. Users access the operation page provided by the Zaoshu server through a browser, choose to create a new automated Zaoshu scenario on the operation page, and fill in the relevant configuration information. According to the configuration information entered by the user, the Zaoshu server will automatically generate the corresponding script. These scripts include the logic of simulating user behavior, request parameters, assertions, etc., which are used to simulate user operations on the target website.
[0069] Step 2: Execute the number-generating scenario. The server calls nodeController through k8s api or http to build and start jmeter. jmeter will execute the specific number-generating process according to the test script written by the user, simulate the user's behavior and send requests.
[0070] Step 3: Result processing. The execution results are bridged through the message middleware Kafka, and then processed and stored in the database through the dataStreaming service. Users can view the execution results, performance data, error logs and other information on the number-making server to analyze and optimize the number-making scenario.
[0071] It should be noted that during the test, it is necessary to ensure that users can normally access the operation page provided by the number-generating server and can successfully fill in the configuration information. When filling in the configuration information, users need to ensure the accuracy of the information, including the target website URL, number of concurrent users, duration, request frequency, etc. The script generated by the number-generating server needs to ensure that the logic is correct, the request parameters are accurate, and the assertions are complete to ensure that the user's operations on the target website can be accurately simulated. Ensure that jmeter can start normally and execute the number-generating process according to the generated script, and ensure that nodeController can be correctly called to build and start jmeter. Ensure that the message middleware kafka can normally transmit and store the data generated during the number-generating process, and ensure that the dataStreaming service can correctly process and store the data so that users can view real-time data and result analysis.
[0072] Through the above solution, users can create automated number-making scenarios through simple operation pages without writing complex scripts; the automatically generated scripts can accurately simulate user behavior and improve the accuracy of number-making; by executing number-making scenarios and processing results, users can timely understand performance data and error logs, which facilitates analysis and optimization of number-making scenarios. The whole process is simple to operate and efficient, providing users with a convenient number-making platform.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0074] Figure 6 is a structural block diagram of a testing device for an application function according to an embodiment of the present application; Figure 6 As shown, including:
[0075] The loading module 62 is used to load the target number-making data from the number-making resource pool according to the number-making demand when receiving the number-making demand input by the target object;
[0076] an acquisition module 64, configured to associate the target number-generating data with a first function corresponding to the number-generating requirement, and to acquire a second function having a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data;
[0077] The display module 66 is used to synchronize the target number-generating data as the test result of the first function to the second function when it is determined that the test is to be performed on the second function, and to display a first prompt message indicating that the application function test of the second function meets the test condition on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0078] Through the above device, when receiving the number-making demand input by the target object, the target number-making data is loaded from the number-making resource pool according to the number-making demand; the target number-making data is associated with the first function corresponding to the number-making demand, and the second function with a data dependency relationship with the first function is obtained, wherein the second function uses the test result of the first function as input data; when it is determined to perform a test on the second function, the target number-making data is synchronized to the second function as the test result of the first function, and the first prompt message that the application function test of the second function meets the test condition is displayed on the visual interface associated with the target application, wherein the first function and the second function belong to the same target application. The above technical solution solves the problem that the current function test process is cumbersome and inefficient. Then, the data required for the test is prepared in advance through the number-making platform, and the dependent business data is directly generated at the beginning of the test, which improves the operating efficiency of the tester and the test efficiency of the target application.
[0079] In an exemplary embodiment, the above-mentioned device also includes: a second determination module, used to determine the operating conditions preset on the visual operation interface; wherein the operating conditions include at least one of the following: preconditions, postconditions; and determine the target method for loading data from the number-generating resource pool according to the operating conditions.
[0080] In an exemplary embodiment, the second determination module is further used to, when it is determined that the operating condition is a precondition, determine to perform data processing on the real-time data loaded from the number-making resource pool through a weakly typed language to obtain first processed data; when it is determined that data control is currently required, identify multiple control types of the application programming interface associated with the number-making resource pool, wherein each control type corresponds to a type of script in the script database; select a first control method that matches the data control from the multiple control types, generate a target controller, and process the first processed data through the target controller to obtain second processed data; and determine a target method for loading data from the number-making resource pool based on a preset data loading method corresponding to the second processed data.
[0081] In an exemplary embodiment, the above-mentioned second determination module is also used to determine that there are at least two data loading paths for the application programming interface associated with the number-generating resource pool when it is determined that the operating condition is a post-condition; and to allow the second path of the at least two data loading paths to start data loading when it is determined that the first path of the at least two data loading paths has completed data loading and there is third processed data.
[0082] In an exemplary embodiment, the second determination module further includes: an extraction unit for extracting target parameters corresponding to the first path before the second path in at least two data loading paths starts data loading, wherein the extraction is implemented by at least one of the following methods: regular expression, JSONPath, XPath; adjusting the initial parameters of the second path according to the target parameters.
[0083] In an exemplary embodiment, the above-mentioned device also includes: a first determination module, which is used to synchronize the target number-making data as the test result of the first function to the second function, and after displaying a first prompt message on a visual interface associated with the target application that the application function test of the second function meets the test conditions, when it is determined that the second function has completed the test, obtain the function test result corresponding to the second function; when the function test result indicates that the second function has passed the test, determine that the target application test including the first function and the second function has succeeded; when the function test result indicates that the second function has not passed the test, determine that the target application test including the first function and the second function has failed.
[0084] In an exemplary embodiment, the above-mentioned first determination module also includes: a sending unit, which is used to send a second prompt message to the target object after determining that the target application containing the first function and the second function has failed the test, wherein the second prompt message is used to indicate that the current target application test of the target object has failed and the target number generation data is to be checked; receiving the target instruction of the target object for feedback on the target improvement information; when the target instruction indicates retesting, reloading data from the number generation resource pool; when the target instruction indicates the end of the test, identifying the target application as an application to be corrected.
[0085] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0086] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0087] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0088] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0089] S1, when receiving a number generation requirement input by a target object, loading target number generation data from a number generation resource pool according to the number generation requirement;
[0090] S2, associating the target number-generating data with a first function corresponding to the number-generating requirement, and acquiring a second function having a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data;
[0091] S3, when it is determined that the test is to be performed on the second function, the target number-generating data is synchronized to the second function as the test result of the first function, and a first prompt message indicating that the application function test of the second function meets the test conditions is displayed on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0092] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0093] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0094] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0095] S1, when receiving a number generation requirement input by a target object, loading target number generation data from a number generation resource pool according to the number generation requirement;
[0096] S2, associating the target number-generating data with a first function corresponding to the number-generating requirement, and acquiring a second function having a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data;
[0097] S3, when it is determined that the test is to be performed on the second function, the target number-generating data is synchronized to the second function as the test result of the first function, and a first prompt message indicating that the application function test of the second function meets the test conditions is displayed on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
[0098] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0099] Figure 7 The computer system structure block diagram for implementing the electronic device of the embodiment of the present application is schematically shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. Figure 7 As shown, the computer system 500 includes a central processing unit 701 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 702 (ROM) or the program loaded from the storage part 708 to the random access memory 503 (RAM). In the random access memory 703, various programs and data required for system operation are also stored. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. An input / output interface 705 (I nput / Output interface, i.e., I / O interface) is also connected to the bus 704.
[0100] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a local area network card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0101] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processor 701, various functions defined in the system of the present application are executed.
[0102] According to another aspect of the embodiment of the present application, an electronic device for implementing the test of the above-mentioned application function is also provided. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.
[0103] Optionally, in this embodiment, the electronic device may be located in at least one of a plurality of network devices of a computer network. A person skilled in the art may understand that Figure 8 The structure shown is for illustration only, and the electronic device may also be a device including the above-mentioned flash memory. Figure 8 The structure of the electronic device is not limited. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.
[0104] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the test of the application function and the device in the embodiment of the present application. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, to realize the test of the above-mentioned application function. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include a memory remotely arranged relative to the processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 802 can be specifically, but not limited to, used for information such as logs containing modeling data. As an example, such as Figure 8 As shown, the memory 802 may include but is not limited to the modules in the test device for the application function. In addition, it may also include but is not limited to other module units in the test device for the application function, which will not be described in detail in this example.
[0105] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0106] In addition, the electronic device further includes: a display 808; and a connection bus 810, which is used to connect various module components in the electronic device.
[0107] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0108] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0109] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0110] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0111] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0112] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for testing application functions, characterized in that: include: When receiving a number generation requirement input by a target object, loading target number generation data from a number generation resource pool according to the number generation requirement; Associating the target number-generating data with a first function corresponding to the number-generating requirement, and acquiring a second function having a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data; When it is determined that the test is to be performed on the second function, the target number-generating data is synchronized to the second function as the test result of the first function, and a first prompt message indicating that the application function test of the second function meets the test conditions is displayed on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
2. The method for testing application functions according to claim 1, characterized in that: Before loading the target number-making data from the number-making resource pool according to the number-making demand, the method further includes: Determine the operation conditions preset on the visual operation interface; wherein the operation conditions include at least one of the following: preconditions and postconditions; A target mode for loading data from the data generation resource pool is determined according to the operating conditions.
3. The method for testing application functions according to claim 2, characterized in that: Determining a target mode for loading data from the data generation resource pool according to the operation condition includes: In the case where it is determined that the operation condition is a precondition, determining to perform data processing on the real-time data loaded from the number-generating resource pool by using a weakly typed language to obtain first processed data; In the case where it is determined that data control is currently required, multiple control types of the application programming interface associated with the number-generating resource pool are identified, wherein each control type corresponds to a type of script in the script database; Selecting a first control mode matching the data control from the multiple control types, generating a target controller, and processing the first processed data by the target controller to obtain second processed data; A target mode for loading data from the number-generating resource pool is determined based on a preset data loading mode corresponding to the second processed data.
4. The method for testing application functions according to claim 2, characterized in that: Determining a target mode for loading data from the data generation resource pool according to the operation condition includes: In the case where it is determined that the operation condition is a post-condition, determining that the application programming interface associated with the number-generating resource pool has at least two data loading paths; When it is determined that a first path among the at least two data loading paths has completed data loading and there is third processed data, a second path among the at least two data loading paths is allowed to start data loading.
5. The method for testing application functions according to claim 4, characterized in that: Before allowing the second path among the at least two data loading paths to start data loading, the method further includes: Extracting a target parameter corresponding to the first path, wherein the extraction is implemented by at least one of the following methods: regular expression, JSONPath, and XPath; The initial parameters of the second path are adjusted according to the target parameters.
6. The method for testing application functions according to claim 1, characterized in that: After synchronizing the target number-generating data as the test result of the first function to the second function, and displaying a first prompt message that the application function test of the second function meets the test condition on a visual interface associated with the target application, the method further includes: When it is determined that the test of the second function is completed, obtaining a function test result corresponding to the second function; If the function test result indicates that the second function has passed the test, determining that the target application including the first function and the second function has passed the test; When the functional test result indicates that the second function fails the test, it is determined that the target application test including the first function and the second function fails.
7. The method for testing application functions according to claim 6, characterized in that: After determining that the target application including the first function and the second function fails the test, the method further includes: Sending a second prompt message to the target object, wherein the second prompt message is used to indicate that the current target application test of the target object has failed and the target numerical data is to be checked; Receive a target instruction from the target object for feedback of the target improvement information; When the target instruction indicates retesting, reloading data from the number generation resource pool; In a case where the target instruction indicates to end the test, the target application is identified as an application to be corrected.
8. A device for testing application functions, characterized in that: include: A loading module, configured to load target number-making data from a number-making resource pool according to the number-making demand when receiving the number-making demand input by the target object; an acquisition module, configured to associate the target number-making data with a first function corresponding to the number-making requirement, and acquire a second function having a data dependency relationship with the first function, wherein the second function uses a test result of the first function as input data; The display module is used to synchronize the target number-generating data as the test result of the first function to the second function when it is determined that the test is to be performed on the second function, and display a first prompt message that the application function test of the second function meets the test condition on a visual interface associated with the target application, wherein the first function and the second function belong to the same target application.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
