Interface testing method and system for multi-task software

By building a message structure analysis library corresponding to the task message structure under test, the problem of limited testing of multi-task software is solved, and flexible measurement of the input and output logic of a single task within the multi-task software is realized.

CN120086128APending Publication Date: 2025-06-03CHENGDU XINJIXUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411972751.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The testing efforts of multi-task software in the prior art are limited, and the input and output logic of a single task within a multi-task software cannot be measured.

Method used

By building a message structure analysis library corresponding to the task message structure of the test end on the test end, establishing a communication connection, sending the task message name to be checked, decoding and checking the received task messages, the testing efforts are expanded.

Benefits of technology

It realizes flexible measurement of the input and output logic of a single task software within a multi-task software, and expands the testing efforts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086128A_ABST
    Figure CN120086128A_ABST
Patent Text Reader

Abstract

The invention provides an interface test method and system for multi-task software. The interface test method comprises the following steps: constructing a message structure analysis library corresponding to a task message structure of a tested end at a test end; establishing communication connection between the tested end and the test end; the test end sends a to-be-checked task message name to the tested end; when the tested end detects that the message name of the task message transmitted between the task software is consistent with the task message name sent by the test end, the task message is sent to the test end; the test end receives the task message sent by the tested end, and decodes the task message based on the message structure analysis library; and the test end checks the decoded task message. By constructing the message structure analysis library corresponding to the task message structure of the tested end, the input and output logic of the single task software in the multi-task software can be tested very flexibly, and the test strength is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software interface testing, and particularly relates to an interface testing method and system for multitasking software. Background Art

[0002] For the testing of multitasking software in the prior art, especially the testing of large and complex multitasking software, if only end-to-end black box testing is performed, the multitasking software can only be regarded as a whole to test the input-output logic, and the testing intensity is limited, and the input-output logic of individual tasks inside the multitasking software cannot be detected. Summary of the Invention

[0003] Based on the above problems, the present invention provides an interface testing method and system for multitasking software, aiming to solve the technical problems such as limited testing intensity of multitasking software in the prior art.

[0004] An interface testing method for multitasking software, where the device under test includes multiple task software to be tested, and the method includes the following steps:

[0005] Step A1, construct a message structure parsing library corresponding to the task message structure of the device under test at the test end;

[0006] Step A2, establish a communication connection between the device under test and the test end;

[0007] Step A3, the test end sends the task message name to be checked to the device under test;

[0008] Step A4, when the device under test detects that the message name of the task message transmitted between task software is the same as the task message name sent by the test end, send the task message to the test end;

[0009] Step A5, the test end receives the task message sent by the device under test and decodes the task message based on the message structure parsing library;

[0010] Step A6, the test end checks the decoded task message.

[0011] Further, after step A3, the following steps are also executed:

[0012] Step B1, the test end constructs the task message transmitted between the task software of the device under test based on the message structure parsing library;

[0013] Step B2, the test end sends the constructed task message to the device under test;

[0014] Step B3, the task software of the device under test processes the task message constructed by the test end to form a new task message, and transmits the new task message to another task software, and then step A4 is executed.

[0015] Further, after step A3, the following steps are also executed:

[0016] Step C1, the device under test receives the task message name sent by the test device and stores the task message name in a preset hash table;

[0017] In step A4, when the device under test detects that the message name of the task message passed between the task software exists in the preset hash table, it sends the task message to the test device.

[0018] Further, step A1 includes:

[0019] Step A11, the test device obtains the task message structure of the device under test;

[0020] Step A12, the test device maps the task message structure into a message structure parsing library based on a preset mapping rule;

[0021] Step A13, the test device saves the message structure parsing library.

[0022] An interface test system for multitasking software includes a test device and a device under test;

[0023] The test device includes: constructing a message structure parsing library corresponding to the task message structure of the device under test, establishing a communication connection with the communication interface of the device under test, and sending the task message name to be checked to the device under test;

[0024] The device under test includes multiple task software to be tested, a communication interface, and a common interface. The task software and the communication interface are connected to the common interface;

[0025] When the common interface detects that the task message passed between the task software is the same as the task message name sent by the test device, it also sends the task message to the communication interface;

[0026] The communication interface is used to send the task message sent by the common interface to the test device;

[0027] The test device is also used to: receive the task message sent by the device under test, decode the task message based on the message structure parsing library, and check the decoded task message.

[0028] Further, the test device is also used to:

[0029] Construct the task message passed between the task software of the device under test based on the message structure parsing library;

[0030] Send the constructed task message to the device under test;

[0031] The task software of the device under test processes the task message constructed by the test device to form a new task message, and passes the new task message to another task software through the common interface.

[0032] Further, the public interface is also used for:

[0033] Receiving the task message name sent by the test end and storing the task message name in a preset hash table;

[0034] When it is detected that the message name of the task message transmitted between the task software exists in the preset hash table, sending the task message to the communication interface.

[0035] Further, when the test end constructs the message structure parsing library, it executes:

[0036] Obtaining the task message structure of the device under test;

[0037] Mapping the task message structure into a message structure parsing library based on a preset mapping rule;

[0038] The test end saves the message structure parsing library.

[0039] The beneficial technical effects of the present invention are as follows: By constructing a message structure parsing library corresponding to the task message structure of the device under test, the input and output logic of a single task software inside a multi-task software can be measured very flexibly, expanding the test intensity. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figures 1-3 It is a step flow chart of an interface test method for a multi-task software of the present invention;

[0041] Figure 4 It is a module schematic diagram of an interface test system for a multi-task software of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0043] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0044] The following further describes the present invention with reference to the accompanying drawings and specific embodiments, but is not a limitation to the present invention.

[0045] See Figure 1 , the present invention provides an interface test method for a multi-task software. The device under test includes multiple task software to be tested, and the method includes the following steps:

[0046] Step A1, construct a message structure parsing library corresponding to the task message structure of the device under test at the test end;

[0047] Step A2, establish a communication connection between the device under test and the test end;

[0048] Step A3, the test end sends the task message name to be checked to the device under test;

[0049] Step A4, when the device under test detects that the message name of the task message transmitted between the task software is the same as the task message name sent by the test end, it sends the task message to the test end;

[0050] Step A5, the test end receives the task message sent by the device under test and decodes the task message based on the message structure parsing library;

[0051] Step A6, the test end checks the decoded task message.

[0052] In step A4, if the device under test detects that the message name of the task message transmitted between the task software is the same as the task message name sent by the test end, it duplicates the task message, one copy is continued to be sent to the corresponding task software, and the other copy is sent to the test end.

[0053] Through the construction of a message structure parsing library corresponding to the task message structure of the device under test, the present invention can very flexibly measure the input-output logic of a single task software inside multi-task software, expanding the test intensity.

[0054] See Figure 2 , further, after step A3, the following steps are also executed:

[0055] Step B1, the test end constructs a task message transmitted between the task software of the device under test based on the message structure parsing library;

[0056] Step B2, the test end sends the constructed task message to the device under test;

[0057] Step B3, the task software of the device under test processes the task message constructed by the test end to form a new task message, and transmits the new task message to another task software, and then step A4 is executed.

[0058] The test end transmits the constructed task message to the device under test through the communication interface. Since bytecode streams are sent on the communication interface, the test end constructs the task message by encoding based on the message structure parsing library. The message structure parsing library corresponds to the task message structure of the device under test. Therefore, when the test end wants to send a task message to a certain task software, it encodes to form a task message according to the message structure parsing library corresponding to the task message structure of this task software. The constructed task message is sent to the device under test, and the task software of the device under test can parse the task message constructed by the test end according to its own task message structure. Through the mapping between the message structure parsing library and the task message structure, it can be ensured that the task message is understood consistently on both the test end and the device under test side.

[0059] Further, after step A3, the following is also executed:

[0060] Step C1, the device under test receives the task message name sent by the test end and stores the task message name in a preset hash table;

[0061] In step A4, when the device under test detects that the message name of the task message transmitted between task softwares exists in the preset hash table, it sends a task message to the test end.

[0062] During the operation of large multi-task software, there are a large number of messages sent between task softwares, and not all messages need to be sent to the test end through the communication interface. According to the test purpose, the test end sends the task message names that need to be received and checked to the device under test in advance. When the device under test finds that it is a task message required by the test end, it sends the corresponding task message to the test end through the communication interface. Therefore, the present invention establishes a hash table to store the task message names that the test end needs to check.

[0063] See Figure 3 , further, step A1 includes:

[0064] Step A11, the test end obtains the task message structure of the device under test;

[0065] Step A12, the test end maps the task message structure into a message structure parsing library based on a preset mapping rule;

[0066] Step A13, the test end saves the message structure parsing library.

[0067] Generally, the programming languages used by the device under test and the test end are different, and the message structure of the device under test cannot be directly used at the test end. Therefore, according to the differences between the specific programming languages of the test end and the device under test, mapping rules are written in advance to map the task message structure to the message structure parsing library.

[0068] Further, each task software at the DUT side has an independent message queue, and the task messages are the messages passed between multitask softwares. When a certain task software is scheduled, it fetches the task messages from the message queue and processes them. The output task messages may all be sent to the message queues of other task softwares. When other task softwares are scheduled again, they read and process the task messages from the message queue.

[0069] See Figure 4 , the present invention also provides an interface test system for multitask software, including a test end (1) and a DUT end (2);

[0070] The test end (1) includes: constructing a message structure parsing library corresponding to the task message structure of the DUT end, establishing a communication connection with the communication interface of the DUT end, and sending the task message names to be checked to the DUT end (2);

[0071] The DUT end (2) includes multiple DUT task softwares (21), a communication interface (22) and a common interface (23), and the task software (21) and the communication interface (22) are connected to the common interface (23);

[0072] When the common interface (23) detects that the task messages passed between the task softwares (21) are consistent with the task message names sent from the test end (1), it also sends the task messages to the communication interface (22);

[0073] The communication interface (22) is used to send the task messages sent from the common interface (23) to the test end (1);

[0074] The test end (1) is also used to: receive the task messages sent from the DUT end (2), decode the task messages based on the message structure parsing library, and check the decoded task messages.

[0075] If the DUT end (2) detects that the message names of the task messages passed between the task softwares are consistent with the task message names sent from the test end, it duplicates the task messages, one copy is continued to be sent to the corresponding task software, and the other copy is sent to the test end.

[0076] By constructing a message structure parsing library corresponding to the task message structure of the DUT end, the present invention can very flexibly measure the input / output logic of a single task software inside multitask software, expanding the test intensity.

[0077] Further, the test end (1) is also used to:

[0078] Construct task messages passed between the task softwares at the DUT end (2) based on the message structure parsing library;

[0079] Send the constructed task messages to the DUT end (2);

[0080] The task software (21) at the DUT end (2) processes the task messages constructed by the test end (1) to form new task messages, and transfers the new task messages to another task software through the common interface (23).

[0081] The test end transfers the constructed task messages to the DUT end through the communication interface. Since bytecode streams are sent on the communication interface, the test end constructs task messages through the encoding method based on the message structure parsing library. The message structure parsing library corresponds to the task message structure at the DUT end. Therefore, when the test end wants to send task messages to a certain task software, it encodes to form task messages according to the message structure parsing library corresponding to the task message structure of this task software. The constructed task messages are sent to the DUT end, and the task software at the DUT end can parse the task messages constructed by the test end according to its own task message structure. Through the mapping between the message structure parsing library and the task message structure, it can be ensured that the task messages are understood consistently at both the test end and the DUT end.

[0082] Furthermore, the common interface (23) is also used for:

[0083] Receiving the task message names sent by the test end (1) and storing the task message names in a preset hash table;

[0084] When it is detected that the message names of the task messages transferred between the task software (21) exist in the preset hash table, sending the task messages to the communication interface.

[0085] During the operation of large multi-task software, there are a large number of messages sent between task software, and not all messages need to be sent to the test end through the communication interface. According to the test purpose, the test end sends the task message names that need to be received and checked to the DUT end in advance. When the DUT end finds that it is a task message required by the test end, it sends the corresponding task message to the test end through the communication interface. Therefore, the present invention establishes a hash table to save the task message names that need to be checked by the test end.

[0086] Furthermore, when constructing the message structure parsing library, the test end (1) executes:

[0087] Obtaining the task message structure of the DUT end (2);

[0088] Mapping the task message structure into a message structure parsing library based on a preset mapping rule;

[0089] The test end (1) saves the message structure parsing library.

[0090] Generally, the programming languages used by the device under test (2) and the test device (1) are different, and the message structure of the device under test (2) cannot be directly used at the test device. Therefore, according to the differences between the specific programming languages of the test device (1) and the device under test (2), mapping rules are written in advance to map the task message structure to the message structure parsing library.

[0091] Furthermore, each task software (21) of the device under test (2) has an independent message queue, and the task message is the message transmitted between multitask software. When a certain task software is scheduled, it takes out the task message from the message queue and processes it. The output task message may be sent to the message queues of other task software. When other task software is scheduled again, it reads the task message from the message queue and processes it.

[0092] The above are only preferred embodiments of the present invention, and do not limit the implementation manners and protection scope of the present invention. For those skilled in the art, it should be realized that all equivalent replacements and obvious changes made by using the description and illustration content of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for testing the interface of multi-task software, characterized in that: The tested end contains multiple tested task software, including the following steps: Step A1, constructing a message structure parsing library corresponding to the task message structure of the tested end at the testing end; Step A2, establishing a communication connection between the tested end and the testing end; Step A3, the testing end sends the task message name to be checked to the tested end; Step A4, when the tested end detects that the message name of the task message transmitted between the task software is consistent with the task message name sent by the test end, the tested end sends the task message to the test end; Step A5, the test end receives the task message sent by the tested end, and decodes the task message based on the message structure parsing library; Step A6: the test end checks the decoded task message.

2. A method for testing an interface of multi-task software as claimed in claim 1, characterized in that: After step A3, the following steps are further performed: Step B1, the test end constructs a task message transmitted between the task software of the tested end based on the message structure parsing library; Step B2, the test end sends the constructed task message to the tested end; Step B3: the task software of the tested end processes the task message constructed by the testing end to form a new task message, and transmits the new task message to another task software, and then executes step A4.

3. A method for testing an interface of multi-task software as claimed in claim 1, characterized in that: After step A3, the following steps are further performed: Step C1, the tested end receives the task message name sent by the testing end, and stores the task message name in a preset hash table; In step A4, when the tested end detects that the message name of the task message transmitted between task software exists in the preset hash table, the task message is sent to the testing end.

4. The interface testing method of multi-task software as claimed in claim 1, characterized in that: The step A1 comprises: Step A11, the test end obtains the task message structure of the tested end; Step A12, the test end maps the task message structure into a message structure parsing library based on a preset mapping rule; Step A13: the test end saves the message structure parsing library.

5. An interface testing system for multi-task software, characterized in that: Including the test end and the tested end; The test end includes: constructing a message structure parsing library corresponding to the task message structure of the tested end, establishing a communication connection with the communication interface of the tested end, and sending a task message name to be checked to the tested end; The tested end includes a plurality of tested task software, a communication interface and a common interface, and the task software and the communication interface are connected to the common interface; The public interface is used to detect that the task message transmitted between the task software is consistent with the task message name sent by the test end, and also send the task message to the communication interface; The communication interface is used to send the task message sent by the public interface to the test end; The test end is further used for: receiving the task message sent by the tested end, decoding the task message based on the message structure parsing library, and checking the decoded task message.

6. The interface testing system for multi-task software as claimed in claim 5, characterized in that: The test end is also used for: Building task messages transmitted between the task software of the tested end based on the message structure parsing library; Sending the constructed task message to the tested end; The task software of the tested end processes the task message constructed by the testing end to form a new task message, and transmits the new task message to another task software through the public interface.

7. The interface testing system for multi-task software as claimed in claim 5, characterized in that: The public interface is also used to: Receive the task message name sent by the test end, and store the task message name in a preset hash table; When it is detected that the message name of the task message transmitted between task software exists in the preset hash table, the task message is sent to the communication interface.

8. The interface testing system for multi-task software as claimed in claim 5, characterized in that: The test end executes when building the message structure parsing library: Obtaining the task message structure of the tested end; Mapping the task message structure into a message structure parsing library based on a preset mapping rule; The test end stores the message structure parsing library.