Sound testing method, device, electronic device and computer readable storage medium

By simulating and generating task objects and detecting application programming interface data, Internet application function testing is automatically implemented, which solves the problems of high labor cost and low efficiency in the existing technology and improves testing efficiency.

CN112699017BActive Publication Date: 2024-08-23RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN201911014191.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-23
Publication Date
2024-08-23
Estimated Expiration
2039-10-23

AI Technical Summary

Technical Problem

The existing technology requires a lot of labor costs and is inefficient when testing Internet application functions, and cannot be suitable for testing work with large amounts of data.

Method used

The task object is generated through simulation, and the preset application programming interface data is detected when the process status of the task object changes, and the sound test result is determined based on the detection result to realize the automated testing process.

Benefits of technology

It greatly saves testers' workload and time, improves testing efficiency, and can be effectively applied to testing work with large amounts of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112699017B
    Figure CN112699017B
Patent Text Reader

Abstract

The disclosed embodiment discloses a sound testing method, device, electronic device and computer-readable storage medium, wherein the sound testing method comprises: generating the task object in response to receiving a task object sound testing instruction; changing the process state of the task object, and detecting preset application programming interface data when the process state of the task object changes; and determining the sound testing result according to the detection result of the preset application programming interface data. The technical solution implements the task object sound testing through simulated operation and application programming interface data detection, which greatly saves the testing workload of the tester and avoids the time spent on executing the real operation process, thereby greatly improving the execution efficiency of the test work, and can be effectively applied to the test work with large data volume.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and in particular to a sound testing method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the development of Internet technology, more and more merchants or service providers provide services to users through Internet applications. However, some functions in Internet applications may fail due to settings or other reasons, thereby reducing the service quality of merchants or service providers and user experience. For example, Internet orders usually set a new order reminder sound to remind merchants or service providers to process the new order in time when a new order is generated. However, if the new order reminder sound function fails due to settings or other reasons, the reminder sound cannot be played when a new order is generated. In this way, merchants or service providers will not be aware of the existence of new orders in time, which will lead to a reduction in the service quality of merchants or service providers, and even affect the operating benefits of merchants or service providers. Therefore, in order to ensure the normal operation of Internet applications, it is necessary to conduct functional tests on them regularly. When testing in the prior art, the test is usually implemented by executing a real operation process. For example, when testing the new order prompt tone, the tester will create an order according to the real order placement process to detect whether the new order prompt tone can be played normally. When testing the order receiving tone, the tester also needs to receive the order according to the real order receiving process to detect whether there is an order receiving prompt tone. Although this test method can ensure the accuracy of the test, this test method requires a lot of manpower costs and has low test efficiency, and cannot be applied to testing work with large amounts of data. Summary of the invention

[0003] Embodiments of the present disclosure provide a sound testing method, device, electronic device, and computer-readable storage medium.

[0004] In a first aspect, a sound testing method is provided in an embodiment of the present disclosure.

[0005] Specifically, the sound testing method includes:

[0006] In response to receiving a task object sound test instruction, generating the task object;

[0007] changing the process state of the task object, and detecting preset application programming interface data when the process state of the task object changes;

[0008] The sound test result is determined according to the preset application programming interface data detection result.

[0009] In combination with the first aspect, in a first implementation of the first aspect of the present disclosure, in response to receiving a task object sound test instruction, generating the task object includes:

[0010] In response to receiving the task object sound test instruction, starting the task object operation application;

[0011] In response to the task object operation application being successfully started, simulating a login to the task object operation application;

[0012] In response to the task object operation application successfully logging in, task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information.

[0013] In combination with the first aspect and the first implementation of the first aspect, in a second implementation of the first aspect of the present disclosure, in response to receiving a task object sound test instruction, generating the task object further includes:

[0014] In response to the simulated generation of the task object, the preset application programming interface data is detected.

[0015] In combination with the first aspect, the first implementation manner of the first aspect, and the second implementation manner of the first aspect, in a third implementation manner of the first aspect of the present disclosure, changing the process state of the task object, and detecting preset application programming interface data when the process state of the task object changes, is implemented as follows:

[0016] The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

[0017] In combination with the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, and the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect of the present disclosure, determining the sound test result according to the preset application programming interface data detection result includes:

[0018] Determine sound test rule data;

[0019] The preset application programming interface data is matched with the sound test rule data, and the sound test result is determined according to the data matching result.

[0020] In combination with the first aspect, the first implementation of the first aspect, the second implementation of the first aspect, the third implementation of the first aspect, and the fourth implementation of the first aspect, the fifth implementation of the first aspect of the present disclosure further includes:

[0021] A preset operation is performed according to the sound test result.

[0022] In a second aspect, a sound testing device is provided in an embodiment of the present disclosure.

[0023] Specifically, the sound testing device comprises:

[0024] A generating module, configured to generate the task object in response to receiving a task object sound test instruction;

[0025] a detection module configured to change the process state of the task object and detect preset application programming interface data when the process state of the task object changes;

[0026] The determination module is configured to determine the sound test result according to the preset application programming interface data detection result.

[0027] In combination with the second aspect, in a first implementation of the second aspect of the present disclosure, the generating module includes:

[0028] a start submodule, configured to start a task object operation application in response to receiving a task object sound test instruction;

[0029] A login submodule, configured to simulate a login to the task object operation application in response to the task object operation application being successfully started;

[0030] The generation submodule is configured to determine the task object parameter information in response to the task object operation application successfully logging in, and simulate the generation of the task object according to the task object parameter information.

[0031] In combination with the second aspect and the first implementation of the second aspect, in a second implementation of the second aspect of the present disclosure, the generating module further includes:

[0032] The detection submodule is configured to detect the preset application programming interface data in response to the simulated generation of the task object.

[0033] In combination with the second aspect, the first implementation of the second aspect, and the second implementation of the second aspect, in a third implementation of the second aspect of the present disclosure, the detection module is configured as follows:

[0034] The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

[0035] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, and the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect of the present disclosure, the determining module includes:

[0036] a determination submodule, configured to determine sound test rule data;

[0037] The matching submodule is configured to match the preset application programming interface data with the sound test rule data, and determine the sound test result according to the data matching result.

[0038] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, the third implementation manner of the second aspect, and the fourth implementation manner of the second aspect, the present disclosure, in a fifth implementation manner of the second aspect, further includes:

[0039] The execution module is configured to execute a preset operation according to the sound test result.

[0040] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement the method steps of the sound testing method in the first aspect above.

[0041] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by a sound testing device, which includes computer instructions involved in the sound testing device for executing the sound testing method in the first aspect.

[0042] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0043] The above technical solution generates a task object by simulation, and detects the preset application programming interface data when the process state of the task object changes, and finally determines the sound test result according to the preset application programming interface data detection result. This technical solution implements the task object sound test through simulation operation and application programming interface data detection, which greatly saves the test workload of the tester and avoids the time spent on executing the real operation process, thereby greatly improving the execution efficiency of the test work, and can be effectively applied to the test work with large data volume.

[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0046] Figure 1 A flow chart showing a sound testing method according to an embodiment of the present disclosure;

[0047] Figure 2 Show according to Figure 1 A flowchart of step S101 of the sound testing method of the illustrated embodiment;

[0048] Figure 3 Show according to Figure 1 A flowchart of step S101 of a sound testing method according to another embodiment is shown;

[0049] Figure 4 Show according to Figure 1 A flowchart of step S103 of the sound testing method of the illustrated embodiment;

[0050] Figure 5 A flow chart showing a sound testing method according to another embodiment of the present disclosure;

[0051] Figure 6 A structural block diagram of a sound testing device according to an embodiment of the present disclosure is shown;

[0052] Figure 7 Show according to Figure 6 A structural block diagram of a generation module 601 of a sound testing device in the illustrated embodiment;

[0053] Figure 8 Show according to Figure 6 A structural block diagram of a generation module 601 of a sound testing device according to another embodiment of the present invention;

[0054] Fig. 9 Show according to Figure 6 A structural block diagram of the determination module 603 of the sound testing device of the illustrated embodiment;

[0055] Fig.10 A structural block diagram of a sound testing device according to another embodiment of the present disclosure is shown;

[0056] Fig.11 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0057] Fig.12 It is a structural diagram of a computer system suitable for implementing the sound testing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0059] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0060] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0061] The technical solution provided by the embodiment of the present disclosure generates a task object through simulation, and when the process state of the task object changes, detects the preset application programming interface data, and finally determines the sound test result according to the detection result of the preset application programming interface data. The technical solution implements the sound test of the task object through simulation operation and application programming interface data detection, which greatly saves the test workload of the tester and avoids the time spent on executing the real operation process, thereby greatly improving the execution efficiency of the test work, and can be effectively applied to the test work with large data volume.

[0062] Figure 1 A flow chart of a sound testing method according to an embodiment of the present disclosure is shown, which can be applied to a server. Figure 1 As shown, the sound testing method includes the following steps S101-S103:

[0063] In step S101, in response to receiving a task object sound test instruction, generating the task object;

[0064] In step S102, the process state of the task object is changed, and when the process state of the task object is changed, preset application programming interface data is detected;

[0065] In step S103, the sound test result is determined according to the preset application programming interface data detection result.

[0066] As mentioned above, with the development of Internet technology, more and more merchants or service providers provide services to users through Internet applications. However, some functions in Internet applications may fail due to settings or other reasons, thereby reducing the service quality of merchants or service providers and user experience. For example, Internet orders usually set a new order reminder sound to remind merchants or service providers to process the new order in time when a new order is generated. However, if the new order reminder sound function fails due to settings or other reasons, the reminder sound cannot be played when a new order is generated. In this way, merchants or service providers will not be aware of the existence of new orders in time, which will lead to a reduction in the service quality of merchants or service providers, and even affect the operating benefits of merchants or service providers. Therefore, in order to ensure the normal operation of Internet applications, it is necessary to perform functional tests on them regularly. When testing in the prior art, the test is usually implemented by executing a real operation process. For example, when testing the new order prompt tone, the tester will create an order according to the real order placement process to detect whether the new order prompt tone can be played normally. When testing the order receiving tone, the tester also needs to receive the order according to the real order receiving process to detect whether there is an order receiving prompt tone. Although this test method can ensure the accuracy of the test, this test method requires a lot of manpower costs and has low test efficiency, and cannot be applied to testing work with large amounts of data.

[0067] In view of the above defects, in this embodiment, a sound test method is proposed, which generates a task object through simulation, and detects preset application programming interface data when the process state of the task object changes, and finally determines the sound test result according to the preset application programming interface data detection result. This technical solution implements the task object sound test through simulation operation and application programming interface data detection, which greatly saves the test workload of the tester and avoids the time spent on executing the real operation process, thereby greatly improving the execution efficiency of the test work, and can be effectively applied to the test work with large data volume.

[0068] In an optional implementation of this embodiment, the task object refers to an object that is generated or created, has a corresponding process state and the process state is changeable, and is used to detect whether the execution of the event object associated with it or the event object related to its state change is normal. For example, the task object can be an order, an activity, a task, etc., and the event object associated with it or related to its state change can be an order reminder sound, an activity reminder sound, a task reminder sound, etc.

[0069] The process state of the task object refers to a state object that can be triggered by a state change trigger event and the data changes after the trigger. Taking the task object as an order as an example, if a user creates an order, the current process state of the order is a new order; then the merchant receives the order, then the merchant's operation of receiving the order can be considered as a state change trigger event, and after being triggered by the event, the process state of the new order becomes a received order; then the merchant prepares the ordered goods for delivery, and the generation of delivery information can be considered as a state change trigger event, and after being triggered by the event, the process state of the received order becomes a delivery order; finally, the deliveryman delivers the ordered goods to the user, and the user signs for them. The user's receipt information can also be considered as a state change trigger event, and after being triggered by the event, the process state of the delivery order becomes a completed order.

[0070] In an optional implementation of this embodiment, the task object sound test instruction can be generated or sent by a task object sound test requester, wherein the task object sound test requester refers to the subject object requesting to test the sound information related to the task object, such as test personnel, test machines and other test resources.

[0071] The application programming interface (API) is a set of definitions, programs and protocols that enable mutual communication between computer software. With the help of the API, system resources and services can be accessed to achieve data and resource sharing. For example, system audio data can be obtained through the API, so that corresponding judgments can be performed based on the API audio data. For example, if it is detected that the API audio data exists, generates data or has data updated, it is considered that the corresponding operating system will have sound playback. On the contrary, if it is detected that the API audio data does not exist, does not generate data, the data is empty or no data update occurs, it is considered that the corresponding operating system has no sound playback.

[0072] In an optional implementation of this embodiment, Figure 2 As shown, the step S101, i.e., generating the task object in response to receiving a task object sound test instruction, includes the following steps S201-S203:

[0073] In step S201, in response to receiving a task object sound test instruction, a task object operation application is started;

[0074] In step S202, in response to the task object operation application being successfully started, simulating logging into the task object operation application;

[0075] In step S203, in response to the task object operation application being successfully logged in, task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information.

[0076] In order to effectively generate task objects and avoid the test workload spent by testers on the actual operation process, saving test time, in this implementation, an automated test method is used to simulate the generation process of task objects. Specifically, first, after receiving the task object sound test instruction, the task object operation application is started; then, after the task object operation application is successfully started, the automated operation unit is used to simulate logging into the task object operation application; finally, in response to the successful login of the task object operation application, the task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information.

[0077] In an optional implementation of this embodiment, the task object operation application refers to an application environment used to generate or operate a task object, such as a certain application program.

[0078] In an optional implementation of this embodiment, the automation operation unit refers to a unit that can perform automation operations according to corresponding commands, such as Appium, where Appium is an open source, cross-platform testing framework that can be used to test native and hybrid applications.

[0079] In an optional implementation of this embodiment, the task object parameter information refers to the parameters required to generate the task object. For example, if the task object is an order, the task object parameters may include one or more of the following parameters: order generation time, order payment time, order shipment time, order completion time, order content, order amount, order discount information, order delivery information, order transaction party information, etc.

[0080] In an optional implementation of this embodiment, the step S101, i.e., generating the task object in response to receiving the task object sound test instruction, further includes the step of detecting the preset application programming interface data after the task object is simulated and generated, i.e., Figure 3 As shown, the step S101, i.e., generating the task object in response to receiving a task object sound test instruction, includes the following steps S301-S304:

[0081] In step S301, in response to receiving a task object sound test instruction, a task object operation application is started;

[0082] In step S302, in response to the task object operation application being successfully started, simulating logging into the task object operation application;

[0083] In step S303, in response to the task object operation application being successfully logged in, the task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information;

[0084] In step S304, in response to the simulated generation of the task object, the preset application programming interface data is detected.

[0085] Considering that after some task objects are generated, their process status will change, and the event object associated with them or the event object related to their status change will be triggered. For example, if the task object is an order, then when the order is generated, in order to notify the order merchant in time, the playing of the new order prompt sound will be triggered. Therefore, in this implementation, after the task object is simulated and generated, the preset application programming interface data needs to be detected to determine whether the event object associated with the task object or the event object related to the task object status change is triggered.

[0086] In an optional implementation of this embodiment, the step S102, i.e., changing the process state of the task object and detecting the preset application programming interface data when the process state of the task object changes, can be implemented as follows:

[0087] The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

[0088] Similarly, in order to effectively generate task objects while avoiding the testing workload spent by testers on performing real operation processes and saving testing time, in this implementation, an automated testing method is used to simulate the process state change process of the task object. For example, with the help of automated operation units such as Appium, the process state of the task object is simulated to change, and after detecting that the process state of the task object has changed, the preset application programming interface data is detected.

[0089] In an optional implementation of this embodiment, Figure 4 As shown, the step S103, i.e. determining the sound test result according to the preset application programming interface data detection result, includes the following steps S401-S402:

[0090] In step S401, the sound test rule data is determined;

[0091] In step S402, the preset application programming interface data is matched with the sound test rule data, and the sound test result is determined according to the data matching result.

[0092] In order to accurately obtain the sound test result according to the detection result of the preset application programming interface data, in this implementation method, the sound test rule data is first determined; then the preset application programming interface data is matched with the sound test rule data, and the sound test result is determined according to the data matching result.

[0093] In an optional implementation of the present embodiment, the sound test rule data refers to rule data for testing sound corresponding to a task object, an event object associated with a task object, or an event object related to a state change of a task object. For example, if the task object is an order, when a new order is generated, a prompt sound needs to be played to remind the merchant to receive and process the new order in a timely manner; when the new order is received by the merchant, since the receiving operation is completed by the merchant, there is no need to play a prompt sound to remind the merchant; when the received order is delivered and successfully signed by the user, at this time, in order to let the merchant know the latest developments of the order in a timely manner, a prompt sound can also be set to be played to inform the merchant that an order has been completed. For the above example, the sound test rule data can be expressed as: when a new order is generated, that is, the order is completed, a prompt sound is played, and when a new order is received, no prompt sound is played.

[0094] After determining or obtaining the above-mentioned sound test rule data, the preset application programming interface data obtained by detection can be compared and matched with the sound test rule data to determine the sound test result. For example, if the sound test rule data is to play a prompt tone when a new order is generated, and the actual detected application programming interface data also has valid audio data or valid audio data updates, then the current sound test is considered normal; if the sound test rule data is not to play a prompt tone when a new order is received, but the actual detected application programming interface data has valid audio data or valid audio data updates, then the current sound test is considered abnormal and fault detection and troubleshooting are required.

[0095] In an optional implementation of this embodiment, the method further includes the step of performing a preset operation according to the sound test result, that is, Figure 5 As shown, the sound testing method includes the following steps S501-S504:

[0096] In step S501, in response to receiving a task object sound test instruction, generating the task object;

[0097] In step S502, the process state of the task object is changed, and when the process state of the task object is changed, preset application programming interface data is detected;

[0098] In step S503, the sound test result is determined according to the preset application programming interface data detection result;

[0099] In step S504, a preset operation is performed according to the sound test result.

[0100] In this implementation, after the sound test result is determined, the corresponding preset operation can be performed according to the sound test result. For example, if the sound test result is normal, a normal work log can be generated and stored; if the sound test result is abnormal, an abnormal work log can be generated, stored and reported, and fault detection and troubleshooting operations can be performed later according to the abnormal work log. That is, the preset operation can include one or more of the following operations: generating a work log, storing a work log, reporting a work log, fault detection, troubleshooting, etc.

[0101] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.

[0102] Figure 6 The structure block diagram of the sound test device according to one embodiment of the present disclosure is shown. The device can be implemented as part or all of the electronic device through software, hardware or a combination of both, and can be implemented as a server. Figure 6 As shown, the sound testing device comprises:

[0103] A generating module 601 is configured to generate the task object in response to receiving a task object sound test instruction;

[0104] A detection module 602 is configured to change the process state of the task object and detect preset application programming interface data when the process state of the task object changes;

[0105] The determination module 603 is configured to determine the sound test result according to the preset application programming interface data detection result.

[0106] As mentioned above, with the development of Internet technology, more and more merchants or service providers provide services to users through Internet applications. However, some functions in Internet applications may fail due to settings or other reasons, thereby reducing the service quality of merchants or service providers and user experience. For example, Internet orders usually set a new order reminder sound to remind merchants or service providers to process the new order in time when a new order is generated. However, if the new order reminder sound function fails due to settings or other reasons, the reminder sound cannot be played when a new order is generated. In this way, merchants or service providers will not be aware of the existence of new orders in time, which will lead to a reduction in the service quality of merchants or service providers, and even affect the operating benefits of merchants or service providers. Therefore, in order to ensure the normal operation of Internet applications, it is necessary to perform functional tests on them regularly. When testing in the prior art, the test is usually implemented by executing a real operation process. For example, when testing the new order prompt tone, the tester will create an order according to the real order placement process to detect whether the new order prompt tone can be played normally. When testing the order receiving tone, the tester also needs to receive the order according to the real order receiving process to detect whether there is an order receiving prompt tone. Although this test method can ensure the accuracy of the test, this test method requires a lot of manpower costs and has low test efficiency, and cannot be applied to testing work with large amounts of data.

[0107] In view of the above defects, in this embodiment, a sound test device is proposed, which generates a task object through simulation, and detects preset application programming interface data when the process state of the task object changes, and finally determines the sound test result according to the preset application programming interface data detection result. This technical solution implements the task object sound test through simulation operation and application programming interface data detection, which greatly saves the test workload of the tester and avoids the time spent on executing the real operation process, thereby greatly improving the execution efficiency of the test work, and can be effectively applied to the test work with large data volume.

[0108] In an optional implementation of this embodiment, the task object refers to an object that is generated or created, has a corresponding process state and the process state is changeable, and is used to detect whether the execution of the event object associated with it or the event object related to its state change is normal. For example, the task object can be an order, an activity, a task, etc., and the event object associated with it or related to its state change can be an order reminder sound, an activity reminder sound, a task reminder sound, etc.

[0109] The process state of the task object refers to a state object that can be triggered by a state change trigger event and the data changes after the trigger. Taking the task object as an order as an example, if a user creates an order, the current process state of the order is a new order; then the merchant receives the order, then the merchant's operation of receiving the order can be considered as a state change trigger event, and after being triggered by the event, the process state of the new order becomes a received order; then the merchant prepares the ordered goods for delivery, and the generation of delivery information can be considered as a state change trigger event, and after being triggered by the event, the process state of the received order becomes a delivery order; finally, the deliveryman delivers the ordered goods to the user, and the user signs for them. The user's receipt information can also be considered as a state change trigger event, and after being triggered by the event, the process state of the delivery order becomes a completed order.

[0110] In an optional implementation of this embodiment, the task object sound test instruction can be generated or sent by a task object sound test requester, wherein the task object sound test requester refers to the subject object requesting to test the sound information related to the task object, such as test personnel, test machines and other test resources.

[0111] The application programming interface (API) is a set of definitions, programs and protocols that enable mutual communication between computer software. With the help of the API, system resources and services can be accessed to achieve data and resource sharing. For example, system audio data can be obtained through the API, so that corresponding judgments can be performed based on the API audio data. For example, if it is detected that the API audio data exists, generates data or has data updated, it is considered that the corresponding operating system will have sound playback. On the contrary, if it is detected that the API audio data does not exist, does not generate data, the data is empty or no data update occurs, it is considered that the corresponding operating system has no sound playback.

[0112] In an optional implementation of this embodiment, Figure 7 As shown, the generating module 601 includes:

[0113] The start submodule 701 is configured to start the task object operation application in response to receiving the task object sound test instruction;

[0114] A login submodule 702 is configured to simulate a login to the task object operation application in response to the task object operation application being successfully started;

[0115] The generation submodule 703 is configured to determine the task object parameter information in response to the task object operation application successfully logging in, and simulate the generation of the task object according to the task object parameter information.

[0116] In order to effectively generate task objects and avoid the test workload spent by testers on the actual operation process, saving test time, in this implementation, an automated test method is used to simulate the generation process of task objects. Specifically, first, after receiving the task object sound test instruction, the task object operation application is started; then, after the task object operation application is successfully started, the automated operation unit is used to simulate logging into the task object operation application; finally, in response to the successful login of the task object operation application, the task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information.

[0117] In an optional implementation of this embodiment, the task object operation application refers to an application environment used to generate or operate a task object, such as a certain application program.

[0118] In an optional implementation of this embodiment, the automation operation unit refers to a unit that can perform automation operations according to corresponding commands, such as Appium, where Appium is an open source, cross-platform testing framework that can be used to test native and hybrid applications.

[0119] In an optional implementation of this embodiment, the task object parameter information refers to the parameters required to generate the task object. For example, if the task object is an order, the task object parameters may include one or more of the following parameters: order generation time, order payment time, order shipment time, order completion time, order content, order amount, order discount information, order delivery information, order transaction party information, etc.

[0120] In an optional implementation of this embodiment, the generation module 601 further includes a part of detecting the preset application programming interface data after the task object is simulated and generated, that is, Figure 8 As shown, the generating module 601 includes:

[0121] The start submodule 801 is configured to start the task object operation application in response to receiving the task object sound test instruction;

[0122] A login submodule 802 is configured to simulate a login to the task object operation application in response to the task object operation application being successfully started;

[0123] The generation submodule 803 is configured to determine the task object parameter information in response to the task object operation application successfully logging in, and simulate the generation of the task object according to the task object parameter information;

[0124] The detection submodule 804 is configured to detect the preset application programming interface data in response to the simulated generation of the task object.

[0125] Considering that after some task objects are generated, their process status will change, and the event object associated with them or the event object related to their status change will be triggered. For example, if the task object is an order, then when the order is generated, in order to notify the order merchant in time, the playing of the new order prompt sound will be triggered. Therefore, in this implementation, after the task object is simulated and generated, the preset application programming interface data needs to be detected to determine whether the event object associated with the task object or the event object related to the task object status change is triggered.

[0126] In an optional implementation of this embodiment, the detection module 602 may be configured as follows:

[0127] The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

[0128] Similarly, in order to effectively generate task objects while avoiding the testing workload spent by testers on performing real operation processes and saving testing time, in this implementation, the detection module 602 uses an automated testing method to simulate the process state change process of the task object. For example, with the help of automated operation units such as Appium, the process state of the task object is simulated to change, and after detecting that the process state of the task object has changed, the preset application programming interface data is detected.

[0129] In an optional implementation of this embodiment, Fig. 9 As shown, the determination module 603 includes:

[0130] The determination submodule 901 is configured to determine sound test rule data;

[0131] The matching submodule 902 is configured to match the preset application programming interface data with the sound test rule data, and determine the sound test result according to the data matching result.

[0132] In order to accurately obtain the sound test results according to the detection results of the preset application programming interface data, in this implementation, the determination submodule 901 determines the sound test rule data; the matching submodule 902 matches the preset application programming interface data with the sound test rule data, and determines the sound test results according to the data matching results.

[0133] In an optional implementation of the present embodiment, the sound test rule data refers to rule data for testing sound corresponding to a task object, an event object associated with a task object, or an event object related to a state change of a task object. For example, if the task object is an order, when a new order is generated, a prompt sound needs to be played to remind the merchant to receive and process the new order in a timely manner; when the new order is received by the merchant, since the receiving operation is completed by the merchant, there is no need to play a prompt sound to remind the merchant; when the received order is delivered and successfully signed by the user, at this time, in order to let the merchant know the latest developments of the order in a timely manner, a prompt sound can also be set to be played to inform the merchant that an order has been completed. For the above example, the sound test rule data can be expressed as: when a new order is generated, that is, the order is completed, a prompt sound is played, and when a new order is received, no prompt sound is played.

[0134] After determining or obtaining the above-mentioned sound test rule data, the preset application programming interface data obtained by detection can be compared and matched with the sound test rule data to determine the sound test result. For example, if the sound test rule data is to play a prompt tone when a new order is generated, and the actual detected application programming interface data also has valid audio data or valid audio data updates, then the current sound test is considered normal; if the sound test rule data is not to play a prompt tone when a new order is received, but the actual detected application programming interface data has valid audio data or valid audio data updates, then the current sound test is considered abnormal and fault detection and troubleshooting are required.

[0135] In an optional implementation of this embodiment, the device further includes a part for performing a preset operation according to the sound test result, that is, Fig.10 As shown, the sound testing device comprises:

[0136] A generating module 1001 is configured to generate the task object in response to receiving a task object sound test instruction;

[0137] The detection module 1002 is configured to change the process state of the task object and detect preset application programming interface data when the process state of the task object changes;

[0138] The determination module 1003 is configured to determine the sound test result according to the preset application programming interface data detection result;

[0139] The execution module 1004 is configured to execute a preset operation according to the sound test result.

[0140] In this implementation, after determining the sound test result, the execution module 1004 can perform the corresponding preset operation according to the sound test result. For example, if the sound test result is normal, a normal work log can be generated and stored; if the sound test result is abnormal, an abnormal work log can be generated and stored and reported; and subsequently, fault detection and troubleshooting operations can be performed according to the abnormal work log. That is, the preset operation can include one or more of the following operations: generating a work log, storing a work log, reporting a work log, fault detection, troubleshooting, and the like.

[0141] The present disclosure also discloses an electronic device, Fig.11 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Fig.11 As shown, the electronic device 1100 includes a memory 1101 and a processor 1102; wherein,

[0142] The memory 1101 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 1102 to implement the above method steps.

[0143] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing the sound testing method according to an embodiment of the present disclosure.

[0144] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage part 1208 to a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the system 1200 are also stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0145] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed, so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0146] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the above-mentioned sound test method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1209, and / or installed from the removable medium 1211.

[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0149] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0150] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A sound testing method, It is characterized in that include: In response to receiving a task object sound test instruction, generating the task object, wherein the task object is generated by simulation; changing the process state of the task object, and detecting preset application programming interface data when the process state of the task object changes, the preset application programming interface data including audio data; The sound test result is determined according to the detection result of the audio data in the preset application programming interface data.

2. The sound testing method according to claim 1, It is characterized in that The step of generating the task object in response to receiving a task object sound test instruction comprises: In response to receiving the task object sound test instruction, starting the task object operation application; In response to the task object operation application being successfully started, simulating a login to the task object operation application; In response to the task object operation application successfully logging in, task object parameter information is determined, and the task object is simulated and generated according to the task object parameter information.

3. The sound testing method according to claim 2, It is characterized in that The step of generating the task object in response to receiving the task object sound test instruction further comprises: In response to the simulated generation of the task object, the preset application programming interface data is detected.

4. The sound testing method according to any one of claims 1 to 3, It is characterized in that The changing the process state of the task object and detecting preset application programming interface data when the process state of the task object changes is implemented as follows: The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

5. The sound testing method according to any one of claims 1 to 3, It is characterized in that The step of determining the sound test result according to the preset application programming interface data detection result includes: Determine sound test rule data; The preset application programming interface data is matched with the sound test rule data, and the sound test result is determined according to the data matching result.

6. The sound testing method according to claim 1, It is characterized in that Also includes: A preset operation is performed according to the sound test result.

7. A sound testing device, It is characterized in that include: A generating module, configured to generate the task object in response to receiving a task object sound test instruction, wherein the task object is generated by simulation; a detection module configured to change the process state of the task object and detect preset application programming interface data when the process state of the task object changes, wherein the preset application programming interface data includes audio data; The determination module is configured to determine the sound test result according to the detection result of the audio data in the preset application programming interface data.

8. The sound testing device according to claim 7, It is characterized in that The generation module comprises: a start submodule, configured to start a task object operation application in response to receiving a task object sound test instruction; A login submodule, configured to simulate a login to the task object operation application in response to the task object operation application being successfully started; The generation submodule is configured to determine the task object parameter information in response to the task object operation application successfully logging in, and simulate the generation of the task object according to the task object parameter information.

9. The sound testing device according to claim 8, It is characterized in that The generation module also includes: The detection submodule is configured to detect the preset application programming interface data in response to the simulated generation of the task object.

10. The sound testing device according to any one of claims 7 to 9, It is characterized in that The detection module is configured as follows: The process state of the task object is simulated to be changed, and in response to detecting that the process state of the task object has changed, preset application programming interface data is detected.

11. The sound testing device according to any one of claims 7 to 9, It is characterized in that The determination module comprises: a determination submodule, configured to determine sound test rule data; The matching submodule is configured to match the preset application programming interface data with the sound test rule data, and determine the sound test result according to the data matching result.

12. The sound testing device according to claim 7, It is characterized in that Also includes: The execution module is configured to execute a preset operation according to the sound test result.

13. An electronic device, It is characterized in that The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 1-6.

14. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that When the computer instructions are executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Automated test method and device, terminal equipment and computer-readable storage medium

    CN108614775A

  • Test method and apparatus

    CN108959087A

  • Test Case Construction Method, Test Method, Apparatus, Equipment and Media

    CN109308266A

  • Automated test method based on access of associated network device

    CN109361562A

  • Programming interface test method and device, electronic device and readable storage medium

    CN110347604A