Service testing method, device, service testing equipment and storage medium
By receiving test requests from business systems, determining and combining test scenario information, it solves the problem of being unable to test normally when external channels are abnormal, and achieves the accuracy of test results and the normal operation of the business system under abnormal circumstances.
Patent Information
- Application Number
- CN202110570692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-25
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-05-25
AI Technical Summary
During business system testing, normal testing cannot be performed when external channels are abnormal, causing testing to be blocked.
By receiving the test request sent by the business system, determine the target test scenario and the required sending channel template content, combine the test parameters and template content to generate test scenario information, and conduct the test when the external channel returns to normal.
Ensure that when external channels are abnormal, close to normal test scenario information can still be generated to ensure the accuracy of test results and avoid test obstruction.
Smart Images

Figure CN113297079B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of R&D management technology, and in particular, relates to a business testing method, device, business testing equipment and storage medium. Background Art
[0002] In the prior art, in order to meet the needs of business development, many enterprises have developed or introduced business systems. Such business systems have different levels of complexity due to their business types, business operations, etc. For example, the core business system of a bank is an important part of bank deposit and loan account processing. All business operations related to bank deposits and loan accounts are completed in the business system. Based on this, in order to determine whether each business module in the business system can operate normally and adapt to various scenarios that may occur when each business module performs actual business operations, it is necessary to test each business module in the business system.
[0003] Currently, when users test business modules in a business system, they need to configure a domain name that connects to an external channel for each test environment in the business module, so that the business system can use the external channel to test the business corresponding to the business module. However, when using an external channel to test a business, if an exception occurs in the external channel, the business cannot be tested normally. Summary of the invention
[0004] The embodiments of the present application provide a service testing method, device, service testing equipment and storage medium method and device, which can solve the problem that when using an external channel to test a service, if an abnormality occurs in the external channel, the service cannot be tested normally.
[0005] In a first aspect, an embodiment of the present application provides a service testing method, which is applied to a service testing device, and the method includes:
[0006] When an external channel for testing a target service is abnormal, receiving a test request for the target service sent by a service system, the test request including a service ID, a scenario ID, and test parameter information;
[0007] Determine a target test scenario from multiple test scenarios of the target service according to the service ID and the scenario ID, and determine template contents of multiple sending channels required to be used by the target test scenario;
[0008] Acquire test parameters satisfying the test parameter information from the data pool;
[0009] Combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information;
[0010] The test scenario information is returned to the business system, and the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information.
[0011] In one embodiment, according to the service ID and the scenario ID, determining a target test scenario from multiple test scenarios of the target service, and determining template contents of multiple sending channels required to be used by the target test scenario include:
[0012] Determining, according to the service ID, a plurality of sending channels corresponding to the target service; and
[0013] Determining a target test scene from the multiple test scenes according to the scene ID;
[0014] Based on the multiple sending channels, template contents corresponding to the multiple sending channels in the target test scenario are respectively obtained.
[0015] In one embodiment, the template content includes static template information and dynamic logic rule information;
[0016] Combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information includes:
[0017] For the template content of any sending channel, if there are multiple test parameters, then according to the dynamic logic rule information in the template content, the target test parameters that meet each dynamic logic rule are determined from the multiple test parameters in sequence;
[0018] Replacing the dynamic logic rule information with a plurality of target test parameters respectively;
[0019] The replaced dynamic logic rule information and the static target information are combined to obtain the test scenario information.
[0020] In one embodiment, the test parameter information includes a previous test status of the target service and a test number when the target service is tested; the method further includes:
[0021] If the test request does not include a scenario ID, obtaining a test number included in the test parameter information;
[0022] Determining a next test state for testing the target service according to the test number and the previous test state;
[0023] A target test scenario for testing a next test state of the target service is determined from a plurality of test scenarios of the target service.
[0024] In one embodiment, after combining the test parameters with the template contents of the plurality of sending channels to obtain the test scenario information, the method further includes:
[0025] Acquire business data associated with the target test scenario from the data pool;
[0026] Based on the configuration rules of the business data, the test scenario information is reconfigured to obtain target test scenario information, and the target test scenario information meets the business verification rules of the target business.
[0027] In one embodiment, the method further comprises:
[0028] For any test scenario of the target service, if multiple external channels are normal, then obtain multiple channel test scenario information generated after testing the current test scenario through the multiple external channels respectively;
[0029] Performing data cleaning on the plurality of channel test scenario information respectively to obtain channel test parameters respectively corresponding to the plurality of channel test scenario information under the current test scenario;
[0030] determining a channel test request sent by the business system when testing the current test scenario through the multiple external channels;
[0031] The channel test parameter is associated with the channel test request and stored in the data pool.
[0032] In one embodiment, before respectively acquiring a plurality of channel test scenario information generated after testing the current test scenario through the plurality of external channels, the method further includes:
[0033] monitoring the channel status of the plurality of external channels;
[0034] If the channel states of the multiple external channels are all restored to normal states, multiple test scenarios under the target business are tested through the multiple external channels, and a reminder operation is performed on the business system.
[0035] In a second aspect, an embodiment of the present application provides a service testing device, which is applied to a service testing device, including:
[0036] A receiving module, configured to receive a test request for the target business sent by the business system when an external channel for testing the target business is abnormal, wherein the test request includes a service ID, a scenario ID and test parameter information;
[0037] A first determination module is used to determine a target test scenario from multiple test scenarios of the target business according to the service ID and the scenario ID, and determine template contents of multiple sending channels required to be used by the target test scenario;
[0038] A first acquisition module, used for acquiring test parameters satisfying the test parameter information from a data pool;
[0039] A combining module, used for combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information;
[0040] A return module is used to return the test scenario information to the business system, and the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information.
[0041] In a third aspect, an embodiment of the present application provides a business testing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.
[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspects above is implemented.
[0043] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a service testing device, the service testing device executes any one of the methods described in the first aspect above.
[0044] Compared with the prior art, the beneficial effect of the embodiment of the present application is that when it is determined that the external channel is abnormal, a test request for testing the target business sent by the business system is received through the business test device. Afterwards, the target test scenario of the target business and the template content corresponding to each external sending channel under the target test scenario are determined based on the service ID and scenario ID in the test request, so that the template content currently determined by the business test device is consistent with the template content corresponding to when the external channel is normal. Furthermore, after the business test device obtains the corresponding test parameters from the data pool and combines the template content, the generated test scenario information is closer to the test scenario information when the external channel is normal. Furthermore, the test personnel can more accurately determine the test results of the business based on the received test scenario information, so as to test the business normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 any creative work.
[0046] Figure 1 This is a flowchart of a service testing method provided in an embodiment of the present application;
[0047] Figure 2 This is a schematic diagram of an implementation method of S102 of a service testing method provided in an embodiment of the present application;
[0048] Figure 3 This is a schematic diagram of an implementation method of S104 of a service testing method provided in an embodiment of the present application;
[0049] Figure 4 It is a flowchart of another service testing method provided in an embodiment of the present application;
[0050] Figure 5 This is a flowchart of another service testing method provided by an embodiment of the present application;
[0051] Figure 6 This is a flowchart of another service testing method provided in an embodiment of the present application;
[0052] Figure 7 This is a flowchart of another service testing method provided in an embodiment of the present application;
[0053] Figure 8 It is a structural block diagram of a service testing device provided by an embodiment of the present application;
[0054] Fig. 9 This is a structural block diagram of a service testing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0056] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0058] The service testing method provided in the embodiment of the present application can be applied to service testing devices such as notebook computers, ultra-mobile personal computers (UMPCs), and can also be applied to service testing platforms. Specifically, the above service testing platform can be a mock platform. The embodiment of the present application does not impose any restrictions on the specific type of service testing equipment.
[0059] See also Figure 1 , Figure 1 A flowchart of an implementation of a service testing method provided in an embodiment of the present application is shown, and the method comprises the following steps:
[0060] S101. When an external channel for testing a target service is abnormal, a test request for the target service sent by a service system is received, where the test request includes a service ID, a scenario ID, and test parameter information.
[0061] In the embodiment of the present application, the business system is a system for initiating business testing. Generally, a business system includes multiple business modules to perform functions corresponding to multiple businesses. In addition, for each newly launched business in the business system, it is usually necessary to perform business testing on the business module corresponding to the business in advance to determine whether the business module can operate normally in the actual scenario and achieve the expected effect.
[0062] Usually, when testing a business, the tester needs to pre-configure the corresponding test scenario, and then initiate a test request to the business test device to obtain the corresponding test scenario information. After that, the test scenario information is sent to the business system through the corresponding external channels, and the tester makes a judgment based on the test scenario information actually received by the business system to determine the test result of the business.
[0063] However, in the actual process, external channels are usually handled by other channel vendors. Therefore, it is understandable that testers have a strong dependence on external channels when conducting business testing. That is, when an exception occurs in the external channel, the tester cannot test the business normally. Therefore, this embodiment is a targeted example description proposed to avoid obstruction of business testing when the external channel is abnormal. It should be added that when conducting business testing, the reason for sending test scenario information through external channels is that after the business goes online, in the process of executing the corresponding functions of the business, the business information generated by it (including but not limited to notification information, verification information, etc.) is sent to the user through external channels (SMS sending channels, APP sending channels, etc.). Therefore, testing the business through external channels can make the test scenario information received by the business system closer to the information actually received by the user. In this way, using external channels for business testing can enable testers to more accurately determine the test results of the business based on the received test scenario information.
[0064] Based on this, in this embodiment, when the external channel is abnormal, the business test device that performs the above-mentioned business test can be a device that pre-sets multiple business test strategies for the user, which can be used to generate test scenario information according to the test request, and send the test scenario information to the business system. Among them, the above-mentioned business test device can be specifically a mock platform, which has the function of simulating and controlling external or system-level objects or interfaces, so that testers can complete the test of the business module without interacting with the real environment (the environment that sends the test scenario information through the external channel) when performing business testing.
[0065] In an embodiment of the present application, the above-mentioned test request is a request initiated when the business system needs to test a certain business, wherein the test request includes but is not limited to the service ID, scenario ID and test parameter information of the business. Among them, the service ID can be used to identify the business, and enable the business test equipment to determine all external channels that may be required for the business during the test according to the service ID. Afterwards, the test equipment can determine the target test scenario according to the scenario ID, so as to obtain the template content corresponding to each external channel under the target test scenario. The above-mentioned test parameter information includes but is not limited to the order number, order status and other information when testing the business.
[0066] In the embodiments of the present application, the service ID and scenario ID include but are not limited to numbers, letters or a combination thereof, and are not limited thereto. It is understandable that the service ID and scenario ID are both unique, and the service ID is used to uniquely identify multiple services, and the scenario ID is used to uniquely identify multiple test scenarios.
[0067] It should be noted that when the external channels are normal, the template contents corresponding to the multiple external channels used in each test scenario must be stored in the business test device in advance, so that the template content determined by the business test device based on the scenario ID and service ID is consistent with the actually set template content.
[0068] S102: Determine a target test scenario from multiple test scenarios of the target service according to the service ID and the scenario ID, and determine template contents of multiple sending channels required for the target test scenario.
[0069] In the embodiment of the present application, the above target test scenario is a test scenario for testing the service. Each test scenario can usually be pre-configured by a configuration personnel, and its configuration content includes but is not limited to configuring a scenario ID for the test scenario, configuring a corresponding sending channel for the test scenario, and configuring a corresponding template content for each sending channel used in the test scenario.
[0070] In an embodiment of the present application, when the external channel is normal, the service ID contained in the test request initiated by the business system is used to determine multiple channels that may return test scenario information for the business. Specifically, for information notification type services, the available external channels for sending information usually include APP sending channels, SMS sending channels, and email sending channels. However, for the target business under test, it may only be able to send test scenario information through SMS channels and / or WeChat public account channels. At this time, the business testing equipment can determine the multiple external channels required for the target business from multiple external channels based on the service ID contained in the test request.
[0071] In an embodiment of the present application, the above-mentioned template content may be information content pre-set by the configuration personnel in the test scenario of the business. Among them, for the template content under a test scenario, it usually includes multiple types. That is, each external channel under a test scenario usually corresponds to a template content. For example, the same test scenario includes both the template content under the SMS sending channel and the template content under the APP sending channel. It should be noted that the reason for configuring the corresponding template content for each sending channel is that the template content under the SMS sending channel and the template content under the APP sending channel belong to different information sending types, and their respective configuration logic rules are different. Therefore, each external channel usually corresponds to a template content, so that the test scenario information generated based on the template content can be sent through the corresponding external channel.
[0072] It is understandable that in the same test scenario, although each external channel usually corresponds to a template content, the test scenario information generated based on each template content is the same. That is, in the target scenario, when the generated APP notification information and SMS notification information are sent to the same user's terminal, the displayed information content is the same.
[0073] S103: Acquire test parameters satisfying the test parameter information from a data pool.
[0074] In the embodiment of the present application, a large number of test parameters are pre-stored in the data pool, however, the test parameters required in each test scenario are different. Based on this, the business test device can obtain the test parameters that meet the test parameter information from the data pool. The above-mentioned data pool can be a data pool of the business test device, or a data pool in the business system, which can be connected to the business test device for data, and this is not limited.
[0075] Exemplarily, the above test parameter information may include a user information condition, and the service test device obtains user information that meets the user information condition from the data pool as a test parameter according to the user information condition. For example, the data pool records a large number of users' SMS contact information and / or email contact information. If the user information condition is a condition for obtaining SMS contact information, the service test device may determine the user with the user's SMS contact information recorded as the target user, and simultaneously obtain other information of the target user stored in the data pool as a test parameter for subsequent processing.
[0076] It should be noted that for the template contents corresponding to different sending channels in the same test scenario, the above S102 has explained that the template contents belong to different information sending types, and their respective configuration logic rules are different. Therefore, the test parameters obtained based on the test parameter information should have multiple configuration logic rules that are respectively adapted to the corresponding template contents.
[0077] S104: Combine the test parameters with the template contents of the multiple sending channels to obtain test scenario information.
[0078] In the application, the above template content has been described in the above S102, and will not be described again. Usually, the template content includes static template information and dynamic logic rule information. Among them, the above static template information is fixed content, and the dynamic logic rule information can be replaced by the logic code pre-configured by the configuration personnel with specific test parameters.
[0079] Exemplarily, the test scenario is a scenario of notifying users to collect vouchers, and the corresponding template content may be "Dear [#surname#][#title#], you have spent over one hundred yuan on x month x day of xx year, please go to [#collection address#] to collect the coupon". Among them, "Dear", "You have spent over one hundred yuan" and other information are all static template information, and "[#surname#]", "[#title#]" are all dynamic logic rule information. The business testing equipment can make replacements based on the dynamic logic rule information and the obtained test parameters. For example, if the test parameters include the user's name and the user's gender, the testing equipment can obtain the surname in the user's name based on the dynamic logic rule information of "surname" and replace it; and, based on the dynamic logic rule information of "title", replace "title" with "Mr." or "Ms.", without limitation. That is, the dynamic logic rule information in the above template content can be replaced by the pre-configured logic statement code with the corresponding test parameters, without limitation. Among them, the above logic statement code can be an SQL statement.
[0080] It is understandable that the above S102 has described that there are multiple template contents, and S103 has described that there should be multiple test parameters obtained based on the test parameter information, which are respectively adapted to the configuration logic rules of the corresponding template contents. Based on this, the service test device generates multiple test scenario information, and although the actual content of each test scenario information is the same, due to different information sending types, each test scenario information corresponds to a sending channel.
[0081] S105: Return the test scenario information to the business system, and the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information.
[0082] In an embodiment of the present application, after the above test scenario information is generated, it can be directly returned to the business system by the business test equipment and processed by the test personnel of the business system. Furthermore, when the external channel is abnormal, the test personnel can also carry out the business normally. Among them, the business system pre-stores the preset test scenario information when each test scenario is normal. The business system can obtain the corresponding preset test scenario information based on the scenario ID carried in the test scenario information, and then compare it with the actually returned test scenario information, so that the test personnel can determine the test result of the target business.
[0083] It is understandable that the information content of each of the multiple test scenario information generated in one test scenario is usually the same. Therefore, the number of the preset scenario information can be 1.
[0084] In this embodiment, when it is determined that the external channel is abnormal, a test request for testing the target business sent by the business system is received through the business test device. Afterwards, the target test scenario of the target business and the template content corresponding to each external sending channel under the target test scenario are determined based on the service ID and scenario ID in the test request, so that the template content currently determined by the business test device is consistent with the template content corresponding to the external channel when it is normal. Furthermore, after the business test device obtains the corresponding test parameters from the data pool and combines the template content, the generated test scenario information is closer to the test scenario information when the external channel is normal. Furthermore, the test personnel can more accurately determine the test results of the business based on the received test scenario information, so as to test the business normally.
[0085] Reference Figure 2 In one embodiment, in S102, according to the service ID and the scenario ID, a target test scenario is determined from multiple test scenarios of the target service, and the template content of multiple sending channels required to be used by the target test scenario is determined, which specifically includes the following sub-steps S1021-1023, which are described in detail as follows:
[0086] S1021. Determine, according to the service ID, a plurality of sending channels corresponding to the target service.
[0087] S1022. Determine a target test scene from the multiple test scenes according to the scene ID.
[0088] S1023. Based on the multiple sending channels, respectively obtain template contents corresponding to the multiple sending channels in the target test scenario.
[0089] In the embodiment of the present application, the above service ID and scenario ID have been explained in the above S101 and will not be described again.
[0090] In an embodiment of the present application, the service test device may first determine all available sending channels under the service according to the service ID. Then, the target test scenario is determined according to the scenario ID in the test request. Furthermore, the service test device may obtain the template content corresponding to the determined sending channel in the target test scenario based on the determined sending channel. For example, the short message sending template corresponding to the SMS sending channel or the APP information sending template corresponding to the APP sending channel.
[0091] It is understandable that after the service test device processes the SMS template content according to the test parameter information in the test request and generates the corresponding test scenario information, the test scenario information can only be sent through the SMS sending channel. Similarly, the above-mentioned APP sending channel is similar to the SMS sending channel, which will not be described in detail.
[0092] Reference Figure 3 In one embodiment, the template content includes static template information and dynamic logic rule information; in S104, combining the test parameters with the template contents of the multiple sending channels to obtain the test scenario information specifically includes the following sub-steps S1041-1043, which are described in detail as follows:
[0093] S1041. For the template content of any sending channel, if there are multiple test parameters, then according to the dynamic logic rule information in the template content, determine the target test parameters that meet each dynamic logic rule from the multiple test parameters in turn.
[0094] In the embodiment of the present application, for the static template information and dynamic logic rule information in the template content, usually, there are multiple dynamic logic rule information, and there are usually multiple test parameters obtained from the data pool according to the test parameter information. Based on this, the business test device can determine the target test parameters that meet each dynamic logic rule from the above multiple test parameters according to the dynamic logic rule information.
[0095] Specifically, referring to the example in S104 above, the target test scenario is a scenario of notifying the user to collect the voucher. In this target test scenario, the business test device can determine the target test parameters that meet each dynamic logic rule from multiple test parameters (user name, activity address, user contact information) based on the test parameters according to dynamic logic rule information such as [#surname#], [#title#], and [#collection address#].
[0096] S1042. Replace the dynamic logic rule information with a plurality of target test parameters respectively.
[0097] S1043. Combine the replaced dynamic logic rule information and the static target information to obtain the test scenario information.
[0098] In the embodiment of the present application, after determining the target test parameters based on step S1041, the business test device can replace the dynamic logic rule information with the corresponding target test parameters according to the logic statement code corresponding to the dynamic logic rule information in the above template content. Based on this, after the replaced dynamic logic rule information (target test parameters) and the static target information are combined, the test scenario information can be obtained.
[0099] Exemplarily, the above test parameters can be stored in the data pool in the form of an XML table. For the template content corresponding to any external channel, the business testing device can obtain the logic statement code in the dynamic logic rule information after determining the template content. Afterwards, the code is executed to automatically write the target test parameters into the reserved position of the template content (that is, replace the location of the dynamic logic rule information). Specifically, the dynamic logic rule information is set in the template content in the form of a placeholder. For example, the placeholder can be set in the form of "${parameter=A}". Among them, parameter is represented as a parameter, that is, the parameter of the placeholder here is "A", and "A" means that after executing the code of the dynamic logic rule information, the test parameter obtained from the data pool will replace the placeholder where "A" is located, so as to automatically combine the template content to obtain the test scenario information.
[0100] Reference Figure 4 In one embodiment, the test parameter information includes the last test status of the target service and the test number when the target service is tested; the service testing method further includes the following steps S111-S113, which are described in detail as follows:
[0101] S111. If the test request does not include a scenario ID, obtain a test number included in the test parameter information.
[0102] In the embodiment of the present application, the above-mentioned test parameter information also includes the test status of the target service, specifically the last test status when the target service is tested, and the test number when the target service is tested.
[0103] In an embodiment of the present application, the above test parameter information can be recorded in a test order for testing the target business, and the test parameter information recorded in the test order can be processed in advance by the tester. Then, the generated test order is sent to the business test device. Among them, the above test order can be understood as a test order that will be carried in each test request initiated by the business, and the test order is used to record all test parameter information in the test request (including but not limited to the test number obtained by the test order and the previous test status of the test order).
[0104] In the embodiment of the present application, when the scenario ID is not included in the above test parameter information, the service test device cannot directly determine which test scenario of the target service is to be used for the specific service test. Based on this, after determining the multiple sending channels corresponding to the target service, the service test device can determine the target test scenario based on the previous test status in the test parameter information.
[0105] S112: Determine a next test state for testing the target service according to the test number and the previous test state.
[0106] S113: Determine, from a plurality of test scenarios of the target service, a target test scenario for testing a next test state of the target service.
[0107] In an embodiment of the present application, a test number can be used to identify the service each time the service testing device performs a test. Exemplarily, the service testing device can compare the currently received test number with multiple test numbers received at the previous moment to determine whether the same test number has been received at the previous moment. If it is determined that there is the same test number, the service to be tested corresponding to the test number at the previous moment can be determined based on the test number received at the previous moment, and the service can be determined as the target service. At the same time, after determining the target service, the service testing device can directly determine multiple test scenarios in the target service, the test state corresponding to each test scenario, and the test order of the test state. Based on this, the service testing device determines the next test state for testing the target service based on the previous test state and the test order. Afterwards, based on the test state corresponding to each test scenario, the target test scenario for testing the next test state of the target service is determined.
[0108] Specifically, the above-mentioned one business includes multiple test scenarios, and usually the corresponding template content in each test scenario is different, which is used to test different business scenarios under the same business. Exemplarily, the target business includes test scenario A at the beginning of the activity and test scenario B after the activity is completed. For test scenario A, at the beginning of the activity, the corresponding template content in the test scenario can be, such as "Dear [#surname#][#title#], hello! You have signed up for the event on x month x day of xxxx, please go on time." And after the event is completed, the template content in the corresponding test scenario B can be, such as "Dear [#surname#][#title#], hello! You won the [#X#] prize in the event on x month x day of xxxx, please collect it on time" and so on. At this time, test scenario A and test scenario B are scenarios for testing two activity states (activity initial state and activity completed state) under the target business. Based on this, when the business test device determines that the previous test state is in the activity initial state, it means that the business test device has used test scenario A to test the scenario in the activity initial state. Afterwards, when the service test device receives a service test request initiated by the service at the current moment, it can determine that the next state of testing the target service is the activity completed state. Afterwards, the B test scenario corresponding to the activity completed state is determined as the target test scenario required to be used by the service test device.
[0109] It should be noted that after the business test device tests the target test scenario, the test scenario information returned to the business system may also include the test status and test number corresponding to the target test scenario, so that the business system can write the test status and test number as test parameter information into the test order. Furthermore, the test request initiated by the business system for the target business again may not include the scenario ID written by the tester. Furthermore, it can avoid the situation where the tester misconfigures the scenario ID in the test request due to the excessive number of test scenarios in the target business when configuring the scenario ID in the test request, resulting in one or more test scenarios being missed.
[0110] Reference Figure 5 In one embodiment, after combining the test parameters with the template contents of the multiple sending channels to obtain the test scenario information in S104, the following steps S141-142 are also included, which are described in detail as follows:
[0111] S141. Acquire business data associated with the target test scenario from the data pool.
[0112] In the embodiments of the present application, when the above-mentioned target test scenario is used to test the service, it is only necessary to obtain the test parameters from the data pool to replace the template content. However, in actual situations, there are special test scenarios for the tests required by the service. When the service is tested under this test scenario, it needs to be supplemented with actual service data so that the generated test scenario information can meet the service verification rules. This type of data that needs to meet the service verification rules is the corresponding service data.
[0113] In the embodiment of the present application, the above-mentioned business data can be associated with the corresponding target test scenario in advance by the tester, and the association relationship is stored, so that the business test device can obtain the business data from the data pool based on the association relationship.
[0114] S142. Reconfigure the test scenario information based on the configuration rule of the business data to obtain target test scenario information, where the target test scenario information meets the business verification rule of the target business.
[0115] In the embodiment of the present application, the configuration rules of the above-mentioned business data are similar to the method of using test parameters to replace dynamic logic rule information in S1041.
[0116] Exemplarily, when testing a service, a certain test scenario of the service is usually tested continuously. Specifically, for a test scenario of a consumer service, the test request initiated by the service also includes test parameter information of the consumer's consumption amount. Afterwards, the generated test scenario information may be "Your consumption amount this time is "M$", and the total consumption amount is "N$". At this time, when the business testing device repeats the test scenario again, if the test parameter of the consumer's consumption amount included in the test request initiated by the business this time is "L$", the test scenario information it generates should be "Your consumption amount this time is "L$", and the total consumption amount is "N+L$"". Based on this, it can be considered that for the second test in the target test scenario, it is necessary to obtain the business data pre-stored in the target test scenario from the data pool (that is, the total consumption amount "N$" recorded in the last test). If the business data is not obtained, the generated test scenario information will not conform to the actual situation of the consumer, and the rights and interests of the consumer will be damaged. In this way, the business testing equipment can make the target test scenario information received by the business system closer to the actual information received by the user by obtaining the business data related to the target test scenario. Furthermore, the tester can more accurately determine the test results of the business based on the received test scenario information.
[0117] Reference Figure 6 In one embodiment, the service testing method further includes the following steps S114-S117, which are described in detail as follows:
[0118] S114. For any test scenario of the target business, if multiple external channels are normal, obtain multiple channel test scenario information generated after testing the current test scenario through the multiple external channels.
[0119] In an embodiment of the present application, when the external channel is normal, the test scenario information is usually sent by the external channel. After the business goes online, all kinds of information sent to the outside are sent by the external channel. Therefore, when the external channel is normal, using the external channel to send test scenario information can make the information received by the business system closer to the actual situation. At this time, the test scenario information sent by the external channel is the channel test scenario information. It can be understood that when there are multiple external channels, there are also multiple channel test scenario information generated by them.
[0120] It should be noted that, for any test scenario in the target business, if any of the corresponding multiple external channels is abnormal, the above-mentioned business testing method can be used to perform business testing, so that the business testing equipment can complete the business testing of the target test scenario based on the test request, thereby solving the problem of business system testing being blocked due to external channel abnormalities.
[0121] S115. Perform data cleaning on the multiple channel test scenario information respectively to obtain channel test parameters respectively corresponding to the multiple channel test scenario information in the current test scenario.
[0122] In an embodiment of the present application, the above-mentioned data cleaning of the channel test scenario information can be to clean the static template information in the channel test scenario information, retain the test parameters corresponding to its internal dynamic logic rule information, and the business data associated with the corresponding test scenario.
[0123] For example, for any channel test scenario information, if the channel test scenario information is: "Dear [#M#] [#N#], hello! You have signed up for the event on x month x day of xxxx, please go on time". After cleaning the channel test scenario information, the information such as [#M#] and [#N#] can be retained as channel test parameters.
[0124] S116: Determine the channel test request sent by the business system when the multiple external channels test the current test scenario.
[0125] S117: Associating the channel test parameter information with the channel test request, and storing them in the data pool.
[0126] In the embodiment of the present application, when a service test is performed through an external channel, the service request (i.e., channel test request) initiated by the service system will contain the test scenario ID to be tested, as well as the corresponding test parameter information (channel test parameter information). Based on this, after obtaining the channel test parameters corresponding to each channel test scenario information under the current test scenario, the channel test parameters can be associated with the channel test request and stored, so that when the external channel is abnormal, the service test device can obtain the corresponding test parameters from the data pool based on the test request.
[0127] It can be understood that the above-mentioned associating the channel test parameters with the channel test request can specifically be: associating the channel test parameters with the test parameter information in the channel test request. Based on this, when the external channel is abnormal, the business test device can obtain the corresponding test parameters from the data pool based on the test parameter information in the business request and generate the test scenario information.
[0128] Reference Figure 7 In one embodiment, before respectively acquiring the multiple channel test scenario information generated after testing the current test scenario through the multiple external channels in S114, the following steps S118-S119 are specifically included, which are described in detail as follows:
[0129] S118: Monitor the channel status of the multiple external channels.
[0130] S119: If the channel states of the multiple external channels are all restored to normal, multiple test scenarios under the target business are tested through the multiple external channels, and a reminder operation is performed on the business system.
[0131] In the embodiment of the present application, the above-mentioned channel status includes a normal state and an abnormal state. The channel status of the above-mentioned multiple external channels can be monitored by the business system. Specifically, because the business system needs to use external channels for business testing, the business system can always monitor the channel status of each external channel. Based on this, after the business system determines the channel status of each external channel, the channel status can be sent to the business testing device.
[0132] In the embodiment of the present application, the above-mentioned reminder operation includes but is not limited to reminders via text messages, emails, etc., and is not limited to this.
[0133] It should be noted that, since the external channels used for each of the above-mentioned businesses may be different, when a certain external channel is in an abnormal state, it only affects the related businesses that use the external channel for business testing. Based on this, when the channel status of any external channel returns to normal, it can perform a reminder operation on the business system. Afterwards, the business system can determine the related business that uses the external channel for business testing, and use the external channel to test the related business when the channel status of other external channels used in the related business are all in normal state.
[0134] See also Figure 8 , Figure 8 1 is a structural block diagram of a service testing device provided in an embodiment of the present application. The service testing device in this embodiment includes modules for executing Figures 1 to 7 For details, please refer to the steps in the corresponding embodiment. Figures 1 to 7 as well as Figures 1 to 7 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 8 The service testing device 800 includes: a receiving module 810, a first determining module 820, a first obtaining module 830, a combining module 840 and a returning module 850, wherein:
[0135] The receiving module 810 is used to receive a test request for the target business sent by the business system when an external channel used to test the target business is abnormal, and the test request includes a service ID, a scenario ID and test parameter information.
[0136] The first determination module 820 is used to determine a target test scenario from multiple test scenarios of the target business according to the service ID and the scenario ID, and determine template contents of multiple sending channels required to be used by the target test scenario.
[0137] The first acquisition module 830 is used to acquire test parameters satisfying the test parameter information from the data pool.
[0138] The combining module 840 is used to combine the test parameters with the template contents of the multiple sending channels to obtain test scenario information.
[0139] The return module 850 is used to return the test scenario information to the business system, and the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information.
[0140] In one embodiment, according to the service ID and the scenario ID, the first determining module 820 is further configured to:
[0141] Determining, according to the service ID, a plurality of sending channels corresponding to the target service; and
[0142] Determining a target test scene from the multiple test scenes according to the scene ID;
[0143] Based on the multiple sending channels, template contents corresponding to the multiple sending channels in the target test scenario are respectively obtained.
[0144] In one embodiment, the template content includes static template information and dynamic logic rule information; the combination module 830 is further used to:
[0145] For the template content of any sending channel, if there are multiple test parameters, then according to the dynamic logic rule information in the template content, the target test parameters that meet each dynamic logic rule are determined from the multiple test parameters in sequence;
[0146] Replacing the dynamic logic rule information with a plurality of target test parameters respectively;
[0147] The replaced dynamic logic rule information and the static target information are combined to obtain the test scenario information.
[0148] In one embodiment, the test parameter information includes the last test status of the target service and the test number when the target service is tested; the service testing device 800 also includes the following modules:
[0149] The second acquisition module is used to acquire the test number included in the test parameter information if the test request does not include the scenario ID.
[0150] The second determination module is used to determine the next test state for testing the target service according to the test number and the previous test state.
[0151] The third determination module is used to determine a target test scenario for testing a next test state of the target business from a plurality of test scenarios of the target business.
[0152] In one embodiment, the service testing device 800 further includes the following modules:
[0153] The third acquisition module acquires the business data associated with the target test scenario from the data pool.
[0154] A configuration module is used to reconfigure the test scenario information based on the configuration rules of the business data to obtain target test scenario information, where the target test scenario information meets the business verification rules of the target business.
[0155] In one embodiment, the service testing device 800 further includes the following modules:
[0156] The fourth acquisition module is used to obtain, for any test scenario of the target business, if multiple external channels are normal, multiple channel test scenario information generated after testing the current test scenario through the multiple external channels.
[0157] The data cleaning module is used to perform data cleaning on the multiple channel test scenario information respectively to obtain channel test parameters corresponding to the multiple channel test scenario information respectively under the current test scenario.
[0158] The fourth determining module is used to determine the channel test request sent by the business system when testing the current test scenario through the multiple external channels.
[0159] The storage module is used to associate the channel test parameter with the channel test request and store them in the data pool.
[0160] In one embodiment, the service testing device 800 further includes the following modules:
[0161] A monitoring module is used to monitor the channel status of the multiple external channels.
[0162] The reminder module is used to test multiple test scenarios under the target business through the multiple external channels if the channel states of the multiple external channels are all restored to normal states, and perform a reminder operation on the business system.
[0163] When it is understood that Figure 8In the structural block diagram of the service test device shown in FIG. 1 , each unit / module is used to execute Figures 1 to 7 The steps in the corresponding embodiments, and for Figures 1 to 7 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figures 1 to 7 as well as Figures 1 to 7 The relevant descriptions in the corresponding embodiments are not repeated here.
[0164] Fig. 9 FIG. 1 is a structural block diagram of a service test device provided by another embodiment of the present application. Fig. 9 As shown, the service testing device 900 of this embodiment includes: a processor 910, a memory 920, and a computer program 930 stored in the memory 920 and executable on the processor 910, such as a program of the service testing method. When the processor 910 executes the computer program 930, the steps in each embodiment of the above-mentioned service testing method are implemented, such as Figure 1 Alternatively, the processor 910 implements the above when executing the computer program 930 Figure 8 The functions of each module in the corresponding embodiment are, for example, Figure 8 For details on the functions of modules 810 to 850, please refer to Figure 8 Related description in the corresponding embodiment.
[0165] Exemplarily, the computer program 930 may be divided into one or more units, one or more units are stored in the memory 920, and are executed by the processor 910 to complete the present application. One or more units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 930 in the business test device 900.
[0166] The service test device 900 may include, but is not limited to, a processor 910 and a memory 920. Those skilled in the art will appreciate that Fig. 9 It is only an example of the business test device 900 and does not constitute a limitation of the business test device 900. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the business test device may also include input and output devices, network access devices, buses, etc.
[0167] The processor 910 may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0168] The memory 920 may be an internal storage unit of the service test device 900, such as a hard disk or memory of the service test device 900. The memory 920 may also be an external storage device of the service test device 900, such as a plug-in hard disk, a smart memory card, a flash memory card, etc. equipped on the service test device 900. Furthermore, the memory 920 may also include both an internal storage unit of the service test device 900 and an external storage device.
[0169] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0170] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. The computer-readable medium may include at least: any entity or device that can carry the computer program code to the camera / service test equipment, an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0172] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A service testing method, characterized in that: Applied to business testing equipment, the method comprises: When any external channel used to test the target service is abnormal, receiving a test request for the target service sent by the service system, the test request including a service ID, a scenario ID and test parameter information; According to the service ID and the scenario ID, determine a target test scenario from multiple test scenarios of the target service, and determine template contents of multiple sending channels required to be used by the target test scenario; the target test scenario includes a scenario that needs to be tested continuously; Acquire test parameters satisfying the test parameter information from the data pool; Combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information; Returning the test scenario information to the business system, the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information; After combining the test parameters with the template contents of the multiple sending channels to obtain the test scenario information, the method further includes: Acquire business data associated with the target test scenario from the data pool; the business data includes data stored after the target test scenario was tested last time; Based on the configuration rules of the business data, the test scenario information is reconfigured to obtain target test scenario information, and the target test scenario information meets the business verification rules of the target business.
2. The service testing method according to claim 1, characterized in that: According to the service ID and the scenario ID, a target test scenario is determined from multiple test scenarios of the target service, and template contents of multiple sending channels required to be used by the target test scenario are determined, including: Determining, according to the service ID, a plurality of sending channels corresponding to the target service; and Determining a target test scene from the multiple test scenes according to the scene ID; Based on the multiple sending channels, template contents corresponding to the multiple sending channels in the target test scenario are respectively obtained.
3. The service testing method according to claim 1, characterized in that: The template content includes static template information and dynamic logic rule information; Combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information includes: For the template content of any sending channel, if there are multiple test parameters, then according to the dynamic logic rule information in the template content, the target test parameters that meet each dynamic logic rule are determined from the multiple test parameters in sequence; Replacing the dynamic logic rule information with a plurality of target test parameters respectively; The replaced dynamic logic rule information and the static template information are combined to obtain the test scenario information.
4. The service testing method according to claim 1, characterized in that: The test parameter information includes the last test status of the target service and the test number when the target service is tested; the method further includes: If the test request does not include a scenario ID, obtaining a test number included in the test parameter information; Determining a next test state for testing the target service according to the test number and the previous test state; A target test scenario for testing a next test state of the target service is determined from a plurality of test scenarios of the target service.
5. The service testing method according to claim 1, characterized in that: The method further comprises: For any test scenario of the target service, if multiple external channels are normal, then obtain multiple channel test scenario information generated after testing the current test scenario through the multiple external channels respectively; Performing data cleaning on the plurality of channel test scenario information respectively to obtain channel test parameters respectively corresponding to the plurality of channel test scenario information under the current test scenario; determining a channel test request sent by the business system when testing the current test scenario through the multiple external channels; The channel test parameter is associated with the channel test request and stored in the data pool.
6. The service testing method according to claim 5, characterized in that: Before respectively acquiring the multiple channel test scenario information generated after testing the current test scenario through the multiple external channels, the method further includes: monitoring the channel status of the plurality of external channels; If the channel states of the multiple external channels are all restored to normal states, multiple test scenarios under the target business are tested through the multiple external channels, and a reminder operation is performed on the business system.
7. A service testing device, characterized in that: Applicable to business test equipment, including: A receiving module, configured to receive a test request for the target business sent by the business system when any external channel used to test the target business is abnormal, wherein the test request includes a service ID, a scenario ID and test parameter information; A first determination module is used to determine a target test scenario from multiple test scenarios of the target business according to the service ID and the scenario ID, and determine the template contents of multiple sending channels required to be used by the target test scenario; the target test scenario includes a scenario that needs to be tested continuously; A first acquisition module, used for acquiring test parameters satisfying the test parameter information from a data pool; A combining module, used for combining the test parameters with the template contents of the multiple sending channels to obtain test scenario information; A return module, used to return the test scenario information to the business system, and the business system is used to generate a test result for the target business according to the test scenario information and preset test scenario information; The service testing device also includes: A third acquisition module is used to acquire business data associated with the target test scenario from the data pool; the business data includes data stored after the target test scenario was tested last time; A configuration module is used to reconfigure the test scenario information based on the configuration rules of the business data to obtain target test scenario information, where the target test scenario information meets the business verification rules of the target business.
8. A service testing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
