State switching test method, device and system, electronic equipment and storage medium

By arranging and combining all execution modes of software state switching, building a test case set and completing the testing of each test case, the problem of insufficient coverage in the existing technology is solved, and comprehensive coverage and problem detection of software state switching are achieved.

CN120705028APending Publication Date: 2025-09-26BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410330353.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing state switching test methods have low coverage for uncommon switching scenarios and cannot fully cover all software state switching scenarios.

Method used

By arranging and combining all execution modes of software state switching, a test case set is constructed, and target test cases and control instructions are sent during the test process to ensure that each test case completes the test and achieve comprehensive coverage of software state switching.

Benefits of technology

It achieves comprehensive coverage of software state switching scenarios, improves testing efficiency and accuracy, and can detect problems in state switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705028A_ABST
    Figure CN120705028A_ABST
Patent Text Reader

Abstract

The invention discloses a state switching test method, device and system, electronic equipment and a storage medium, and relates to the technical field of software test.The main technical scheme includes the steps that when it is determined that the software state of a test execution end is switched to a to-be-tested state, a first target test case is sent to the test execution end; when it is determined that the first target test case completes the test, a first control instruction for switching the software state to the to-be-tested state is sent to a test execution end, so that the test execution end switches the software state to the to-be-tested state based on the first control instruction; when it is determined that the software state is switched to the to-be-tested state, sending a second target test case to the test execution end until each test case in the test case set is tested; the second target test case is any test case except the first target test case in the test case set. Compared with the prior art, the embodiment of the invention realizes the comprehensive coverage of the switching scene of the software state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of software testing, and in particular to a state switching testing method and device, system, electronic device, and storage medium. Background Art

[0002] The software in the domain controller has multiple states, each of which can perform different functions. The software can switch between different states. To ensure that the software switches between different states normally, the software state switching needs to be tested.

[0003] In the related technologies of state switching testing, the state switching testing method is to design test cases only by using the common software state switching execution method, and then use the designed test cases to test state switching. Due to uncommon switching scenarios, uncommon software state switching execution methods need to be used. The existing state switching testing method has a low coverage rate for uncommon switching scenarios. Summary of the Invention

[0004] The present disclosure provides a state switching test method and apparatus, system, electronic device, and storage medium, which are mainly intended to solve the problem that existing state switching test methods have low coverage for uncommon switching scenarios.

[0005] According to a first aspect of the present disclosure, a state switching test method is provided, wherein the method is applied to a test initiator, and includes:

[0006] When it is determined that the software state of the test execution end is switched to the waiting-for-test state, a first target test case is sent to the test execution end so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in the test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0007] When it is determined that the first target test case has completed testing, sending a first control instruction for switching the software state to the waiting-for-test state to the test execution end, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction;

[0008] When it is determined that the software state has switched to the waiting-for-test state, a second target test case is sent to the test execution end so that the test execution end switches the state based on the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0009] Optionally, determining whether the first target test case has completed testing includes:

[0010] Acquire software state switching information of the test execution end; the software state switching information includes the software state and the test time of the first target test case;

[0011] When it is determined that the software state is in the predicted switching state corresponding to the state to be tested, or when it is determined that the test time exceeds a preset time threshold, a second control instruction for switching the software state to an end state is sent to the test execution end, so that the test execution end switches the software state to the end state based on the second control instruction;

[0012] When it is determined that the software state is the end state, it is determined that the first target test case has completed testing.

[0013] Optionally, the method for constructing the test case set includes:

[0014] Respectively obtaining at least one execution mode for switching the software state corresponding to each state in the software state;

[0015] Arrange and combine all execution modes to obtain at least one execution mode combination;

[0016] Each execution mode combination is determined as a test case, and all test cases are stored in the test case set to complete the construction of the test case set.

[0017] Optionally, after determining that the first target test case has completed testing, the method further includes:

[0018] receiving a test result of state switching based on the first target test case sent by the test execution end;

[0019] The test result is analyzed to obtain an analysis result, so as to adjust the software state switching based on the analysis result.

[0020] According to a second aspect of the present disclosure, a state switching test method is provided, wherein the method is applied to a test execution end and includes:

[0021] Receive a first target test case sent by a test initiating terminal, and perform software state switching according to the execution mode in the first target test case until the first target test case completes the test; the first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, one permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0022] receiving a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switching the software state to the waiting-for-test state based on the first control instruction;

[0023] Receive a second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0024] Optionally, after the first target test case is tested, the method further includes:

[0025] The software state switching information is sent to the test initiator so that the test initiator determines whether the first target test case has completed testing based on the software state in the software state switching information and the test time of the first target test case.

[0026] Optionally, before receiving the first target test case sent by the test initiator, the method further includes:

[0027] At least one execution method for switching the software state corresponding to each state in the software state is sent to the test initiator, so that the test initiator constructs the test case set based on the at least one execution method for switching the software state.

[0028] Optionally, after sending the software state switching information to the test initiator, the method further includes:

[0029] The test result of state switching based on the first target test case is sent to the test initiator so that the test initiator analyzes the test result.

[0030] According to a third aspect of the present disclosure, a state switching test device is provided, the device being applied to a test initiator, comprising:

[0031] A first sending unit is configured to send a first target test case to the test execution end when determining that the software state of the test execution end has switched to a waiting-for-test state, so that the test execution end switches the state based on the first target test case; the first target test case is any test case in a test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0032] a second sending unit, configured to send a first control instruction for switching the software state to the waiting-for-test state to the test execution end when determining that the first target test case has completed testing, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction;

[0033] The third sending unit is used to send a second target test case to the test execution end when it is determined that the software state has switched to the waiting-for-test state, so that the test execution end switches the state based on the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0034] Optionally, the device further includes:

[0035] an acquiring unit, configured to acquire software state switching information of the test execution end; the software state switching information includes the software state and the test time of the first target test case;

[0036] The second sending unit is further configured to send a second control instruction for switching the software state to an end state to the test execution end when it is determined that the software state is a predicted switching state corresponding to the state to be tested, or when it is determined that the test time exceeds a preset time threshold, so that the test execution end switches the software state to the end state based on the second control instruction;

[0037] A determining unit is configured to determine that the test of the first target test case is completed when determining that the software state is the end state.

[0038] Optionally, the device further includes:

[0039] The acquisition unit is further configured to respectively acquire at least one execution mode for switching the software state corresponding to each state in the software state;

[0040] a combining unit, configured to arrange and combine all execution modes to obtain at least one execution mode combination;

[0041] The storage unit is used to determine each execution mode combination as a test case, and store all test cases in the test case set to complete the construction of the test case set.

[0042] Optionally, the device further includes:

[0043] A first receiving unit is configured to receive, after determining that the first target test case has completed testing, a test result of state switching based on the first target test case sent by the test execution end;

[0044] An analysis unit is used to analyze the test result to obtain an analysis result so as to adjust the software state switching based on the analysis result.

[0045] According to a fourth aspect of the present disclosure, a state switching test device is provided, the device being applied to a test execution end, comprising:

[0046] A switching unit is configured to receive a first target test case sent by a test initiating terminal, and perform software state switching according to an execution mode in the first target test case until the first target test case completes testing; the first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, one permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0047] a second receiving unit, configured to receive a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switch the software state to the waiting-for-test state based on the first control instruction;

[0048] A third receiving unit is used to receive a second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0049] Optionally, the device further includes:

[0050] The fourth sending unit is used to send software status switching information to the test initiator after the first target test case completes the test, so that the test initiator determines that the first target test case has completed the test based on the software status in the software status switching information and the test time of the first target test case.

[0051] Optionally, the device further includes:

[0052] The fifth sending unit is used to send at least one execution method for switching the software state corresponding to each state in the software state to the test initiator before receiving the first target test case sent by the test initiator, so that the test initiator constructs the test case set based on the at least one execution method for switching the software state.

[0053] Optionally, the device further includes:

[0054] The sixth sending unit is used to send the test result of state switching based on the first target test case to the test initiator after sending the software state switching information to the test initiator, so that the test initiator can analyze the test result.

[0055] According to a fifth aspect of the present disclosure, a state switching test system is provided, the system comprising a test initiator and a test execution terminal, including:

[0056] The test initiator includes the state switching test device as described in the third aspect of the present disclosure;

[0057] The test execution end includes the state switching test device as described in the fourth aspect of the present disclosure.

[0058] According to a sixth aspect of the present disclosure, there is provided an electronic device, including:

[0059] at least one processor; and

[0060] a memory communicatively connected to the at least one processor; wherein,

[0061] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect or the method described in the second aspect.

[0062] According to a seventh aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect or the method described in the second aspect.

[0063] According to an eighth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method described in the first aspect or the method described in the second aspect.

[0064] The present disclosure provides a state switching testing method, apparatus, system, electronic device, and storage medium. When determining that the software state of a test execution end has switched to a waiting-for-test state, a first target test case is sent to the test execution end so that the test execution end performs state switching based on the first target test case. The first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to a test case, and all test cases constitute the test case set. When determining that the first target test case has completed testing, a first control instruction for switching the software state to the waiting-for-test state is sent to the test execution end so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction. When determining that the software state has switched to the waiting-for-test state, a second target test case is sent to the test execution end so that the test execution end performs state switching based on the second target test case until each test case in the test case set has completed testing. The second target test case is any test case in the test case set except the first target test case. Compared with the related art, the embodiment of the present disclosure obtains all permutation and combination results by permuting and combining all execution modes of software state switching. One permutation and combination result corresponds to a test case. All test cases constitute the test case set, and each test case in the test case set tests the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0065] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0067] Figure 1 A flow chart of a state switching test method provided by an embodiment of the present disclosure;

[0068] Figure 2 A schematic diagram of the composition of a state switching test environment provided by an embodiment of the present disclosure;

[0069] Figure 3 A schematic diagram of a switching rule between software states provided by an embodiment of the present disclosure;

[0070] Figure 4 A flowchart illustrating a method for determining whether a test case has completed a test provided by an embodiment of the present disclosure;

[0071] Figure 5 A flowchart of another state switching test method provided by an embodiment of the present disclosure;

[0072] Figure 6 A flowchart of the execution process of a test case provided by an embodiment of the present disclosure;

[0073] Figure 7 A schematic structural diagram of a state switching test device provided by an embodiment of the present disclosure;

[0074] Figure 8 A schematic structural diagram of another state switching test device provided by an embodiment of the present disclosure;

[0075] Figure 9 A schematic structural diagram of another state switching test device provided by an embodiment of the present disclosure;

[0076] Figure 10 A schematic structural diagram of another state switching test device provided by an embodiment of the present disclosure;

[0077] Figure 11 A schematic diagram of the structure of a state switching test system provided by an embodiment of the present disclosure;

[0078] Figure 12 A schematic block diagram of an exemplary electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0079] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0080] The following describes a state switching test method and apparatus, system, electronic device, and storage medium according to embodiments of the present disclosure with reference to the accompanying drawings.

[0081] Figure 1 A flow chart of a state switching testing method provided by an embodiment of the present disclosure.

[0082] like Figure 1 As shown, the method is applied to the test initiator, and the method includes the following steps:

[0083] Step 101: When it is determined that the software state of the test execution end is switched to the state to be tested, a first target test case is sent to the test execution end so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in the test case set, wherein all execution modes of the software state switching are arranged and combined to obtain all arrangement and combination results, one arrangement and combination result corresponds to one test case, and all test cases constitute the test case set.

[0084] The test initiator is a device that sends test cases to the test execution end. The test initiator is composed of, but not limited to, a host computer, an input / output (IO) board, a network bus device, and a programmable power supply. The network bus device is used to control the communication opening and closing state of the communication line between the test execution end and the host computer, the type of signal transmitted by the communication line between the test execution end and the host computer, etc. The IO board is used to control the high and low level states of the input pins and output pins of the test execution end. The programmable power supply is used to supply power to the test execution end. The host computer is used to control the network bus device, the programmable power supply, and the IO board. The test execution end is a deployment device for the software state machine. The test execution end can be a domain controller. The domain controller is a device used to centrally manage and control multiple electronic control units in specific functional areas. The software state machine is a model that describes the behavior and state transformation of software in different states.

[0085] In order to better understand the test environment of state switching, such as Figure 2 As shown, Figure 2 A schematic diagram of the composition of a state switching test environment provided in an embodiment of the present disclosure is provided. The state switching test environment consists of a domain controller, a host computer, a network bus device, an IO board, a programmable power supply, and necessary connection harnesses. The test execution end is connected to the test initiation end via a communication bus. The host computer simulates other domain controllers or electronic control units through the network bus device to receive and send communication signals with the test execution end. The host computer is connected to the domain controller through the IO board to simulate signal input and output.

[0086] Software exists in multiple states. At the same time, the software can only run in one state. There are switching rules between different software states. The switching rules limit the switching between software states. For example, the switching rules stipulate that software state a can switch to software state b, and software state a cannot directly switch to software state c.

[0087] In order to determine whether the switching between software states complies with the switching rules, it is necessary to test the switching between software states by sending test cases to the test execution end so that the test execution end can test the software state switching based on the test cases. The test case is a set of test steps, expected results and execution conditions designed to verify whether a specific function or feature of the software works as expected.

[0088] In order to better understand the rules for switching between software states, such as Figure 3 As shown, Figure 3 This is a schematic diagram of a switching rule between software states provided by an embodiment of the present disclosure. State 1 can be switched to State 2 or State 3, but cannot be switched to State 4.

[0089] There are many execution modes for software state switching. For example, the upper computer can use network bus devices and IO boards to control the communication opening and closing status of the communication line between the test initiator and the test execution end, the type of signal transmitted by the communication line, and the level high and low status of the input pin of the test execution end. The opening and closing status of multiple communication lines, the signal transmission type, and the level high and low of multiple input pins can constitute different execution modes. Such execution modes can be permuted and combined to create conditions that meet the software state switching. By permuting and combining all execution modes, all execution combinations of software state switching can be obtained, that is, test cases. All test cases constitute a test case set. For ease of understanding, an example is provided. Assume that there are three execution modes of the software state, namely a, b, and c. By permuting and combining a, b, and c, a total of 6 execution modes are obtained, namely a, ab, abc, b, bc, and c.

[0090] By arranging and combining all execution modes for performing the software state switching, full coverage of software switching scenarios is achieved, which is beneficial to solving problems existing in software switching.

[0091] Step 102: When it is determined that the first target test case has completed testing, a first control instruction for switching the software state to the waiting-for-test state is sent to the test execution end, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction.

[0092] When the first target test case completes the test, the software state may switch from the to-be-tested state to other states. Since other test cases in the test set have not yet tested the to-be-tested state, in order to enable other test cases in the test set to perform state switching tests on the to-be-tested state, the test initiator needs to send a first control instruction to the test execution end to switch the software state to the to-be-tested state, so that the test execution end switches the software state to the to-be-tested state based on the first control instruction. After the test case completes the test, the first control instruction to switch the software state to the to-be-tested state is sent to the test execution end, so that the software state can automatically switch to the to-be-tested state after the test case completes the test, thereby improving the test efficiency of state switching.

[0093] Step 103: When it is determined that the software state has switched to the state to be tested, a second target test case is sent to the test execution end so that the test execution end switches the state based on the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0094] When it is determined that the software state has switched to the state to be tested, it means that the test execution end is ready to perform the state switching test of the test case. Therefore, it is necessary to send a second target test case to the test execution end until each test case in the test case set is tested so that the test execution end performs state switching based on the second target test case; the second target test case is any test case in the test case set except the first target test case.

[0095] To facilitate understanding, an example is provided. Suppose there are three test cases in the test set, namely a, b, and c. When the software state switches to the waiting-for-test state, the test initiator sends a to the test execution end, and the test execution end executes a. After a completes the test, the software state is switched to the waiting-for-test state. The test initiator sends b to the test execution end, and the test execution end executes b. After b completes the test, the software state is switched to the waiting-for-test state. The test initiator sends c to the test execution end, and the test execution end executes c. After c completes the test, the test ends.

[0096] By testing all test cases in the test set, full coverage of all switching scenarios is achieved, which helps detect problems with state switching.

[0097] The state switching testing method provided by the present disclosure includes: when it is determined that the software state of the test execution end is switched to the waiting state, sending a first target test case to the test execution end, so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in a test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to a test case, and all test cases constitute the test case set; when it is determined that the first target test case has completed the test, sending a first control instruction for switching the software state to the waiting state to be tested to the test execution end, so that the test execution end switches the software state to the waiting state to be tested based on the first control instruction; when it is determined that the software state is switched to the waiting state, sending a second target test case to the test execution end, so that the test execution end performs state switching based on the second target test case, until each test case in the test case set has completed the test; the second target test case is any test case in the test case set except the first target test case. Compared with the related art, the embodiment of the present disclosure obtains all permutation and combination results by permuting and combining all execution modes of software state switching. One permutation and combination result corresponds to a test case. All test cases constitute the test case set, and each test case in the test case set tests the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0098] As a refinement of step 102, when executing the determination of whether the first target test case has completed the test, it can be implemented in the following manner but is not limited to: Figure 4 As shown, Figure 4 A flowchart of a method for determining whether a test case has completed a test is provided in an embodiment of the present disclosure, including:

[0099] Step 201: Acquire software state switching information of the test execution end; the software state switching information includes the software state and the test time of the first target test case.

[0100] By acquiring the software state switching information of the test execution end, the progress of the test can be monitored, which helps to manage and control the test process.

[0101] The change of the level signal of the communication line or output pin can reflect the software state. The test initiator obtains the change of the level signal of the communication line or output pin to indirectly obtain the software state switching information.

[0102] Step 202: When it is determined that the software state is the predicted switching state corresponding to the state to be tested, or when it is determined that the test time exceeds the preset time threshold, a second control instruction for switching the software state to the end state is sent to the test execution end, so that the test execution end switches the software state to the end state based on the second control instruction.

[0103] When the software state is the predicted switching state corresponding to the state to be tested, it means that the software state switching is in line with expectations, and there is no problem with the software state switching rule under the operation of the current test case. When the test time exceeds the preset time threshold, it means that the software state switching is not in line with expectations, and there is a problem with the software state switching rule under the operation of the current test case. It is necessary to make targeted adjustments to the software state switching rule according to the current test case. The preset time threshold can be any value, for example, 1 minute. The embodiment of the present disclosure does not limit the specific value of the preset time threshold.

[0104] By determining that the software state is the predicted switching state corresponding to the state to be tested or determining that the test time exceeds the preset time threshold, the test of the current test case can be ended in advance, thereby improving the test efficiency of the state switching.

[0105] Step 203: When it is determined that the software state is the end state, it is determined that the first target test case has completed testing.

[0106] The end state is a software state in which the software completes all operations. When the software state is the end state, it means that the software has completed all operations. When the software state is the end state, it can be determined that the test case has completed the test.

[0107] Setting the end status to indicate that the test case has completed testing can eliminate the impact of the test case on the software and prevent the current test case from affecting the testing of the next test case.

[0108] Related to the above embodiment, the test case set needs to be constructed in advance to ensure that the test case set can switch all scenarios. The following methods can be used, but are not limited to, to respectively obtain at least one execution method corresponding to each state in the software state for switching the software state; arrange and combine all execution methods to obtain at least one execution method combination; determine each execution method combination as a test case, and store all test cases in the test case set to complete the construction of the test case set. By constructing the test case set, coverage of all state switching scenarios is achieved.

[0109] To facilitate understanding, an example is provided. Assume that there are three execution modes, namely a, b, and c. By permuting and combining a, b, and c, we get a, ab, abc, b, bc, and c. a, ab, abc, b, bc, and c are respectively identified as a test case.

[0110] In actual applications, after determining that the first target test case has completed the test, in order to better understand the impact of the test case on the software state switching, it is necessary to obtain the test results of the state switching based on the first target test case sent by the test execution end and analyze the test results. The following method can be used, but is not limited to, to receive the test results of the state switching based on the first target test case sent by the test execution end; analyze the test results to obtain analysis results so as to adjust the software state switching based on the analysis results; wherein the test results include software state switching information and log information about the test case by the test execution end; by analyzing the test results, it is beneficial to adjust and optimize the state switching rules.

[0111] The above embodiment describes the state switching test method applied to the test initiator, and the subsequent embodiments describe the state switching test method applied to the test execution end. Figure 5 A flowchart of another state switching testing method provided by an embodiment of the present disclosure.

[0112] like Figure 5 As shown, the method is applied to the test execution end and includes the following steps:

[0113] Step 301: Receive the first target test case sent by the test initiating end, and perform software state switching according to the execution method in the first target test case until the first target test case completes the test; the first target test case is any test case in the test case set, wherein all execution methods of the software state switching are arranged and combined to obtain all arrangement and combination results, one arrangement and combination result corresponds to one test case, and all test cases constitute the test case set.

[0114] The test execution end is a deployment device for the software state machine. The software state machine is a model that describes the behavior and state transition of the software in different states. The software state machine switches the software state according to the execution method in the first target test case.

[0115] For ease of understanding, an example is provided. Assume that the execution method in the first target test case is to switch the software state to state a, the state to be tested is b, and the state switching rule stipulates that b can be switched to a, then the software state machine switches b to a.

[0116] Step 302: Receive a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switch the software state to the waiting-for-test state based on the first control instruction.

[0117] After the first target test case is tested, other test cases in the test set also need to be tested in the to-be-tested state. By receiving the first control instruction sent by the test initiator to switch the software state to the to-be-tested state, and switching the software state to the to-be-tested state based on the first control instruction, the test efficiency of the test case can be improved.

[0118] Step 303: Receive the second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0119] By testing each test case in the test set for the state to be tested, all switching scenarios of the state switching can be covered, which helps to detect problems in the state switching.

[0120] To facilitate understanding, an example is provided. Suppose there are three test cases in the test set, namely a, b, and c. When the software state switches to the waiting-for-test state, the test initiator sends a to the test execution end, and the test execution end executes a. After a completes the test, the software state is switched to the waiting-for-test state. The test initiator sends b to the test execution end, and the test execution end executes b. After b completes the test, the software state is switched to the waiting-for-test state. The test initiator sends c to the test execution end, and the test execution end executes c. After c completes the test, the test ends.

[0121] The state switching testing method provided by the present disclosure includes: when it is determined that the software state of the test execution end is switched to the waiting state, sending a first target test case to the test execution end, so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in a test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to a test case, and all test cases constitute the test case set; when it is determined that the first target test case has completed the test, sending a first control instruction for switching the software state to the waiting state to be tested to the test execution end, so that the test execution end switches the software state to the waiting state to be tested based on the first control instruction; when it is determined that the software state is switched to the waiting state, sending a second target test case to the test execution end, so that the test execution end performs state switching based on the second target test case, until each test case in the test case set has completed the test; the second target test case is any test case in the test case set except the first target test case. Compared with the related art, the embodiment of the present disclosure obtains all permutation and combination results by permuting and combining all execution modes of software state switching. One permutation and combination result corresponds to a test case. All test cases constitute the test case set, and each test case in the test case set tests the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0122] In actual applications, after the first target test case completes the test, the test initiator needs to monitor the test progress of the test execution end, which can be achieved by but not limited to the following methods: sending software status switching information to the test initiator so that the test initiator can determine that the first target test case has completed the test based on the software status in the software status switching information and the test time of the first target test case, which helps the test initiator manage and control the test process.

[0123] In actual applications, before receiving the first target test case sent by the test initiator, the test case set needs to be constructed in advance. In order to enable the test initiator to better construct the test case set, the test execution end needs to send at least one execution method for switching the software state corresponding to each state in the software state to the test initiator, so that the test initiator can construct the test case set based on the at least one execution method for switching the software state.

[0124] In actual applications, after sending the software state switching information to the test initiator, in order to better understand the impact of the test case on the software state switching, the test execution end needs to send the test results of the state switching based on the first target test case to the test initiator, so that the test initiator can analyze the test results, wherein the test results include the software state switching information and the log information of the test execution end about the test case; by analyzing the test results, it is helpful to adjust and optimize the state switching rules.

[0125] In one implementation of the present disclosure, in order to better understand the execution process of the test case, as shown in FIG. Figure 6 As shown, Figure 6 A flow chart of the execution process of a test case provided in an embodiment of the present disclosure, after the test is started: the software state is the on state, and the first control instruction for switching the software state to the to-be-tested state is executed, and the on state is switched to the to-be-tested state; then, the host computer controls the relevant network bus devices and IO boards, triggers any test case in the test case set, and records the software state information and other necessary log information fed back by the domain controller; after the above test case is triggered, when it is determined that the software state is the predicted switching state corresponding to the to-be-tested state, or when it is determined that the test time exceeds a preset time threshold, the second control instruction for switching the software state to the end state is executed, and the software state is switched to the end state.

[0126] According to the test method for the target state T, all sub-states are tested in sequence, thereby achieving a complete test of the software internal state machine switching.

[0127] In summary, the embodiments of the present disclosure can achieve the following effects:

[0128] 1. The embodiment of the present disclosure tests the software state switching by using each test case in the test case set obtained by permuting and combining all execution modes for performing the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0129] 2. The embodiment of the present disclosure determines that the current test case has completed the test, automatically switches the software state to the state to be tested, and can automatically perform the state switching test.

[0130] Corresponding to the above-mentioned state switching test method, the present invention also provides a state switching test device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment and will not be repeated in this invention.

[0131] Figure 7A schematic diagram of a state switching test device provided in an embodiment of the present disclosure, wherein the device is applied to a test initiator, such as Figure 7 Shown, including:

[0132] A first sending unit 51 is configured to send a first target test case to the test execution terminal when determining that the software state of the test execution terminal has switched to the waiting-for-test state, so that the test execution terminal performs state switching based on the first target test case; the first target test case is any test case in a test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0133] The second sending unit 52 is configured to send a first control instruction for switching the software state to the waiting-for-test state to the test execution end when it is determined that the first target test case has completed testing, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction;

[0134] The third sending unit 53 is used to send a second target test case to the test execution end when it is determined that the software state has switched to the to-be-tested state, so that the test execution end switches the state based on the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0135] The state switching test device provided by the present disclosure sends a first target test case to the test execution end when it is determined that the software state of the test execution end is switched to the waiting state, so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in the test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to a test case, and all test cases constitute the test case set; when it is determined that the first target test case has completed the test, a first control instruction for switching the software state to the waiting state is sent to the test execution end, so that the test execution end switches the software state to the waiting state based on the first control instruction; when it is determined that the software state is switched to the waiting state, a second target test case is sent to the test execution end, so that the test execution end performs state switching based on the second target test case until each test case in the test case set has completed the test; the second target test case is any test case in the test case set except the first target test case. Compared with the related art, the embodiment of the present disclosure obtains all permutation and combination results by permuting and combining all execution modes of software state switching. One permutation and combination result corresponds to a test case. All test cases constitute the test case set, and each test case in the test case set tests the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0136] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 8 As shown, the device also includes:

[0137] An acquiring unit 54 is configured to acquire software state switching information of the test execution terminal; the software state switching information includes the software state and the test time of the first target test case;

[0138] The second sending unit 52 is further configured to send a second control instruction for switching the software state to the end state to the test execution end when it is determined that the software state is in the predicted switching state corresponding to the state to be tested, or when it is determined that the test time exceeds a preset time threshold, so that the test execution end switches the software state to the end state based on the second control instruction;

[0139] The determining unit 55 is configured to determine that the test of the first target test case is completed when determining that the software state is the end state.

[0140] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 8 As shown, the device also includes:

[0141] The acquisition unit 54 is further configured to respectively acquire at least one execution mode for performing the software state switching corresponding to each state in the software state;

[0142] A combining unit 56 is configured to arrange and combine all execution modes to obtain at least one execution mode combination;

[0143] The storage unit 57 is configured to determine each execution mode combination as a test case, and store all the test cases in the test case set to complete the construction of the test case set.

[0144] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 8 As shown, the device also includes:

[0145] A first receiving unit 58 is configured to receive a test result of state switching based on the first target test case sent by the test execution end after determining that the first target test case has completed testing;

[0146] The analyzing unit 59 is configured to analyze the test result to obtain an analysis result, so as to adjust the software state switching based on the analysis result.

[0147] Figure 9 This is a schematic diagram of the structure of another state switching test device provided by an embodiment of the present disclosure, wherein the device is applied to a test execution end, such as Figure 9 Shown, including:

[0148] A switching unit 61 is configured to receive a first target test case sent by a test initiating terminal, and perform software state switching according to an execution mode in the first target test case until the first target test case completes testing; the first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set;

[0149] The second receiving unit 62 is configured to receive a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switch the software state to the waiting-for-test state based on the first control instruction;

[0150] The third receiving unit 63 is used to receive the second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

[0151] The state switching test device provided by the present disclosure sends a first target test case to the test execution end when it is determined that the software state of the test execution end is switched to the waiting state, so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in the test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to a test case, and all test cases constitute the test case set; when it is determined that the first target test case has completed the test, a first control instruction for switching the software state to the waiting state is sent to the test execution end, so that the test execution end switches the software state to the waiting state based on the first control instruction; when it is determined that the software state is switched to the waiting state, a second target test case is sent to the test execution end, so that the test execution end performs state switching based on the second target test case until each test case in the test case set has completed the test; the second target test case is any test case in the test case set except the first target test case. Compared with the related art, the embodiment of the present disclosure obtains all permutation and combination results by permuting and combining all execution modes of software state switching. One permutation and combination result corresponds to a test case. All test cases constitute the test case set, and each test case in the test case set tests the software state switching, thereby achieving comprehensive coverage of the software state switching scenarios.

[0152] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 10 As shown, the device also includes:

[0153] The fourth sending unit 64 is used to send software status switching information to the test initiator after the first target test case completes the test, so that the test initiator determines that the first target test case has completed the test based on the software status in the software status switching information and the test time of the first target test case.

[0154] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 10 As shown, the device also includes:

[0155] The fifth sending unit 65 is used to send at least one execution method for switching the software state corresponding to each state in the software state to the test initiator before receiving the first target test case sent by the test initiator, so that the test initiator constructs the test case set based on the at least one execution method for switching the software state.

[0156] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 10 As shown, the device also includes:

[0157] The sixth sending unit 66 is configured to send a test result of state switching based on the first target test case to the test initiator after sending the software state switching information to the test initiator, so that the test initiator can analyze the test result.

[0158] Figure 11 A schematic diagram of a state switching test system provided by an embodiment of the present disclosure is shown in FIG. Figure 11 Shown, including:

[0159] A test initiating end 71 and a test executing end 72 , wherein the test initiating end 71 is a device configured at the test initiating end, and the test executing end 72 is a device configured at the test executing end.

[0160] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principles are the same, which is not limited in this embodiment.

[0161] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0162] Figure 12 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0163] like Figure 12As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 802 or a computer program loaded from a storage unit 808 into a RAM (Random Access Memory) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An I / O (Input / Output) interface 805 is also connected to the bus 804.

[0164] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0165] The computing unit 801 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Unit), various specialized AI (Artificial Intelligence) computing chips, various computing units that run machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the state transition test method. For example, in some embodiments, the state transition test method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the aforementioned state switching test method in any other appropriate manner (for example, by means of firmware).

[0166] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System on Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0167] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0168] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0170] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0171] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0172] It's important to note that artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). This encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0173] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0174] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A state switching test method, characterized in that: The method is applied to a test initiator, and includes: When it is determined that the software state of the test execution end is switched to the waiting-for-test state, a first target test case is sent to the test execution end so that the test execution end performs state switching based on the first target test case; the first target test case is any test case in the test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set; When it is determined that the first target test case has completed testing, sending a first control instruction for switching the software state to the waiting-for-test state to the test execution end, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction; When it is determined that the first target test case has completed testing, a second target test case is sent to the test execution end so that the test execution end switches states based on the second target test case until each test case in the test case set has completed testing; the second target test case is any test case in the test case set except the first target test case.

2. The method according to claim 1, characterized in that Determining that the first target test case has completed testing includes: Acquire software state switching information of the test execution end; the software state switching information includes the software state and the test time of the first target test case; When it is determined that the software state is in the predicted switching state corresponding to the state to be tested, or when it is determined that the test time exceeds a preset time threshold, a second control instruction for switching the software state to an end state is sent to the test execution end, so that the test execution end switches the software state to the end state based on the second control instruction; When it is determined that the software state is the end state, it is determined that the first target test case has completed testing.

3. The method according to claim 1, characterized in that The method for constructing the test case set includes: Respectively obtaining at least one execution mode for switching the software state corresponding to each state in the software state; Arrange and combine all execution modes to obtain at least one execution mode combination; Each execution mode combination is determined as a test case, and all test cases are stored in the test case set to complete the construction of the test case set.

4. The method according to claim 1, wherein After determining that the first target test case has completed testing, the method further includes: receiving a test result of state switching based on the first target test case sent by the test execution end; The test result is analyzed to obtain an analysis result, so as to adjust the software state switching based on the analysis result.

5. A state switching test method, characterized in that: The method is applied to the test execution end and includes: Receive a first target test case sent by a test initiator, and perform software state switching according to the execution mode in the first target test case until the first target test case completes testing; the first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set; receiving a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switching the software state to the waiting-for-test state based on the first control instruction; Receive a second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

6. The method according to claim 5, characterized in that After the first target test case completes testing, the method further includes: The software state switching information is sent to the test initiator so that the test initiator determines whether the first target test case has completed testing based on the software state in the software state switching information and the test time of the first target test case.

7. The method according to claim 5, characterized in that Before receiving the first target test case sent by the test initiator, the method further includes: At least one execution method for switching the software state corresponding to each state in the software state is sent to the test initiator, so that the test initiator constructs the test case set based on the at least one execution method for switching the software state.

8. The method according to claim 5, characterized in that After sending the software state switching information to the test initiator, the method further includes: The test result of state switching based on the first target test case is sent to the test initiator so that the test initiator analyzes the test result.

9. A state switching test device, characterized in that: The device is applied to a test initiator, and includes: A first sending unit is configured to send a first target test case to the test execution end when determining that the software state of the test execution end has switched to a waiting-for-test state, so that the test execution end switches the state based on the first target test case; the first target test case is any test case in a test case set, wherein all execution modes of the software state switching are permuted and combined to obtain all permutation and combination results, each permutation and combination result corresponds to one test case, and all test cases constitute the test case set; a second sending unit, configured to send a first control instruction for switching the software state to the waiting-for-test state to the test execution end when determining that the first target test case has completed testing, so that the test execution end switches the software state to the waiting-for-test state based on the first control instruction; The third sending unit is used to send a second target test case to the test execution end when it is determined that the software state has switched to the waiting-for-test state, so that the test execution end switches the state based on the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

10. A state switching test device, characterized in that: The device is applied to a test execution end and includes: A switching unit is configured to receive a first target test case sent by a test initiating terminal, and perform software state switching according to an execution mode in the first target test case until the first target test case completes testing; the first target test case is any test case in a test case set, wherein all execution modes of software state switching are permuted and combined to obtain all permutation and combination results, one permutation and combination result corresponds to one test case, and all test cases constitute the test case set; a second receiving unit, configured to receive a first control instruction for switching the software state to a waiting-for-test state sent by the test initiator, and switch the software state to the waiting-for-test state based on the first control instruction; A third receiving unit is used to receive a second target test case sent by the test initiator, and switch the software state according to the execution method in the second target test case until each test case in the test case set is tested; the second target test case is any test case in the test case set except the first target test case.

11. A state switching test system, characterized in that: The system includes a test initiator and a test execution terminal, including: The test initiator includes the state switching test device according to claim 9; The test execution end includes the state switching test device according to claim 10.

12. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 4 or the method of any one of claims 5 to 8.

13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4 or the method according to any one of claims 5 to 8.

14. A computer program product, characterized in that The method comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 4 or the method according to any one of claims 5 to 8.