Automatic testing method and device, storage medium and electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD
- Filing Date
- 2024-11-11
- Publication Date
- 2026-05-12
AI Technical Summary
[0005]本申请提供一种自动化测试方法、装置、存储介质及电子装置,用以解决在智能家电功能自动测试的过程中,功能逻辑互斥规则阻塞自动测试的进程,出现测试指令下发失败,自动测试过程暂停的问题
[0066] The automated testing method, apparatus, storage medium, and electronic device provided in this application acquire relevant functional test instructions and functional logic mutual exclusion rules. Then, based on these functional test instructions, the current functional mode of the smart device, and the functional logic mutual exclusion rules, it determines whether the functional test instructions are logically mutually exclusive with the existing functional mode. If a mutual exclusion is found, the functional mode of the smart device is automatically adjusted to ensure that the functional instructions to be tested no longer conflict with any functional logic mutual exclusion rules. After adjustment, the functional test instructions are sent to the smart device for execution. This method intelligently handles conflicts between functional test instructions and the device's current functional mode, avoiding logical mutual exclusion through automatic adjustment, thereby ensuring the smooth execution of functional test instructions and significantly improving the testing efficiency and reliability of the smart device.
Smart Images

Figure CN122018478A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home / intelligent home technology, and more specifically, to an automated testing method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the surge in smart home appliance users and the diversification of user needs, smart home appliances are also launching various functions and feature sets in a timely manner. To ensure the stability, security, and ease of use of smart home appliances, automated testing has become an indispensable part. Automated testing can simulate various usage scenarios, discover potential problems and defects, and thus fix them before product release, improving product quality and user experience.
[0003] Smart home appliances often have some conflicts or constraints between their various functions, whether in a static or operational state. Therefore, when defining the functions, the product needs to clearly inform the user of these functional conflicts or constraints, i.e., the mutual exclusion rules of functional logic.
[0004] During the automatic testing of smart home appliance functions, the mutual exclusion rules of functional logic can block the process of automatic testing, resulting in problems such as failure to issue test commands and suspension of the automatic testing process. This leads to the inability to advance the automatic testing process and a decrease in the efficiency and quality of smart home appliance function testing. Summary of the Invention
[0005] This application provides an automated testing method, apparatus, storage medium, and electronic device to solve the problem that during the automated testing of smart home appliances, functional logic mutual exclusion rules block the automated testing process, resulting in test command issuance failure and the automatic testing process being suspended.
[0006] Firstly, this application provides an automated testing method, including:
[0007] Obtain functional test instructions and functional logic mutual exclusion rules for smart devices;
[0008] Based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule, determine whether the functional test instruction hits the functional logic mutual exclusion rule;
[0009] If the functional logic mutual exclusion rule is met, the functional mode of the smart device is adjusted so that the functional instruction to be tested does not satisfy the functional logic mutual exclusion rule.
[0010] The function test command is sent to the smart device.
[0011] Optionally, determining whether the functional test instruction matches the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule includes:
[0012] Obtain the set of mutually exclusive elements of the functional logic mutual exclusion rule; the set of mutually exclusive elements includes: condition attributes and influence attributes;
[0013] Based on the functional test instruction, the current functional mode of the smart device, and the set of mutually exclusive elements, determine whether the functional test instruction hits the functional logic mutual exclusion rule;
[0014] If the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute in the set of mutually exclusive elements, then the functional test instruction is determined to have hit the functional logic mutual exclusion rule.
[0015] Optionally, adjusting the functional mode of the smart device includes:
[0016] Determine the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule; the first functional logic mutual exclusion rule is the functional logic mutual exclusion rule that matches the current functional mode of the smart device;
[0017] Based on the mutual exclusion condition, the target functional mode of the smart device is determined;
[0018] Adjust the function mode of the smart device to the target function mode.
[0019] Optionally, determining the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule includes:
[0020] Based on the first functional logic mutual exclusion rule, a first condition attribute and a first influence attribute corresponding to the first functional logic mutual exclusion rule are determined; wherein, the combination of the first condition attribute and the first influence attribute can constitute the first functional logic mutual exclusion rule; the first influence attribute is the same as the function corresponding to the functional test instruction.
[0021] Based on the first conditional attribute, a second conditional attribute is determined, wherein the second conditional attribute is a functional mode of the same category as the first conditional attribute;
[0022] Determine whether the second conditional attribute and the current functional mode of the smart device match the functional logic mutual exclusion rule;
[0023] If not, then the mutual exclusion situation is determined to be a single-level logical mutual exclusion;
[0024] If so, then the mutual exclusion situation is determined to be a multi-level logical mutual exclusion.
[0025] Optionally, determining the target functional mode of the smart device based on the mutual exclusion condition includes:
[0026] When the mutual exclusion condition is a single-level logical mutual exclusion, the functional mode corresponding to the second condition attribute is determined, and the functional mode is the target functional mode.
[0027] Optionally, determining the target functional mode of the smart device based on the mutual exclusion condition includes:
[0028] When the mutual exclusion condition is a multi-level logical mutual exclusion, an adjustment instruction for the second conditional attribute is determined; the adjustment instruction is used to make the second conditional attribute and the current functional mode of the smart device no longer satisfy the functional logical mutual exclusion rule; at least one adjustment instruction exists.
[0029] The adjustment instructions are issued sequentially according to a preset order;
[0030] After the adjustment instruction is successfully executed, the functional mode corresponding to the second condition attribute is determined, and the functional mode is the target functional mode.
[0031] Optionally, the instruction for determining the adjustment of the second conditional attribute includes:
[0032] Determine the second functional logic mutual exclusion rule that matches the Nth conditional attribute with the current functional mode of the smart device; where N is a positive integer greater than 1 and less than a preset recursion number;
[0033] Determine whether there is an adjustment instruction for the Nth condition attribute. The adjustment instruction is used to modify the Nth condition attribute, and the modified Nth condition attribute does not satisfy the functional logic mutual exclusion rule with the current functional mode of the smart device.
[0034] If so, then determine the adjustment instruction for the Nth conditional attribute;
[0035] If not, then determine the third functional logic mutual exclusion rule between the N+1th condition attribute and the current functional mode of the smart device, until there is an adjustment instruction for the N+1th condition attribute, or N+1 equals the maximum recursion number; the N+1th condition attribute and the Nth condition attribute are condition modes of the same category.
[0036] Secondly, this application provides an automated testing apparatus, comprising:
[0037] The acquisition module is used to acquire the functional test instructions and functional logic mutual exclusion rules of the smart device.
[0038] The determination module is used to determine whether the functional test instruction hits the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule.
[0039] An adjustment module is used to adjust the functional mode of the smart device when a functional logic mutual exclusion rule is met, so that the functional instruction to be tested does not satisfy the functional logic mutual exclusion rule.
[0040] The sending module is used to send the functional test command to the smart device.
[0041] Optionally, the acquisition module is further configured to acquire a set of mutually exclusive elements of the functional logic mutual exclusion rule; the set of mutually exclusive elements includes: condition attributes and influence attributes;
[0042] The determining module is further configured to determine whether the functional test instruction hits the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the set of mutual exclusion elements.
[0043] The determining module is further configured to determine that the functional test instruction hits the functional logic mutual exclusion rule if the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute in the set of mutually exclusive elements.
[0044] Optionally, the determining module is further configured to determine the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule; the first functional logic mutual exclusion rule is the functional logic mutual exclusion rule that matches the functional test instruction with the current functional mode of the smart device.
[0045] The determining module is further configured to determine the target functional mode of the smart device based on the mutual exclusion condition;
[0046] The adjustment module is also used to adjust the functional mode of the smart device to the target functional mode.
[0047] Optionally, the device further includes: a determination module;
[0048] The determining module is further configured to determine, based on the first functional logic mutual exclusion rule, a first conditional attribute and a first influence attribute corresponding to the first functional logic mutual exclusion rule; wherein, the combination of the first conditional attribute and the first influence attribute can constitute the first functional logic mutual exclusion rule; the first influence attribute is the same as the function corresponding to the functional test instruction.
[0049] The determining module is further configured to determine a second condition attribute based on the first condition attribute, wherein the second condition attribute is a functional mode of the same category as the first condition attribute;
[0050] The judgment module is used to determine whether the second condition attribute and the current functional mode of the smart device match the functional logic mutual exclusion rule.
[0051] The determining module is further configured to determine, if not, that the mutual exclusion situation is a single-level logical mutual exclusion.
[0052] The determining module is further configured to determine, if so, that the mutual exclusion situation is a multi-level logical mutual exclusion.
[0053] Optionally, the determining module is further configured to determine the functional mode corresponding to the second condition attribute when the mutual exclusion condition is a single-level logical mutual exclusion, wherein the functional mode is the target functional mode.
[0054] Optionally, the determining module is further configured to determine an adjustment instruction for the second conditional attribute when the mutual exclusion condition is a multi-level logical mutual exclusion; the adjustment instruction is configured to make the second conditional attribute and the current functional mode of the smart device not satisfy the functional logical mutual exclusion rule; at least one adjustment instruction exists;
[0055] The sending module is also used to send the adjustment instructions sequentially in a preset order;
[0056] The determining module is further configured to determine the functional mode corresponding to the second conditional attribute after the adjustment instruction is successfully executed, wherein the functional mode is the target functional mode.
[0057] Optionally, the determining module is further configured to determine a second functional logic mutual exclusion rule that matches the Nth conditional attribute with the current functional mode of the smart device; wherein, N is a positive integer greater than 1 and less than a preset recursion number;
[0058] The judgment module is further configured to determine whether there is an adjustment instruction for the Nth condition attribute, the adjustment instruction being used to modify the Nth condition attribute, and the modified Nth condition attribute not satisfying the functional logic mutual exclusion rule with the current functional mode of the smart device.
[0059] The determining module is further configured to determine the adjustment instruction for the Nth conditional attribute if the condition is true.
[0060] The determining module is further configured to, if not, determine the third functional logic mutual exclusion rule that the (N+1)th condition attribute matches the current functional mode of the smart device, until the (N+1)th condition attribute has an adjustment instruction, or N+1 equals the maximum recursion number; the (N+1)th condition attribute and the Nth condition attribute are condition modes of the same category.
[0061] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0062] The memory stores computer-executed instructions;
[0063] The processor executes computer execution instructions stored in the memory to implement the automated testing method as described in the first aspect and various possible implementations of the first aspect above.
[0064] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions thereon, which, when executed by a processor, are used to implement the automated testing method as described in the first aspect and various possible implementations of the first aspect.
[0065] Fifthly, this application provides a program product, including a computer program, which, when executed by a processor, implements the automated testing method described above.
[0066] The automated testing method, apparatus, storage medium, and electronic device provided in this application acquire relevant functional test instructions and functional logic mutual exclusion rules. Then, based on these functional test instructions, the current functional mode of the smart device, and the functional logic mutual exclusion rules, it determines whether the functional test instructions are logically mutually exclusive with the existing functional mode. If a mutual exclusion is found, the functional mode of the smart device is automatically adjusted to ensure that the functional instructions to be tested no longer conflict with any functional logic mutual exclusion rules. After adjustment, the functional test instructions are sent to the smart device for execution. This method intelligently handles conflicts between functional test instructions and the device's current functional mode, avoiding logical mutual exclusion through automatic adjustment, thereby ensuring the smooth execution of functional test instructions and significantly improving the testing efficiency and reliability of the smart device. Attached Figure Description
[0067] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0068] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 A schematic diagram of the hardware environment for an automated testing method provided in this application;
[0070] Figure 2 A flowchart illustrating an automated testing method provided in this application. Figure 1 ;
[0071] Figure 3 A flowchart illustrating an automated testing method provided in this application. Figure 2 ;
[0072] Figure 4 A flowchart illustrating an automated testing method provided in this application. Figure 3 ;
[0073] Figure 5 A flowchart illustrating an automated testing method provided in this application. Figure 4 ;
[0074] Figure 6 A schematic diagram of the automated testing device provided in this application;
[0075] Figure 7 A schematic diagram of the automated testing equipment provided in this application. Detailed Implementation
[0076] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0077] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0078] According to one aspect of the embodiments of this application, an automated testing method is provided. This automated testing method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned automated testing method can be applied to, for example... Figure 1The hardware environment shown consists of terminal device 101 and server 102. For example... Figure 1 As shown, server 102 is connected to terminal device 101 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 102. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 102.
[0079] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. Terminal device 101 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0080] With the rapid expansion of the smart home appliance user base and the increasing diversification of user needs, the functions of smart home appliances are constantly being innovated to meet different requirements. To ensure that these smart home appliances meet high standards in terms of stability, security, and ease of use, automated testing has become a crucial element. Through automated testing, various real-world usage scenarios can be simulated, effectively identifying potential problems and defects, and allowing for timely fixes before the product's official release, thereby improving product quality and the overall user experience.
[0081] Smart home appliances often have some conflicts or constraints between their various functions, whether in a static or operational state. Therefore, when defining the functions, the product needs to clearly inform the user of these functional conflicts or constraints, i.e., logical mutual exclusion rules.
[0082] However, in the automated testing process of smart home appliance functions, logical mutual exclusion rules can become obstacles, hindering the testing process. Specifically, test commands may fail to be issued successfully, causing the automated testing process to pause, making it difficult to continue the entire testing process, and ultimately affecting the efficiency and quality of smart home appliance function testing.
[0083] To address the aforementioned issues, this application provides an automated testing method. During the automated testing of a smart device, when a functional test command fails to be issued, the method automatically searches for and resolves the functional logic mutual exclusion rules triggered by the command issuance. The resolution process involves modifying the functional modes that are already considered valid within the functional logic mutual exclusion rules, ensuring that there are no functional logic mutual exclusion rules between them and the functional test command. After the resolution, other functional test commands are issued, ensuring that the entire set of functions of the smart device can be fully covered by testing.
[0084] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0085] Figure 2 A flowchart illustrating an automated testing method provided in this application embodiment. Figure 1 .like Figure 2 As shown, the automated testing method provided in this embodiment includes:
[0086] S101: Obtain the functional test instructions and functional logic mutual exclusion rules of the smart device.
[0087] Here, "smart device" refers to smart home appliances. The functional logic mutual exclusion rule refers to a rule that prevents two or more functions from being activated or executed simultaneously under the same conditions or at the same time. For example, in the operation of an air conditioner, comfort mode and strong fan mode are two mutually exclusive functions; running them simultaneously will trigger the functional logic mutual exclusion rule.
[0088] Understandably, functional test instructions transform the complex business functions of intelligent devices into a valid, ordered, and logically related set of instructions. In other words, each function is broken down into instructions that can be understood and executed by automated testing equipment. The transformed instructions fall into two categories: single instructions and groups of instructions.
[0089] A single instruction is a command that can independently perform a specific function; it typically involves only a simple operation or parameter setting. These instructions are usually direct and immediate; once issued, the device will immediately execute the corresponding action or adjustment. For example, powering on and powering off are typical single instructions.
[0090] A group command is a collection of related commands that work together to achieve a more complex business function. Each command in a group command typically has some logical relationship or dependency with other commands, therefore they need to be issued and executed in a certain order and logic. For example, taking an air conditioner as an example, setting it to comfort mode usually involves adjusting multiple parameters, including temperature, humidity, fan speed, and noise level. Therefore, we need to issue a group command containing multiple sub-commands, each corresponding to a specific parameter setting.
[0091] S102: Based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rules, determine whether the functional test instruction hits the functional logic mutual exclusion rules.
[0092] Understandably, after receiving the functional test command, the system needs to determine whether executing the command simultaneously with the smart device violates the device's functional logic mutual exclusion rules, based on the device's current operating functional mode. How to determine whether the functional logic mutual exclusion rules are violated will be detailed below and will not be repeated here.
[0093] S103: If the functional logic mutual exclusion rule is met, adjust the functional mode of the smart device so that the functional instruction to be tested does not meet the functional logic mutual exclusion rule.
[0094] Understandably, if the functional test command and the current functional mode of the smart device conform to a certain rule of functional logic mutual exclusion, the functional test command cannot be executed, and the automatic test process will be stopped. Therefore, the automatic test system needs to modify the currently executing functional mode, find the functional mode that does not meet the functional logic mutual exclusion rule with the functional test command, and modify and adjust the functional mode to ensure the smooth progress of the automatic test process.
[0095] S104: Send a functional test instruction to the smart device so that the smart device can perform a functional test according to the functional test instruction.
[0096] Understandably, the automated testing system iterates through all the functional modes of the smart device, obtains the appropriate target functional mode, determines the corresponding instruction to be executed for that target functional mode, issues the instruction to modify the functional mode, and then issues the functional test instruction to the smart device again, enabling the device to execute the instruction and continue the functional testing process. This solves the problem of blocking when issuing functional test instructions and resolves the issue of pauses caused by mutual exclusion of device functions during automated testing.
[0097] This embodiment provides an automated testing method. The method acquires functional test instructions and functional logic mutual exclusion rules from a smart device; determines whether the functional test instructions match the functional logic mutual exclusion rules based on the functional test instructions, the smart device's current functional mode, and the functional logic mutual exclusion rules; if the functional logic mutual exclusion rules are matched, adjusts the smart device's functional mode so that the functional test instructions do not satisfy the rules; and sends the functional test instructions to the smart device. This method automatically adjusts the functional mode to avoid logical mutual exclusion when there is a conflict between the functional test instructions and the device's current functional mode, thereby ensuring the effective execution of the functional test instructions and significantly improving the testing efficiency and reliability of the smart device.
[0098] Figure 3 A flowchart illustrating an automated testing method provided in this application embodiment. Figure 2 .like Figure 3 As shown, in Figure 2 Based on the embodiments, the automated testing method is described in detail. The automated testing method shown in this embodiment includes:
[0099] S201: Obtain the functional test instructions and functional logic mutual exclusion rules of the smart device.
[0100] Step S201 is similar to step S101, and will not be described again here.
[0101] S202: Obtain the set of mutually exclusive elements of the functional logic mutual exclusion rules; the set of mutually exclusive elements includes: condition attributes and influence attributes.
[0102] Understandably, functional logic mutual exclusion rules serve as the basis for determining mutual exclusion between functions of smart devices. Before executing automated tests, these rules need to be semantically parsed, and the parsed elements (i.e., a set of mutually exclusive elements) effectively stored for subsequent verification of whether the functional logic mutual exclusion rules have been met and for attempting to break them. The parsed mutual exclusion rules can be stored and accessed, for example, in JSON format.
[0103] The set of mutually exclusive elements includes: conditional attributes, conditional attribute ranges, relationships between conditional attributes, and two categories: impact attributes, and impact attribute read / write functionality, and impact attribute range. Conditional attributes are the conditions used in a rule to determine whether the rule should be triggered. Conditional attribute ranges refer to the set of data or events covered by the conditional attribute in the rule. Relationships between conditional attributes refer to the logical relationships between multiple conditional attributes in the rule. Impact attributes are the direct effects of the rule execution on data or events. Impact attribute read / write functionality refers to whether the impact attribute can be modified or read during rule execution. Impact attribute range refers to the set of data or events covered by the impact attribute after the rule execution.
[0104] S203: Based on the functional test instruction, the current functional mode of the smart device, and the set of mutually exclusive elements, determine whether the functional test instruction hits the functional logic mutual exclusion rule.
[0105] Understandably, whether the functional logic mutual exclusion rule is hit means determining whether the functional test instruction and the current functional mode of the smart device match the content already existing in the mutual exclusion element set. If not, the functional test instruction and the current functional mode of the smart device can run together, directly issuing the functional test instruction to the smart device and confirming that the functional test instruction has been completed, and the automatic test process proceeds normally.
[0106] S204: If the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute in the set of mutually exclusive elements, then the functional test instruction is determined to have hit the functional logic mutual exclusion rule.
[0107] Among them, the combination of conditional attributes and influence attributes can generate a functional logic mutual exclusion rule.
[0108] Understandably, if the functional test instruction meets the conditional attributes in the set of mutually exclusive elements, and the current functional mode of the smart device meets the influence attributes, then it is determined that the functional test instruction and the current functional mode have hit the functional logic mutual exclusion rule, that is, the test process is blocked, and the current functional mode needs to be modified.
[0109] S205: If a functional logic mutual exclusion rule is hit, determine the mutual exclusion between the functional test instruction and the first functional logic mutual exclusion rule; the first functional logic mutual exclusion rule is the functional logic mutual exclusion rule that is hit between the functional test instruction and the current functional mode of the smart device.
[0110] S206: Determine the target functional mode of the smart device based on mutual exclusion conditions.
[0111] Mutual exclusion can be divided into single-level logical mutual exclusion and multi-level logical mutual exclusion.
[0112] Understandably, if a functional logic mutual exclusion rule is encountered, it needs to be broken, which means modifying the preconditions of the functional logic mutual exclusion rule. These preconditions refer to the functional modes already executed by the smart device. Different mutual exclusion situations correspond to different rule-breaking processes, meaning there are different methods for determining the existence of the target functional mode.
[0113] S207: Adjust the function mode of the smart device to the target function mode.
[0114] Understandably, after determining the target functional mode, the system can determine the corresponding instructions for mode implementation based on the target functional mode, and send the instructions to the smart device so that the smart device can adjust the implemented functions.
[0115] S208: Issue functional test commands to smart devices.
[0116] Step S208 is similar to step S104, and will not be described again here.
[0117] This embodiment provides an automated testing method. The method acquires a functional test instruction and a functional logic mutual exclusion rule for a smart device; acquires a set of mutually exclusive elements for the functional logic mutual exclusion rule; determines whether the functional test instruction matches the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the set of mutually exclusive elements; if the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute, then the functional test instruction is determined to match the functional logic mutual exclusion rule, and the mutual exclusion situation between the functional test instruction and the first functional logic mutual exclusion rule is determined; based on the mutual exclusion situation, the target functional mode of the smart device is determined; the functional mode of the smart device is adjusted to the target functional mode; and a functional test instruction is issued to the smart device. This method automatically identifies mutual exclusion situations and adjusts to a conflict-free target functional mode when a functional logic mutual exclusion rule is matched, ensuring the smooth execution of the functional test instruction and greatly improving the automation level and accuracy of smart device testing.
[0118] Figure 4 A flowchart illustrating an automated testing method provided in this application embodiment. Figure 3 .like Figure 4 As shown, in Figure 3 Based on the embodiments, a possible implementation of determining mutual exclusion is described in detail. The automated testing method shown in this embodiment includes:
[0119] S301: Based on the first functional logic mutual exclusion rule, determine the first condition attribute and the first influence attribute corresponding to the first functional logic mutual exclusion rule.
[0120] Among them, the combination of the first condition attribute and the first influence attribute can constitute the first functional logic mutual exclusion rule; the first influence attribute is the same as the function corresponding to the functional test instruction.
[0121] Understandably, the first logical mutual exclusion rule is the mutual exclusion rule between the functional test instruction and the functional logic currently hit by the smart device. By breaking down the first functional logical mutual exclusion rule, we can obtain the first condition attribute, which is the functional mode that needs to be modified.
[0122] For example, the first functional logic mutual exclusion rule could be: when the smart device is an air conditioner, and the air conditioner's operating mode is comfort mode, strong wind is not writable. Breaking it down, the first condition attribute is comfort mode, and the first influencing attribute is strong wind.
[0123] S302: Determine the second condition attribute based on the first condition attribute.
[0124] The second conditional attribute is a functional mode of the same category as the first conditional attribute.
[0125] Understandably, modifying the first conditional attribute breaks the mutual exclusion rule of the first function logic. Therefore, it's necessary to find functions of the same category as the first conditional attribute and use them as the second conditional attribute. For example, if the first conditional attribute is Comfort Mode, then the second conditional attribute could be Dehumidification Mode, Sleep Mode, Normal Mode, etc.
[0126] S303: Determine whether the second condition attribute and the current function mode of the smart device match the function logic mutual exclusion rule. If not, proceed to step S304; if yes, proceed to step S305.
[0127] It is understandable that there is no logical mutual exclusion rule between the second condition attribute and the functional test instruction, but the modification of the second condition attribute may still trigger other logical mutual exclusion rules. In the process of cracking the functional test rules, the integrity of the automatic test process should be ensured.
[0128] S304: The mutual exclusion condition is determined to be single-level logical mutual exclusion.
[0129] Understandably, if the second condition attribute and the current functional mode of the smart device do not match the functional logic mutual exclusion rule, it means that modifying the second condition attribute will not disrupt the already completed automatic testing process. Only the second condition attribute needs to be modified to issue the functional test command. Therefore, this mutual exclusion situation is a single-level logical mutual exclusion. For example, according to the preconditions in step S301, single-level logical mutual exclusion only requires changing the comfort mode to the normal mode to issue the strong wind command and continue the automated testing process of other commands.
[0130] S305: The mutual exclusion condition is determined to be multi-level logical mutual exclusion.
[0131] Understandably, if the second condition attribute matches the functional logic mutual exclusion rule of the current functional mode of the smart device, it means that modifying the second condition attribute will disrupt the already completed automatic testing process. Therefore, this mutual exclusion also requires modification of other condition attributes besides the second condition attribute. Please see below for specific modification steps, which will not be repeated here.
[0132] This embodiment provides an automated testing method. The method determines a first conditional attribute and a first impact attribute corresponding to a first functional logic mutual exclusion rule. Based on the first conditional attribute, a second conditional attribute is determined. It then determines whether the second conditional attribute matches the current functional mode of the smart device within the functional logic mutual exclusion rule. If not, the mutual exclusion is determined to be a single-level logical mutual exclusion; if so, it is determined to be a multi-level logical mutual exclusion. This method categorizes mutual exclusion cases into two types and breaks the functional logic mutual exclusion rule according to different mutual exclusion cases, ensuring the effective completion of the breaking process.
[0133] Figure 5 A flowchart illustrating an automated testing method provided in this application embodiment. Figure 4 .like Figure 5 As shown, in Figure 4 Based on the embodiments, a possible implementation method for multi-level logical mutual exclusion is described in detail. The automated testing method shown in this embodiment includes:
[0134] S401: Determine the second functional logic mutual exclusion rule that matches the Nth condition attribute with the current functional mode of the smart device.
[0135] Where N is a positive integer greater than 1 and less than the preset recursion number.
[0136] Understandably, if the mutual exclusion involves multiple layers of logical mutual exclusion, a recursive algorithm is needed to resolve it. A recursive algorithm is a method of solving a problem by repeatedly breaking it down into similar subproblems. It's important to note that when using a recursive algorithm, an exit condition must be set, i.e., a preset recursion count, to prevent the program from failing to exit normally when encountering an infinite loop, thus affecting the use of automated testing functions.
[0137] The occurrence of multi-level logical mutual exclusion means that the second condition attribute and the current functional mode of the smart device match the functional logic mutual exclusion rule. For example, taking N=2 as an example, this illustrates how to find the adjustment instruction for the second condition attribute. The system needs to first determine the second functional logic mutual exclusion rule that is matched after modifying the second condition attribute, and then it can only break the rule based on the specific content of the second functional logic mutual exclusion rule.
[0138] S402: Determine whether there is an adjustment instruction for the Nth condition attribute. If yes, proceed to step S403; otherwise, proceed to step S401.
[0139] The adjustment instruction is used to modify the Nth condition attribute, and the modified Nth condition attribute does not satisfy the functional logic mutual exclusion rule with the current functional mode of the smart device.
[0140] Optionally, if not, determine the third functional logic mutual exclusion rule that matches the N+1 conditional attribute with the current functional mode of the smart device, until there is an adjustment instruction for the N+1 conditional attribute, or N+1 equals the maximum recursion number; the N+1 conditional attribute and the N conditional attribute are conditional modes of the same category.
[0141] Understandably, if there is no adjustment instruction for the Nth condition attribute (meaning that adjusting according to the adjustment instruction would affect the completed automatic testing process), that is, the Nth condition attribute cannot be modified, forcibly modifying the Nth condition attribute to the N+1th condition attribute according to the adjustment execution instruction would hit the third logical mutual exclusion rule. However, the Nth condition attribute is a necessary prerequisite for issuing the functional test instruction, so the adjustment instruction to modify the N+1th condition attribute is determined again.
[0142] S403: Determine the adjustment instructions for the Nth condition attribute.
[0143] Understandably, if an adjustment instruction exists for the Nth conditional attribute, then at least one confirmed adjustment instruction will be saved. The existence of an adjustment instruction for the Nth conditional attribute means that adjusting the Nth conditional attribute according to the adjustment instruction will not trigger any functional logic mutual exclusion rules.
[0144] S404: Issue adjustment instructions sequentially according to the preset order.
[0145] The default order is N from largest to smallest.
[0146] Understandably, the recursive process involves a backward search. Once the search is complete, the functional mode needs to be adjusted according to the normal operating sequence of the automatic test. If there are multiple adjustment instructions, they are issued one by one in descending order of N, adjusting the function sequentially. After the smart device executes one instruction, the next instruction is issued.
[0147] For example, assuming the preset recursion number is 3, the recursive process of determining the adjustment instruction of the second condition attribute in steps S402 to S404 is described.
[0148] Determine if there is an adjustment instruction for the second condition attribute. If there is an adjustment instruction for the second condition attribute, modify the second condition attribute to the third condition attribute according to the adjustment instruction. The third condition attribute does not satisfy the functional logic mutual exclusion rule with the current functional mode of the smart device. Save the adjustment instruction. This multi-layer logic mutual exclusion is specifically a two-layer logic mutual exclusion.
[0149] If the second condition attribute does not have an adjustment instruction, that is, the second condition attribute is modified to the third condition attribute according to the adjustment instruction, the third condition attribute and the current functional mode of the smart device will match the third functional logic mutual exclusion rule, and the third condition attribute will be checked again to see if there is an adjustment instruction.
[0150] If an adjustment instruction exists for the third condition attribute, it is modified to become the fourth condition attribute according to the instruction. Since the fourth condition attribute does not satisfy the functional logic mutual exclusion rule with the current functional mode of the smart device, the two adjustment instructions corresponding to the third and second condition attributes are saved. This multi-layered logic mutual exclusion is specifically a three-layered logic mutual exclusion. Simultaneously, these two instructions are executed together as the adjustment instruction for the second condition attribute. During execution, the adjustment instruction for the third condition attribute is issued first, and after the smart device completes its execution, the adjustment instruction for the second condition attribute is issued.
[0151] If there is no adjustment instruction for the third condition attribute, that is, the third condition attribute is modified to the fourth condition attribute according to the adjustment instruction. The fourth condition attribute and the current functional mode of the smart device will hit the fourth functional logic mutual exclusion rule. Then the recursive process ends, the automatic test is determined to have failed, all condition attribute adjustment instructions and the hit functional logic mutual exclusion rules are marked and saved, and a test report is generated so that staff can analyze and improve the function of the device.
[0152] S405: After the adjustment instruction is successfully executed, determine the function mode corresponding to the second condition attribute. The function mode is the target function mode.
[0153] Understandably, if the adjustment command is executed successfully, it means that there is no functional logic mutual exclusion rule between the second condition attribute and the current functional mode of the smart device. After issuing the command corresponding to the functional mode of the second condition attribute, the function command can be issued again, and the function of the smart device can be realized normally.
[0154] This embodiment provides an automated testing method. The method determines a second functional logic mutual exclusion rule between the Nth conditional attribute and the current functional mode of the smart device; it then determines whether an adjustment instruction exists for the Nth conditional attribute. If so, adjustment instructions are issued sequentially according to a preset order; otherwise, a third functional logic mutual exclusion rule is determined between the N+1th conditional attribute and the current functional mode of the smart device, until an adjustment instruction exists for the N+1th conditional attribute, or N+1 equals the maximum recursion number. After the adjustment instruction is successfully executed, the functional mode corresponding to the second conditional attribute is determined. This method can repeatedly search for adjustment instructions for conditional attributes under multi-level logical mutual exclusion conditions, finding adjustment instructions for suitable target functional modes as much as possible, ensuring the test process can complete normally and improving the test completion rate.
[0155] Figure 6 A schematic diagram of the automated testing device provided in this application. Figure 6 As shown, this application provides an automated testing apparatus 600, which includes:
[0156] Module 601 is used to acquire the functional test instructions and functional logic mutual exclusion rules of the smart device.
[0157] The determining module 602 is used to determine whether the function test instruction hits the function logic mutual exclusion rule based on the function test instruction, the current function mode of the smart device, and the function logic mutual exclusion rule;
[0158] The adjustment module 603 is used to adjust the function mode of the smart device when the function logic mutual exclusion rule is met, so that the function instruction to be tested does not satisfy the function logic mutual exclusion rule.
[0159] The sending module 604 is used to send the function test command to the smart device.
[0160] Optionally, the acquisition module 601 is further configured to acquire a set of mutually exclusive elements of the functional logic mutual exclusion rule; the set of mutually exclusive elements includes: condition attributes and influence attributes;
[0161] The determining module 602 is further configured to determine whether the functional test instruction hits the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the set of mutual exclusion elements.
[0162] The determining module 602 is further configured to determine that the functional test instruction hits the functional logic mutual exclusion rule if the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute in the set of mutually exclusive elements.
[0163] Optionally, the determining module 602 is further configured to determine the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule; the first functional logic mutual exclusion rule is the functional logic mutual exclusion rule that matches the functional test instruction with the current functional mode of the smart device.
[0164] The determining module 602 is further configured to determine the target functional mode of the smart device based on the mutual exclusion condition.
[0165] The adjustment module 603 is also used to adjust the function mode of the smart device to the target function mode.
[0166] Optionally, the device further includes: a judgment module 605;
[0167] The determining module 602 is further configured to determine, based on the first functional logic mutual exclusion rule, a first conditional attribute and a first influence attribute corresponding to the first functional logic mutual exclusion rule; wherein, the combination of the first conditional attribute and the first influence attribute can constitute the first functional logic mutual exclusion rule; the first influence attribute is the same as the function corresponding to the functional test instruction.
[0168] The determining module 602 is further configured to determine a second condition attribute based on the first condition attribute, wherein the second condition attribute is a functional mode of the same category as the first condition attribute;
[0169] The judgment module 605 is used to determine whether the second condition attribute and the current functional mode of the smart device match the functional logic mutual exclusion rule.
[0170] The determining module 602 is further configured to determine, if not, that the mutual exclusion situation is a single-level logical mutual exclusion.
[0171] The determining module 602 is further configured to determine, if so, that the mutual exclusion situation is a multi-level logical mutual exclusion.
[0172] Optionally, the determining module 602 is further configured to determine the functional mode corresponding to the second condition attribute when the mutual exclusion condition is a single-level logical mutual exclusion, wherein the functional mode is the target functional mode.
[0173] Optionally, the determining module 602 is further configured to determine an adjustment instruction for the second conditional attribute when the mutual exclusion condition is a multi-level logical mutual exclusion; the adjustment instruction is configured to make the second conditional attribute and the current functional mode of the smart device not satisfy the functional logical mutual exclusion rule; at least one adjustment instruction exists;
[0174] The sending module 604 is also used to send the adjustment instructions sequentially in a preset order;
[0175] The determining module 602 is further configured to determine the functional mode corresponding to the second condition attribute after the adjustment instruction is successfully executed, wherein the functional mode is the target functional mode.
[0176] Optionally, the determining module 602 is further configured to determine the second functional logic mutual exclusion rule that matches the Nth conditional attribute with the current functional mode of the smart device; wherein, N is a positive integer greater than 1 and less than a preset recursion number;
[0177] The judgment module 605 is further configured to determine whether there is an adjustment instruction for the Nth condition attribute, the adjustment instruction being used to modify the Nth condition attribute, and the modified Nth condition attribute not satisfying the functional logic mutual exclusion rule with the current functional mode of the smart device.
[0178] The determining module 602 is further configured to determine the adjustment instruction of the Nth conditional attribute if the condition is true.
[0179] The determining module 602 is further configured to, if not, determine the third functional logic mutual exclusion rule that the N+1th conditional attribute matches the current functional mode of the smart device, until there is an adjustment instruction for the N+1th conditional attribute, or N+1 equals the maximum recursion number; the N+1th conditional attribute and the Nth conditional attribute are conditional modes of the same category.
[0180] The automated testing device provided in this application embodiment has a similar implementation principle and technical effect to the implementation of each part of the aforementioned automated testing method, and will not be described again here.
[0181] Figure 7 A schematic diagram of the automated testing equipment provided in this application. Figure 7 As shown, this application provides an automated testing device 700, which includes: a receiver 701, a transmitter 702, a processor 703, and a memory 704.
[0182] Receiver 701 is used to receive instructions and data;
[0183] Transmitter 702 is used to send commands and data;
[0184] Memory 704 is used to store instructions executed by the computer;
[0185] The processor 703 is used to execute computer execution instructions stored in the memory 704 to implement the various steps performed by the automated testing method in the above embodiments. For details, please refer to the relevant descriptions in the foregoing embodiments of the automated testing method.
[0186] Optionally, the memory 704 can be either standalone or integrated with the processor 703.
[0187] When the memory 704 is set up independently, the electronic device also includes a bus for connecting the memory 704 and the processor 703.
[0188] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0189] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in any of the foregoing embodiments.
[0190] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0191] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0192] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0193] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0194] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0195] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0196] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An automated testing method, characterized in that, include: Obtain functional test instructions and functional logic mutual exclusion rules for smart devices; Based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule, determine whether the functional test instruction hits the functional logic mutual exclusion rule; If the functional logic mutual exclusion rule is met, the functional mode of the smart device is adjusted so that the functional instruction to be tested does not satisfy the functional logic mutual exclusion rule. The function test command is sent to the smart device so that the smart device can perform a function test according to the function test command.
2. The method according to claim 1, characterized in that, The step of determining whether the functional test instruction matches the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule includes: Obtain the set of mutually exclusive elements of the functional logic mutual exclusion rule; the set of mutually exclusive elements includes: condition attributes and influence attributes; Based on the functional test instruction, the current functional mode of the smart device, and the set of mutually exclusive elements, determine whether the functional test instruction hits the functional logic mutual exclusion rule; If the functional test instruction and the current functional mode of the smart device respectively meet the condition attribute and influence attribute in the set of mutually exclusive elements, then the functional test instruction is determined to have hit the functional logic mutual exclusion rule.
3. The method according to claim 2, characterized in that, Adjusting the functional mode of the smart device includes: Determine the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule; the first functional logic mutual exclusion rule is the functional logic mutual exclusion rule that matches the current functional mode of the smart device; Based on the mutual exclusion condition, the target functional mode of the smart device is determined; Adjust the function mode of the smart device to the target function mode.
4. The method according to claim 3, characterized in that, Determining the mutual exclusion status between the functional test instruction and the first functional logic mutual exclusion rule includes: Based on the first functional logic mutual exclusion rule, a first condition attribute and a first influence attribute corresponding to the first functional logic mutual exclusion rule are determined; wherein, the combination of the first condition attribute and the first influence attribute can constitute the first functional logic mutual exclusion rule; the first influence attribute is the same as the function corresponding to the functional test instruction. Based on the first conditional attribute, a second conditional attribute is determined, wherein the second conditional attribute is a functional mode of the same category as the first conditional attribute; Determine whether the second conditional attribute and the current functional mode of the smart device match the functional logic mutual exclusion rule; If not, then the mutual exclusion situation is determined to be a single-level logical mutual exclusion; If so, then the mutual exclusion situation is determined to be a multi-level logical mutual exclusion.
5. The method according to claim 4, characterized in that, Determining the target functional mode of the smart device based on the mutual exclusion condition includes: When the mutual exclusion condition is a single-level logical mutual exclusion, the functional mode corresponding to the second condition attribute is determined, and the functional mode is the target functional mode.
6. The method according to claim 4, characterized in that, Determining the target functional mode of the smart device based on the mutual exclusion condition includes: When the mutual exclusion condition is a multi-level logical mutual exclusion, an adjustment instruction for the second conditional attribute is determined; the adjustment instruction is used to make the second conditional attribute and the current functional mode of the smart device no longer satisfy the functional logical mutual exclusion rule; at least one adjustment instruction exists. The adjustment instructions are issued sequentially according to a preset order; After the adjustment instruction is successfully executed, the functional mode corresponding to the second condition attribute is determined, and the functional mode is the target functional mode.
7. The method according to claim 6, characterized in that, The instruction for determining the adjustment of the second conditional attribute includes: Determine the second functional logic mutual exclusion rule that matches the Nth conditional attribute with the current functional mode of the smart device; where N is a positive integer greater than 1 and less than a preset recursion number; Determine whether there is an adjustment instruction for the Nth condition attribute. The adjustment instruction is used to modify the Nth condition attribute, and the modified Nth condition attribute does not satisfy the functional logic mutual exclusion rule with the current functional mode of the smart device. If so, then determine the adjustment instruction for the Nth conditional attribute; If not, then determine the third functional logic mutual exclusion rule between the N+1th condition attribute and the current functional mode of the smart device, until there is an adjustment instruction for the N+1th condition attribute, or N+1 equals the maximum recursion number; the N+1th condition attribute and the Nth condition attribute are condition modes of the same category.
8. An automated testing device, characterized in that, The device includes: The acquisition module is used to acquire the functional test instructions and functional logic mutual exclusion rules of the smart device. The determination module is used to determine whether the functional test instruction hits the functional logic mutual exclusion rule based on the functional test instruction, the current functional mode of the smart device, and the functional logic mutual exclusion rule. An adjustment module is used to adjust the functional mode of the smart device when a functional logic mutual exclusion rule is met, so that the functional instruction to be tested does not satisfy the functional logic mutual exclusion rule. The sending module is used to send the function test command to the smart device so that the smart device can perform a function test according to the function test command.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 7 through the computer program.