Software testing method, device, equipment and storage medium
By obtaining and processing the client's request data, generating a request data set and determining the target request data, the problem of low software testing efficiency is solved, the execution code structure is quickly located and tested, and the efficiency of the client's iterative update is improved.
Patent Information
- Application Number
- CN202111367324.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-11-17
AI Technical Summary
The existing technology is inefficient in software testing, resulting in long iteration and update times for the client, and the inability to quickly locate and process code changes.
By obtaining the client's request data and processing status within a preset time period, a request data set is generated, the target request data is determined, and the test task is executed based on the target request data to achieve rapid positioning and testing of the execution code structure.
It improves the efficiency of software testing, saves processing resources, and enables rapid iterative updates of client code.
Smart Images

Figure CN113900959B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology and, in particular, to a software testing method, apparatus, device and storage medium. Background Art
[0002] With the advent of the intelligent era, the speed requirements for application software updates and iterations are increasing day by day. When updating the functions of the client, it is necessary to update the execution code structure used to implement the function and test the updated execution code structure. When the test results meet expectations, the client is updated based on the updated execution code structure to achieve the update of the client. Based on this, how to improve the test efficiency of software testing to shorten the time of client iteration updates is a current research hotspot. Summary of the invention
[0003] The embodiments of the present application provide a software testing method, apparatus, device and storage medium, which can improve testing efficiency.
[0004] On the one hand, an embodiment of the present application provides a software testing method, including:
[0005] Acquire multiple pieces of request data received by the client within a preset time period, and processing status of the multiple pieces of request data by the client;
[0006] Based on the processing situation, determining request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data, and generating a request data set including all the determined request data;
[0007] Acquire a test task, where the test task is used to instruct: testing a target execution code structure in the one or more execution code structures;
[0008] Target request data matching the test task is determined from the request data set, and the test task is executed based on the target request data to obtain a test result.
[0009] On the one hand, an embodiment of the present application provides a software testing device, characterized in that the software testing device includes an acquisition unit, a processing unit and an output unit, and the acquisition unit, the processing unit and the output unit are used to execute the above-mentioned software testing method.
[0010] On the one hand, an embodiment of the present application provides a software testing device, characterized in that the software testing device includes an input interface and an output interface, and further includes:
[0011] a processor adapted to implement one or more instructions; and,
[0012] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned software testing method.
[0013] On the one hand, an embodiment of the present application provides a computer storage medium, characterized in that computer program instructions are stored in the computer storage medium, and when the computer program instructions are executed by a processor, they are used to execute the above-mentioned software testing method.
[0014] On the one hand, an embodiment of the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a software testing device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, and when the computer instructions are executed by the processor, they are used to execute the above-mentioned software testing method.
[0015] In the embodiment of the present application, after obtaining multiple request data received by the client within a preset time period and the processing status of the multiple request data by the client, the software testing device can determine the request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data based on the processing status, and generate a request data set containing all the determined request data; when the software testing device obtains a test task for a target execution code structure that has been changed in the one or more execution code structures, it can determine the target request data that matches the test task from the request data set, and execute the test task based on the target request data to obtain a test result. When any execution code structure in the execution code structure is changed, the request data corresponding to the changed execution code structure can be determined from the request data set based on the correspondence between the execution code structure and the request data established in advance, as the target request data, so that the changed execution code structure is tested based on the target request data, which can avoid repeated processing of multiple request data obtained from the client, and can achieve rapid positioning of the request data used for testing, improve test efficiency and save processing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1It is a structural diagram of a software testing system provided in an embodiment of the present application;
[0018] Figure 2 It is a flowchart of a software testing method provided in an embodiment of the present application;
[0019] Figure 3 It is a schematic diagram of the correspondence between a function point, an execution code structure and request data provided by an embodiment of the present application;
[0020] Figure 4 It is a schematic diagram of an implementation method of a software testing method provided in an embodiment of the present application;
[0021] Figure 5 It is a flowchart of another software testing method provided in an embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of another implementation of a software testing method provided in an embodiment of the present application;
[0023] Figure 7 It is a structural schematic diagram of a software testing device provided in an embodiment of the present application;
[0024] Figure 8 It is a structural diagram of a software testing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0026] In order to improve the testing efficiency of software testing, an embodiment of the present application provides a software testing solution. When any execution code structure in the execution code structure of the client is changed, based on the pre-established correspondence between the execution code structure and the request data, the request data corresponding to the changed execution code structure can be determined as the target request data, so as to test the changed execution code structure based on the target request data to obtain a test result, wherein the request data is received by the client within a preset time period.
[0027] Based on the above software testing solution, the present application embodiment provides a software testing system. Figure 1 , is a structural diagram of a software testing system provided in an embodiment of the present application. Figure 1The software testing system shown may include a client 101 and a software testing device 102. Among them, the client 101 can be run in a terminal device, and the terminal device can be any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car and a smart wearable device. The software testing device 102 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car and a smart wearable device, etc. It can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The client 101 and the software testing device 102 can be directly or indirectly connected in communication through wired or wireless communication, and this application is not limited here.
[0028] In one embodiment, the client can be a client that can provide any functional service, for example, it can be a client that can provide email services, or it can be a game client, a music client, a video client, an electronic shopping client, etc. Further, the client correspondingly includes one or more execution code structures, and the one or more execution code structures of the client are used to implement the functions provided by the client, that is, by running the one or more execution code structures of the client, the functions provided by the client can be implemented. Among them, the one or more execution code structures of the client can be code files, classes, methods, code blocks, code branches, etc.
[0029] In one embodiment, one or more execution code structures of the client called when the client is running in the terminal device are stored in the local storage of the terminal device; further, one or more execution code structures of the client can also be stored in the code library, so that the technician can change the one or more execution code structures stored in the code library without changing the execution code structure stored in the terminal device, thereby not affecting the use of the client in real time. Furthermore, after the technician changes a certain execution code structure stored in the code library, it is necessary to test the changed execution code structure in the code library. When the test result meets expectations, the client can be updated based on the changed execution code structure in the code library.
[0030] In one embodiment, one or more functions provided by the client can be described based on one or more function points of the client, and each of the one or more function points of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client. The one or more execution code structures of the client are used to implement the functions described by the one or more function points of the client, and the functions described by each function point are implemented by one or more execution code structures of the client; that is, one function point of the client can correspond to one or more execution code structures. Among them, each function point of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client, which is pre-set by the technician; optionally, the technician can store the set one or more function points of the client in the function point warehouse, so that the technician can modify the function points stored in the function point warehouse at any time, such as modifying the function description information and test rules included in the function point.
[0031] In one embodiment, since one or more execution code structures of the client are used to implement the functions described by one or more function points of the client, the functions described by each function point are implemented by one or more execution code structures of the client; that is, one function point of the client can correspond to one or more execution code structures; then, the correspondence between the function points of the client and the execution code structures can be stored in advance in the memory of the software testing device, so that fast search can be achieved based on the correspondence between the function points and the execution code structures. Optionally, the correspondence between each function point of the client and each execution code structure can be stored through the function point identifier of each function point and the structure identifier of the execution code structure used to implement the function described by each function point.
[0032] In one embodiment, the client 101 can send multiple request data received within a preset time period to the software testing device 102. After receiving the multiple request data sent by the client 101, the software testing device 102 can establish a corresponding relationship between the client's execution code structure and the request data; when any execution code structure of the client's execution code structure stored in the code library is changed, the software testing device 102 can determine the request data corresponding to the changed execution code structure based on the pre-established corresponding relationship between the execution code structure and the request data, as the target request data, so as to test the changed execution code structure based on the target request data to obtain the test result. When the test result meets expectations, the software testing device 102 can update the client 101 based on the changed execution code structure.
[0033] Based on the above software testing solution and software testing system, the present application embodiment provides a software testing method. Figure 2 , which is a flow chart of a software testing method provided in an embodiment of the present application. Figure 2 The software testing method shown can be executed by a software testing device. Figure 2 The software testing method shown may include the following steps:
[0034] S201, obtaining multiple request data received by the client within a preset time period, and the processing status of the multiple request data by the client.
[0035] In one embodiment, the client may be a client that can provide any functional service. Further, the client may include one or more execution code structures, and the one or more execution code structures of the client are used to implement the functions provided by the client. The one or more execution code structures of the client may be code files, classes, methods, code blocks, code branches, etc.
[0036] In one embodiment, one or more execution code structures of the client called when the client is running in the terminal device are stored in the local storage of the terminal device; further, one or more execution code structures of the client can also be stored in the code library, so that technical personnel can change the one or more execution code structures stored in the code library without changing the execution code structure stored in the terminal device, thereby not affecting the use of the client in real time.
[0037] In one embodiment, the multiple request data received by the client within a preset time period refers to: the request data generated when the user of the client requests the function provided by the client within the preset time period. Further, the client can respond to and process the request data generated by the user to obtain the processing result corresponding to the request data. For example, if the client is an electronic shopping client, if the user performs a search operation in the commodity search page provided by the electronic shopping client within the preset time period, for example, the user searches for "desk lamp", then the electronic shopping client can respond to the user's search operation, query the commodities that meet the search condition of "desk lamp", and display the commodities obtained in this search in the search result page provided by the electronic shopping client, for example, if the commodities obtained in the search are desk lamp 1, desk lamp 2, desk lamp 3 and desk lamp 4; then the request data "desk lamp" used by the user to request the search function provided by the electronic shopping client is a request data, and the desk lamp 1, desk lamp 2, desk lamp 3 and desk lamp 4 obtained by the electronic shopping client in response to this search are the processing results corresponding to the request data "desk lamp".
[0038] In one embodiment, the processing of multiple request data by the client includes: the processing result corresponding to each request data in the multiple request data and the information of the execution code structure processed for each request data, for example, the structure identifier of the execution code structure processed for each request data. For example, if the client includes execution code structure 1, execution code structure 2, execution code structure 3, execution code structure 4, execution code structure 5 and execution code structure 6, if the client processes request data 1 by running execution code structure 1, execution code structure 2 and execution code structure 3, then the execution code structures that process request data 1 are execution code structure 1, execution code structure 2 and execution code structure 3. It is worth noting that the multiple request data received by the client within the preset time period and the client's processing of the multiple request data obtained by the software testing device are obtained only after the user's authorization; that is, if a user does not open the software testing device to the authorization to obtain the request data generated when using the client, then the software testing device will not obtain the request data generated by the user when using the client and the client's processing of the request data, that is, the client will not send the user's request data received by the client within the preset time period and the client's processing of the user's request data to the software testing device. Optionally, before obtaining the multiple request data received by the client within the preset time period and the client's processing of the multiple request data, the software testing device can send an authorization agreement to the client regarding obtaining the request data generated by the user and the client's processing of the multiple request data. When the user of the client agrees to the authorization agreement, the request data and the client's processing of the request data are obtained from the client.
[0039] In one embodiment, the preset time period can be set according to specific needs. Optionally, the software testing device can periodically obtain multiple request data received by the client within the preset time period, and the client's processing of the multiple request data, so as to update the obtained request data and the processing status, so that subsequent testing can be based on the updated request data. For example, the preset time period can be set to 14:00 to 16:00, the cycle length can be set to 2 hours, and the cycle interval can be set to 24 hours, then the software testing device can obtain the multiple request data received by the client from 14:00 to 16:00 every day, and the client's processing of the multiple request data. The embodiment of the present application does not limit the length of the preset time period, the cycle length, and the cycle interval.
[0040] S202, based on the processing situation, determine the request data corresponding to each execution code structure in the one or more execution code structures of the client from the multiple request data, and generate a request data set including all the determined request data.
[0041] In one embodiment, the software testing device determines the request data corresponding to each execution code structure in one or more execution code structures of the client from multiple request data based on the processing situation, which may include: determining the request data processed by each execution code structure from the multiple request data based on the processing situation; using the determined request data processed by each execution code structure as the request data corresponding to each execution code structure. Since the client's processing situation of the multiple request data includes the information of the execution code structure that processes each request data, the software testing device can determine the request data processed by each execution code structure from the multiple request data based on the information of the execution code structure that processes each request data included in the acquired processing situation; and then use the determined request data processed by each execution code structure as the request data corresponding to each execution code structure. Further, after determining the request data processed by each execution code structure, the software testing device can filter the determined request data processed by each execution code structure, remove the request data that is invalid for any execution code structure, and remove the request data that is repeatedly effective for any execution code structure.
[0042] In one embodiment, the software processing device can obtain multiple request data received by the client within a preset time period, and after obtaining the multiple request data, call one or more execution code structures of the client stored in the code library to process the obtained multiple user data, and obtain the processing status of the multiple request data, and then based on the processing status, determine the request data corresponding to each execution code structure in the one or more execution code structures of the client from the multiple request data, and generate a request data set containing all the determined request data.
[0043] In one embodiment, after the software testing device determines the request data corresponding to each of the one or more execution code structures of the client from the plurality of request data, the corresponding relationship between the execution code structure and the request data can be stored. Optionally, each execution code structure and the request data corresponding to each execution code structure can be stored correspondingly, or the structure identifier of each execution code structure and the request data corresponding to each execution code structure can be stored correspondingly.
[0044] S203, obtaining a test task.
[0045] In one embodiment, the test task is used to indicate: testing of a target execution code structure in one or more execution code structures; and the target execution code structure is changed after obtaining the processing situation. The target execution code structure is a target execution code structure stored in a code library, that is, the change of the target execution code structure after obtaining the processing situation refers to the change of the target execution code structure stored in the code library, not the change of the execution code structure stored in the terminal device.
[0046] In one embodiment, a software testing device can detect one or more execution code structures stored in a code library. If it is detected that any execution code structure among the one or more execution code structures included in the code library is changed after the software testing device obtains the processing status, the arbitrary execution code structure is used as the target execution code structure, and a test task is generated to instruct testing the target execution code.
[0047] S204, determining target request data matching the test task from the request data set, and executing the test task based on the target request data to obtain a test result.
[0048] In one embodiment, when a test task is used to indicate a test of a target execution code structure in one or more execution code structures, the software testing device determines the target request data that matches the test task from the request data set, and executes the test task based on the target request data to obtain a test result, which may include: determining the request data corresponding to the target execution code structure from the request data set as the target request data; generating a test script based on the target request data and the test rules included in the function points used to describe the functions implemented by the target execution code structure; running the test script to test the modified target execution code structure to obtain a test result. In a specific implementation, the function points used to describe the functions implemented by the target execution code structure can be determined based on the correspondence between the function points of the client and the execution code structure stored in advance in the memory of the software testing device. Optionally, the test rules included in the function points used to describe the functions implemented by the target execution code structure can be changed by the technician after the software testing device obtains the processing situation, or they may not be changed.
[0049] For example, if the correspondence between the client function points stored in the function point warehouse, the execution code structure stored in the code library, and the request data can be as follows: Figure 3As shown, the function points stored in the function point warehouse are function point A, function point B and function point C; the function described by function point A is jointly implemented by execution code structure 1 and execution code structure 2, the function described by function point B is jointly implemented by execution code structure 3, execution code structure 4 and execution code structure 5, and the function described by function point C is implemented by execution code structure 6; the request data corresponding to execution code structure 1 are request data 1, request data 2 and request data 3, the request data corresponding to execution code structure 2 are request data 4, request data 5 and request data 6, the request data corresponding to execution code structure 3 are request data 7 and request data 8, the request data corresponding to execution code structure 4 are request data 9 and request data 10, the request data corresponding to execution code structure 5 are request data 11, request data 12 and request data 13, and the request data corresponding to execution code structure 6 are request data 14 and request data 15. If the execution code structure 1 is changed, the target execution code structure is the execution code structure 1; the target request data is the request data corresponding to the execution code structure 1, including request data 1, request data 2 and request data 3, and the test script is generated based on the target request data and the test rules included in function point A.
[0050] In one embodiment, when a test task is used to indicate a test of a target execution code structure in one or more execution code structures, if the test result indicates that the test task fails, a first prompt message is output, and the first prompt message is used to indicate that there are defects in the changed target execution code structure; if the test result indicates that the test task is successful, a second prompt message is output, and the client is updated based on the changed target execution code structure; the second prompt message is used to indicate that there are no defects in the changed target execution code structure. Among them, the failure of the test task means that the test result does not meet expectations, and the success of the test task means that the test result meets expectations. Optionally, the first prompt message and the second prompt message can be prompt messages in any format, for example, text format or audio format, etc. The embodiment of the present application does not limit the format of the first prompt message and the second prompt message, nor does it limit the specific content of the first prompt message and the second prompt message. Among them, when the test result indicates that the test task has failed, the software testing equipment can output the first prompt information for indicating that there are defects in the changed target execution code structure, which can realize the rapid positioning of the defective changed target execution code structure, so that the technician can modify the defective changed target execution code, saving the technician's time for searching for defective code and improving the testing efficiency of the software; further, based on the correspondence between the stored function points and the execution code structure, the function points used to describe the functions implemented by the target execution code structure can be quickly positioned, so that the technician can check the function points used to describe the functions implemented by the target execution code structure, saving the technician's search time and improving the testing efficiency of the software.
[0051] In one embodiment, when the test results indicate that the test task is successful, the software testing device can update the client based on the changed target execution code structure, and the software testing method provided in the embodiment of the present application is also applicable to the updated client. Furthermore, the test can be performed based on multiple request data received by the updated client within a preset time period, and the processing of the multiple request data by the updated client, thereby realizing a closed-loop process and enabling iterative updates of the client.
[0052] In one embodiment, the software testing device may include a request data acquisition module, a code calibration module, a function verification module, and a software testing module. When the software testing device executes the software testing method related process provided in the embodiment of the present application, it may execute by calling the above modules. Figure 4As shown, it is a schematic diagram of an implementation method of a software testing method provided in an embodiment of the present application. The software testing device can call the request data acquisition module to obtain multiple request data received by the client within a preset time period, as well as the client's processing status of the multiple request data; call the code calibration module to determine the request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data based on the processing status and one or more execution code structures stored in the code library, and generate a request data set containing all the determined request data; call the function verification module to detect one or more execution code structures stored in the code library. If it is detected that any execution code structure in the one or more execution code structures included in the code library is changed after the request data acquisition module obtains the processing status, then the arbitrary execution code structure is used as the target The target execution code structure is modified, and a test task for instructing to test the target execution code is generated; the function verification module is called to determine the target request data matching the test task from the request data set; the software testing module is called to execute the test task based on the target request data to obtain the test result; when the test result indicates that the test task is successful, the client is updated based on the modified target execution code structure, and a second prompt information for indicating that the modified target execution code structure does not have defects is output, so that the request data received by the updated client within a preset time period can be obtained by calling the request data acquisition module, thereby realizing iterative update of the client; when the test result indicates that the test task fails, the function verification module is called to locate the modified target execution code structure, and the first prompt information for indicating that the modified target execution code structure has defects is output.
[0053] In the embodiment of the present application, after obtaining multiple request data received by the client within a preset time period and the processing status of the multiple request data by the client, the software testing device can determine the request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data based on the processing status, and generate a request data set containing all the determined request data; when the software testing device obtains a test task for a target execution code structure that has been changed in the one or more execution code structures, it can determine the target request data that matches the test task from the request data set, and execute the test task based on the target request data to obtain a test result. When any execution code structure in the execution code structure is changed, the request data corresponding to the changed execution code structure can be determined from the request data set based on the correspondence between the execution code structure and the request data established in advance, as the target request data, so that the changed execution code structure is tested based on the target request data, which can avoid repeated processing of multiple request data obtained from the client, and can achieve rapid positioning of the request data used for testing, improve test efficiency and save processing resources.
[0054] Based on the above software testing solution and software testing system, the present application embodiment provides a software testing method. Figure 5 , which is a flow chart of another software testing method provided in an embodiment of the present application. Figure 5 The software testing method shown can be executed by a software testing device. Figure 5 The software testing method shown may include the following steps:
[0055] S501, obtaining multiple request data received by the client within a preset time period, and the processing status of the multiple request data by the client.
[0056] S502, based on the processing situation, determine the request data corresponding to each execution code structure in the one or more execution code structures of the client from the multiple request data, and generate a request data set including all the determined request data.
[0057] Among them, step S501 to step S502 are consistent with the above-mentioned step S201 to step S202, and will not be repeated here.
[0058] S503: Determine request data corresponding to each of the one or more function points of the client from the request data set.
[0059] Among them, each function point of the client includes function description information for describing a function of the client and test rules for describing testing a function of the client; the function described by each function point is implemented by one or more execution code structures of the client; the function points of the client can be stored in a function point warehouse.
[0060] In a specific implementation, the software testing device determines the request data corresponding to each of the one or more function points of the client from the request data set, which may include: determining the execution code structure used to implement the function described by each function point; using the request data corresponding to the determined execution code structure as the request data corresponding to each function point. In a specific implementation, the software testing device may determine the execution code structure used to implement the function described by each function point based on the correspondence between the stored function points and the execution code structure; and then use the request data corresponding to the determined execution code structure as the request data corresponding to each function point. For example, if the function described by function point A is implemented by execution code structure 1 and execution code structure 2, the request data corresponding to execution code structure 1 determined by step S502 are request data 1, request data 2, and request data 3, respectively, and the request data corresponding to execution code structure 2 are request data 4, request data 5, and request data 6, respectively; then, the request data corresponding to function point A are request data 1, request data 2, request data 3, request data 4, request data 5, and request data 6, respectively.
[0061] S504, obtaining a test task.
[0062] In one embodiment, a test task can be used to represent a test of a target execution code structure in one or more execution code structures, and the target execution code structure changes after obtaining the processing situation; then the software testing device obtains the test task and determines the target request data that matches the test task from the request data set, and executes the test task based on the target request data to obtain the relevant process of the test result, which is consistent with the above-mentioned steps S203 to S204 and will not be repeated here.
[0063] In one embodiment, the test task may be used to indicate: testing of the execution code structure for implementing the function described by the target function point in one or more function points. Further, the content included in the target function point may be changed after the software testing device obtains the processing situation, for example, the function description information and the test rules included in the target function point may be changed by the technician.
[0064] In one embodiment, a software testing device can detect one or more function points stored in a function point repository. If it is detected that any function point among the one or more function points included in the function point repository has changed after the software testing device obtains the processing status, the arbitrary function point is used as a target function point, and a test task is generated to instruct testing of an execution code structure used to implement the function described by the target function point.
[0065] S505, determining target request data matching the test task from the request data set, and executing the test task based on the target request data to obtain a test result.
[0066] In one embodiment, when a test task is used to indicate a test of an execution code structure for implementing a function described by a target function point in one or more function points, the software testing device determines the target request data matching the test task from the request data set, and executes the test task based on the target request data to obtain a test result, which may include: determining the request data corresponding to the target function point from the request data set as the target request data; generating a test script based on the target request data and the test rules currently included in the target function point; running the test script to test the execution code structure for implementing the function described by the target function point to obtain a test result. Among them, the test rules currently included in the target function point refer to the test rules included in the target function point when the test task is obtained; if the test rules currently included in the target function point are changed after the software testing device obtains the processing situation, the test rules currently included in the target function point are the changed test rules. In a specific implementation, the execution code structure for implementing the function described by the target function point can be determined based on the correspondence between the function points of the client and the execution code structure stored in advance in the memory of the software testing device. Optionally, the execution code structure for implementing the function described by the target function point may be modified by a technician after the software testing device obtains the processing situation, or may not be modified.
[0067] For example, if the correspondence between the client's function points stored in the function point warehouse, the execution code structure stored in the code library, and the request data is as follows Figure 3As shown, the function points stored in the function point warehouse are function point A, function point B and function point C; the function described by function point A is jointly implemented by execution code structure 1 and execution code structure 2, the function described by function point B is jointly implemented by execution code structure 3, execution code structure 4 and execution code structure 5, and the function described by function point C is implemented by execution code structure 6; the request data corresponding to execution code structure 1 are request data 1, request data 2 and request data 3, the request data corresponding to execution code structure 2 are request data 4, request data 5 and request data 6, the request data corresponding to execution code structure 3 are request data 7 and request data 8, the request data corresponding to execution code structure 4 are request data 9 and request data 10, the request data corresponding to execution code structure 5 are request data 11, request data 12 and request data 13, and the request data corresponding to execution code structure 6 are request data 14 and request data 15. If the test rules in function point A are changed, the target function point is function point A; the target request data is the request data corresponding to function point A, including request data 1, request data 2, request data 3, request data 4, request data 5 and request data 6; the test script is generated based on the target request data and the changed test rules included in function point A; and the execution code structure 1 and the execution code structure 2 are tested based on the test script.
[0068] In one embodiment, when a test task is used to indicate a test of an execution code structure for implementing a function described by a target function point in one or more function points, if the test result indicates that the test task fails, a third prompt message is output, and the third prompt message is used to indicate that the test result of testing the execution code structure for implementing the function described by the target function point based on the test rules currently included in the target function point does not meet expectations; if the test result indicates that the test task is successful, a fourth prompt message is output, and the fourth prompt message is used to indicate that the test result of testing the execution code structure for implementing the function described by the target function point based on the test rules currently included in the target function point meets expectations; further, when the test result indicates that the test task is successful, and the execution code structure for implementing the function described by the target function point is changed after obtaining the processing situation, the client is updated based on the changed execution code structure for implementing the function described by the target function point. Wherein, a test task failure means that the test result does not meet expectations, and a test task success means that the test result meets expectations. Optionally, the third prompt information and the fourth prompt information can be prompt information in any format, such as text format or audio format, etc. The embodiment of the present application does not limit the format of the third prompt information and the fourth prompt information, nor does it limit the specific content of the third prompt information and the fourth prompt information. Among them, when the test result indicates that the test task fails, the software testing device can output the third prompt information to indicate that the test result of the execution code structure used to implement the function described by the target function point based on the test rules currently included in the target function point does not meet expectations, and can quickly locate the target function point that does not meet expectations, so that the technician can modify the target function point that does not meet expectations, saving the technician's search time for the target function point that does not meet expectations, and improving the software testing efficiency; further, based on the correspondence between the stored function point and the execution code structure, the execution code structure used to implement the function described by the target function point can be quickly located, so that the technician can check the execution code structure used to implement the function described by the target function point, saving the technician's search time, and improving the software testing efficiency.
[0069] In one embodiment, when the test result indicates that the test task is successful, and the execution code structure used to implement the function described by the target function point changes after obtaining the processing status, the software testing device can update the client based on the changed execution code structure, and the software testing method provided in the embodiment of the present application is also applicable to the updated client. Furthermore, the test can be performed based on multiple request data received by the updated client within a preset time period, and the processing status of the multiple request data by the updated client, thereby realizing a closed process loop and enabling iterative updates of the client.
[0070] In one embodiment, the software testing device may include a request data acquisition module, a code calibration module, a function verification module, and a software testing module, and may also include a function point calibration module and a configurable model, in which the corresponding relationship between the function point and the execution code structure is stored (that is, the configurable model stores each function point and the execution code structure for implementing the function described by each function point). When the software testing device executes the relevant process of the software testing method provided in the embodiment of the present application, it can be executed by calling the above modules. Figure 6 As shown, it is a schematic diagram of an implementation method of another software testing method provided in an embodiment of the present application. The software testing device can call a request data acquisition module to obtain multiple request data received by the client within a preset time period, as well as the client's processing status of the multiple request data; call the code calibration module to determine the request data corresponding to each of the one or more execution code structures of the client from the multiple request data based on the processing status and one or more execution code structures stored in the code library, and generate a request data set containing all the determined request data; call the function point calibration module to determine the request data corresponding to each of the one or more function points of the client from the request data set based on the one or more function points stored in the function point warehouse and the correspondence between the function points and the execution code structures obtained from the configurable model; call the function verification module to verify the one or more function points stored in the code library. An execution code structure is detected and one or more function points stored in a function point repository are checked. If it is detected that any execution code structure of the one or more execution code structures included in the code library is changed after the request data acquisition module obtains the processing situation, the arbitrary execution code structure is used as the target execution code structure, and a test task for instructing to test the target execution code is generated; if it is detected that any function point of the one or more function points included in the function point repository is changed after the request data acquisition module obtains the processing situation, the arbitrary function point is used as the target function point, and a test task for instructing to test the execution code structure for implementing the function described by the target function point is generated; a function verification module is called to determine the target request data matching the test task from the request data set; a software testing module is called to execute the test task based on the target request data to obtain the test result.
[0071] If the test task is a test task for indicating testing of the target execution code, then when the test result indicates that the test task is successful, the client is updated based on the changed target execution code structure, and a second prompt information is output to indicate that there are no defects in the changed target execution code structure, so that the request data received by the updated client within a preset time period can be obtained by calling the request data acquisition module, thereby realizing iterative update of the client; when the test result indicates that the test task fails, the function verification module is called to locate the changed target execution code structure, and the first prompt information is output to indicate that there are defects in the changed target execution code structure. If the test task is a test task for indicating the test of the execution code structure used to implement the function described by the target function point, then when the test result indicates that the test task is successful, a fourth prompt information is output, and the fourth prompt information is used to indicate that the test result when the execution code structure is tested based on the test rules currently included in the target function point meets expectations; further, if the execution code structure is changed after the request data acquisition module obtains the processing status, the client is updated based on the changed execution code structure, so that the request data received by the updated client within a preset time period can be obtained by calling the request data acquisition module, thereby realizing iterative update of the client; when the test result indicates that the test task fails, the function verification module is called to locate the target function point and the changed execution code structure, and a third prompt information is output, and the third prompt information is used to indicate that the test result when the execution code structure is tested based on the test rules currently included in the target function point does not meet expectations.
[0072] In an embodiment of the present application, after obtaining multiple request data received by the client within a preset time period and the client's processing of the multiple request data, the software testing device can determine the request data corresponding to each of one or more execution code structures of the client from the multiple request data based on the processing situation, and generate a request data set containing all the determined request data; and determine the request data corresponding to each of one or more function points of the client from the request data set; when the software testing device obtains a test task for a target execution code structure that has been changed in the one or more execution code structures, or when it obtains a test task for a target function point that has been changed in the one or more function points, it can determine the target request data that matches the test task from the request data set, and execute the test task based on the target request data to obtain a test result. When any execution code structure in the execution code structure is changed, the request data corresponding to the changed execution code structure can be determined from the request data set based on the pre-established correspondence between the execution code structure and the request data, as the target request data, so that the changed execution code structure can be tested based on the target request data; when any function point in the function point is changed, the request data corresponding to the changed function point can be determined from the request data set based on the pre-established correspondence between the function point and the request data, as the target request data, so that the execution code structure used to implement the function described by the changed function point can be tested based on the target request data; repeated processing of multiple request data obtained from the client can be avoided, and rapid positioning of request data used for testing can be achieved, thereby improving test efficiency and saving processing resources.
[0073] Based on the above software testing system and software testing method embodiments, the present application embodiment provides a software testing device. Figure 7 , is a structural diagram of a software testing device provided in an embodiment of the present application, and the software testing device may include an acquisition unit 701, a processing unit 702 and an output unit 703. Figure 7 The software test setup shown can run the following units:
[0074] The acquisition unit 701 is used to acquire multiple pieces of request data received by the client within a preset time period, and the processing status of the multiple pieces of request data by the client;
[0075] The processing unit 702 is used to determine, based on the processing situation, request data corresponding to each execution code structure in the one or more execution code structures of the client from the multiple request data, and generate a request data set including all the determined request data;
[0076] The acquisition unit 701 is further used to acquire a test task, where the test task is used to indicate: testing a target execution code structure in the one or more execution code structures;
[0077] The processing unit 702 is further configured to determine target request data matching the test task from the request data set, and execute the test task based on the target request data to obtain a test result.
[0078] In one embodiment, when the processing unit 702 determines the request data corresponding to each execution code structure in the one or more execution code structures of the client from the multiple request data based on the processing situation, the processing unit 702 specifically performs the following operations:
[0079] Based on the processing situation, determining the request data processed by each execution code structure from the multiple request data;
[0080] The determined request data processed by each execution code structure is used as the request data corresponding to each execution code structure.
[0081] In one embodiment, the one or more execution code structures of the client are used to implement the functions described by the one or more function points of the client; each of the one or more function points of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; the test task is used to indicate: testing of a target execution code structure in the one or more execution code structures, and the target execution code structure is changed after obtaining the processing situation;
[0082] The processing unit 702 determines target request data matching the test task from the request data set, and executes the test task based on the target request data. When the test result is obtained, the processing unit 702 specifically performs the following operations:
[0083] Determining, from the request data set, request data corresponding to the target execution code structure as the target request data;
[0084] Generate a test script based on the target request data and the test rules included in the function points for describing the functions implemented by the target execution code structure;
[0085] The test script is run to test the modified target execution code structure to obtain the test result.
[0086] In one embodiment, the processing unit 702 is further used to determine, from the request data set, request data corresponding to each of the one or more function points of the client; each function point of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; the function described by each function point is implemented by one or more execution code structures of the client;
[0087] The acquisition unit 701 is further used to acquire a test task, where the test task is used to indicate: a test of an execution code structure for implementing a function described by a target function point among the one or more function points.
[0088] In one embodiment, when the processing unit 702 determines the request data corresponding to each of the one or more function points of the client from the request data set, it specifically performs the following operations:
[0089] Determine an execution code structure for implementing the functions described in each function point;
[0090] The request data corresponding to the determined execution code structure is used as the request data corresponding to each function point.
[0091] In one embodiment, the test task is used to indicate: testing of an execution code structure for implementing a function described by a target function point among the one or more function points;
[0092] The processing unit 702 determines target request data matching the test task from the request data set, and executes the test task based on the target request data. When the test result is obtained, the processing unit 702 specifically performs the following operations:
[0093] Determining the request data corresponding to the target function point from the request data set as the target request data;
[0094] Generate a test script based on the target request data and the test rules currently included in the target function point;
[0095] The test script is run to test the execution code structure used to implement the function described by the target function point, and the test result is obtained.
[0096] In one embodiment, the test task is used to instruct: testing of a target execution code structure in the one or more execution code structures, and the target execution code structure is changed after obtaining the processing situation;
[0097] If the test result indicates that the test task fails, the output unit 703 is used to output first prompt information, where the first prompt information is used to indicate that there is a defect in the modified target execution code structure;
[0098] If the test result indicates that the test task is successful, the output unit 703 is also used to output a second prompt information, and the processing unit 702 is also used to update the client based on the changed target execution code structure; the second prompt information is used to indicate that there are no defects in the changed target execution code structure.
[0099] According to one embodiment of the present application, Figure 2 as well as Figure 5 The various steps involved in the software testing method shown can be Figure 7 The software test apparatus shown is executed by each unit. For example, Figure 2 Step S201 and step S203 shown in FIG. Figure 7 The acquisition unit 701 in the software testing device shown is executed, Figure 2 Step S202 and step S204 shown in FIG. Figure 7 The processing unit 702 in the software testing device shown is executed. Figure 5 Step S501 and step S504 shown in FIG. Figure 7 The acquisition unit 701 in the software testing device shown is executed, Figure 5 Step S502, step S503 and step S505 shown in FIG. Figure 7 The software testing apparatus shown is executed by the processing unit 702.
[0100] According to another embodiment of the present application, Figure 7 The various units in the software testing device shown can be respectively or all merged into one or several other units to constitute, or some of the units (some) can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of a unit can also be realized by multiple units, or the function of multiple units is realized by one unit. In other embodiments of the present application, the software testing device based on the logical function division can also include other units. In practical applications, these functions can also be assisted by other units to be realized, and can be realized by the collaboration of multiple units.
[0101] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 as well as Figure 5 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 7 The software testing device shown in and the software testing method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0102] In the embodiment of the present application, after the acquisition unit 701 acquires the multiple request data received by the client within the preset time period and the processing status of the multiple request data by the client, the processing unit 702 can determine the request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data based on the processing status, and generate a request data set containing all the determined request data; when the acquisition unit 701 acquires the test task for the target execution code structure that has been changed in the one or more execution code structures, the processing unit 702 can determine the target request data matching the test task from the request data set, and execute the test task based on the target request data to obtain the test result. When any execution code structure in the execution code structure is changed, the request data corresponding to the changed execution code structure can be determined from the request data set based on the correspondence between the execution code structure and the request data established in advance, as the target request data, so as to test the changed execution code structure based on the target request data, which can avoid repeated processing of the multiple request data acquired from the client, can realize rapid positioning of the request data used for testing, improve test efficiency and save processing resources.
[0103] Based on the above method embodiment and device embodiment, the present application also provides a software testing device. Figure 8 , is a structural diagram of a software testing device provided in an embodiment of the present application. Figure 8 The software testing device shown may include at least a processor 801, an input interface 802, an output interface 803, and a computer storage medium 804. The processor 801, the input interface 802, the output interface 803, and the computer storage medium 804 may be connected via a bus or other means.
[0104] The computer storage medium 804 can be stored in the memory of the software testing device. The computer storage medium 804 is used to store a computer program. The computer program includes program instructions. The processor 801 is used to execute the program instructions stored in the computer storage medium 804. The processor 801 (or CPU (Central Processing Unit)) is the computing core and control core of the software testing device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the above-mentioned software testing method process or corresponding functions.
[0105] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a software testing device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 801 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed random access memory (RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0106] In one embodiment, the processor 801, the input interface 802, and the output interface 803 may load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 2 as well as Figure 5 In the corresponding steps of the method in the software testing method embodiment, in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 801, the input interface 802 and the output interface 803 and execute the following steps:
[0107] An input interface 802 is used to obtain multiple pieces of request data received by the client within a preset time period, and the processing status of the multiple pieces of request data by the client;
[0108] Processor 801 is used to determine, based on the processing situation, request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data, and generate a request data set including all the determined request data;
[0109] The input interface 802 is further used to obtain a test task, where the test task is used to indicate: testing of a target execution code structure in the one or more execution code structures;
[0110] The processor 801 is further configured to determine target request data matching the test task from the request data set, and execute the test task based on the target request data to obtain a test result.
[0111] In one embodiment, when the processor 801 determines, based on the processing situation, from the multiple pieces of request data, request data corresponding to each of the one or more execution code structures of the client, the processor 801 specifically performs the following operations:
[0112] Based on the processing situation, determining the request data processed by each execution code structure from the multiple request data;
[0113] The determined request data processed by each execution code structure is used as the request data corresponding to each execution code structure.
[0114] In one embodiment, the one or more execution code structures of the client are used to implement the functions described by the one or more function points of the client; each of the one or more function points of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; the test task is used to indicate: testing of a target execution code structure in the one or more execution code structures, and the target execution code structure is changed after obtaining the processing situation;
[0115] The processor 801 determines target request data matching the test task from the request data set, and executes the test task based on the target request data. When the test result is obtained, the processor 801 specifically performs the following operations:
[0116] Determining, from the request data set, request data corresponding to the target execution code structure as the target request data;
[0117] Generate a test script based on the target request data and the test rules included in the function points for describing the functions implemented by the target execution code structure;
[0118] The test script is run to test the modified target execution code structure to obtain the test result.
[0119] In one embodiment, the processor 801 is further used to determine, from the request data set, request data corresponding to each of the one or more function points of the client; each function point of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; the function described by each function point is implemented by one or more execution code structures of the client;
[0120] The input interface 802 is further used to obtain a test task, where the test task is used to indicate: a test of an execution code structure for implementing the function described by a target function point among the one or more function points.
[0121] In one embodiment, when the processor 801 determines the request data corresponding to each of the one or more function points of the client from the request data set, the processor 801 specifically performs the following operations:
[0122] Determine an execution code structure for implementing the functions described in each function point;
[0123] The request data corresponding to the determined execution code structure is used as the request data corresponding to each function point.
[0124] In one embodiment, the test task is used to indicate: testing of an execution code structure for implementing a function described by a target function point among the one or more function points;
[0125] The processor 801 determines target request data matching the test task from the request data set, and executes the test task based on the target request data to obtain a test result, including:
[0126] Determining the request data corresponding to the target function point from the request data set as the target request data;
[0127] Generate a test script based on the target request data and the test rules currently included in the target function point;
[0128] The test script is run to test the execution code structure used to implement the function described by the target function point, and the test result is obtained.
[0129] In one embodiment, the test task is used to instruct: testing of a target execution code structure in the one or more execution code structures, and the target execution code structure is changed after obtaining the processing situation;
[0130] If the test result indicates that the test task fails, the output interface 803 is used to output first prompt information, where the first prompt information is used to indicate that there is a defect in the modified target execution code structure;
[0131] If the test result indicates that the test task is successful, the output interface 803 is used to output a second prompt message, and the processor 801 is used to update the client based on the changed target execution code structure; the second prompt message is used to indicate that there are no defects in the changed target execution code structure.
[0132] The embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the software testing device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the software testing device performs the above-mentioned Figure 2 or Figure 5 The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0133] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A software testing method, characterized in that: include: Acquire multiple pieces of request data received by the client within a preset time period, and processing status of the multiple pieces of request data by the client; Based on the processing situation, determining request data corresponding to each execution code structure in one or more execution code structures of the client from the multiple request data; including: Based on the processing situation, determining the request data processed by each execution code structure from the multiple request data; The determined request data processed by each execution code structure is used as the request data corresponding to each execution code structure to generate a request data set containing all the determined request data; the one or more execution code structures of the client are used to implement the functions described by one or more function points of the client; each of the one or more function points of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; Acquire a test task, the test task being used to instruct: testing a target execution code structure in the one or more execution code structures, and the target execution code structure is changed after acquiring the processing situation; Determining, from the request data set, request data corresponding to the target execution code structure as target request data; Generate a test script based on the target request data and the test rules included in the function points for describing the functions implemented by the target execution code structure; Run the test script to test the modified target execution code structure and obtain the test result; If the test result indicates that the test task fails, outputting first prompt information, wherein the first prompt information is used to indicate that there is a defect in the modified target execution code structure; If the test result indicates that the test task is successful, a second prompt information is output, and the client is updated based on the modified target execution code structure; the second prompt information is used to indicate that there are no defects in the modified target execution code structure.
2. The method according to claim 1, characterized in that The method further comprises: Determining request data corresponding to each of one or more function points of the client from the request data set; each function point of the client includes function description information for describing a function of the client and a test rule for describing a test of a function of the client; the function described by each function point is implemented by one or more execution code structures of the client; A test task is obtained, where the test task is used to indicate: a test on an execution code structure for implementing a function described by a target function point among the one or more function points.
3. The method according to claim 2, characterized in that The determining, from the request data set, request data corresponding to each of the one or more function points of the client includes: Determine an execution code structure for implementing the functions described in each function point; The request data corresponding to the determined execution code structure is used as the request data corresponding to each function point.
4. The method according to claim 2, characterized in that The test task is used to indicate: testing of an execution code structure for implementing a function described by a target function point among the one or more function points; The determining target request data matching the test task from the request data set, and executing the test task based on the target request data to obtain a test result includes: Determining the request data corresponding to the target function point from the request data set as the target request data; Generate a test script based on the target request data and the test rules currently included in the target function point; The test script is run to test the execution code structure used to implement the function described by the target function point, and the test result is obtained.
5. A software testing device, characterized in that: include: The software testing device comprises an acquisition unit, a processing unit and an output unit, wherein the acquisition unit, the processing unit and the output unit are used to execute the software testing method according to any one of claims 1 to 4.
6. A software testing device, characterized in that: The software testing device includes an input interface and an output interface, and also includes: a processor adapted to implement one or more instructions; and, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the software testing method according to any one of claims 1 to 4.
7. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by a processor, are used to execute the software testing method according to any one of claims 1 to 4.
