Function test method, device and equipment of test software and storage medium
By creating a virtual interactive serial port to receive and feedback test information, the efficiency and accuracy issues of software functional testing in existing technologies are solved, enabling efficient automated testing in the absence of samples, thereby improving development efficiency and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies lack efficient and accurate methods for testing software functionality, especially when there are no sample products or insufficient quantities. Manual communication testing cannot meet the needs of software development and cannot effectively simulate actual test scenarios.
By creating a virtual interactive serial port, instructions from the software under test are received and test information is fed back. The test status is obtained to determine the functional verification results. The virtual interactive serial port is used to simulate the actual test scenario and realize automated testing.
It improves the development efficiency of testing software, shortens the debugging cycle, reduces development costs, and provides guidance for optimization and improvement. It has high control precision and a wide range of applications.
Smart Images

Figure CN116303066B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent device testing technology, and in particular to a method, apparatus, device, and storage medium for functional testing of testing software. Background Technology
[0002] In the manufacturing process of electronic products, testing system software typically communicates and interacts with the product being tested to complete its functional and performance testing. The development and testing of the testing system software naturally involves the product being tested. However, in the early stages of a project, there are usually no sample products available or the quantity is limited. Furthermore, project development cycles are often demanding, especially for software development. Software testing is an essential step in software development; deploying untested software directly poses risks and hidden dangers. In this context, existing testing solutions generally involve manually testing each instruction using communication debugging software. However, this method requires verifying each test item individually, and communication interactions are often on the order of milliseconds. This manual debugging approach often fails to meet software testing requirements and cannot effectively simulate real-world testing scenarios. Therefore, there is an urgent need for a method that can efficiently test and verify the functionality of testing software. Summary of the Invention
[0003] The main objective of this invention is to provide a method, apparatus, device, and storage medium for testing the functionality of software, aiming to solve the technical problem of how to perform efficient, accurate, and realistic testing and verification of the functionality of software in the prior art.
[0004] To achieve the above objectives, the present invention provides a method for functional verification of testing software, the method comprising:
[0005] Create a virtual interactive serial port;
[0006] When a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port, test information is determined according to the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port.
[0007] Obtain the test status of the software under test when it receives the test information;
[0008] The functional verification result of the software under test is determined based on the test status.
[0009] Optionally, before determining the test information based on the test instruction and communication instruction information and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port after receiving the test instruction sent by the software under test through the first serial port of the virtual interactive serial port, the method further includes:
[0010] Obtain multiple preset test commands and the preset test information for each preset test command;
[0011] Information configuration is performed based on each preset test command and the preset test information of each preset test command to obtain communication command information.
[0012] Optionally, before determining the test information based on the test instruction and communication instruction information and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port after receiving the test instruction sent by the software under test through the first serial port of the virtual interactive serial port, the method further includes:
[0013] Get serial port configuration information;
[0014] Configure the virtual interactive serial port according to the serial port configuration information;
[0015] After the virtual interactive serial port is started and the information configuration is completed, the following steps are performed: when a test instruction is received from the software under test through the first serial port of the virtual interactive serial port, the test information is determined according to the test instruction and the communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port;
[0016] Accordingly, when a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port, the test information is determined based on the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port, including:
[0017] When a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port after information configuration is completed, the test information is determined according to the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port after information configuration is completed.
[0018] Optionally, when a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port, determining test information based on the test instruction and communication instruction information, and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port, includes:
[0019] When the test instruction sent by the software under test is the first instruction received through the first serial port of the virtual interactive serial port, a preset error message is determined according to the first instruction and the communication instruction information, and the preset error message is fed back to the software under test through the second serial port of the virtual interactive serial port.
[0020] When the test instruction sent by the software under test is the second instruction received through the first serial port of the virtual interactive serial port, the delay time and delay information are determined according to the second instruction and the communication instruction information, and the delay information is fed back to the software under test through the second serial port of the virtual interactive serial port according to the delay time.
[0021] Optionally, obtaining the test status of the software under test when it receives the test information includes:
[0022] When the test instruction is the first instruction, the error scenario state of the software under test when it receives the test information is obtained;
[0023] When the test instruction is the second instruction, the delay scenario state of the software under test is obtained according to the preset reception time and the test information.
[0024] Optionally, determining the functional verification result of the software under test based on the test status includes:
[0025] When the test instruction is a third instruction, the test data packet of the software to be tested is obtained according to the test status;
[0026] Obtain preset test information according to the third instruction;
[0027] The preset test information and the test data packet are compared to determine the comparison result.
[0028] The segmented test results of the software under test are determined based on the comparison results.
[0029] Optionally, determining the functional verification result of the software under test based on the test status includes:
[0030] The target inspection status and target inspection function are determined according to the test instructions;
[0031] The target inspection state and the test state are compared to determine the comparison result;
[0032] When the comparison result shows that the target inspection state and the test state are consistent, it is determined that the target inspection function of the software under test has passed the inspection.
[0033] Furthermore, to achieve the above objectives, the present invention also proposes a functional testing device for testing software, the functional testing device comprising:
[0034] Create a module to create a virtual interactive serial port;
[0035] The feedback module is used to determine test information based on the test instruction and communication instruction information when it receives a test instruction sent by the software under test through the first serial port of the virtual interactive serial port, and to feed back the test information to the software under test through the second serial port of the virtual interactive serial port;
[0036] The acquisition module is used to acquire the test status of the software under test when it receives the test information;
[0037] The determination module is used to determine the functional verification result of the software under test based on the test status.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes a functional testing device for testing software, the functional testing device comprising: a memory, a processor, and a functional testing program for the testing software stored in the memory and executable on the processor, the functional testing program for the testing software being configured to implement the functional testing method for the testing software as described above.
[0039] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a functional verification program for test software, wherein the functional verification program for test software, when executed by a processor, implements the functional verification method for test software as described above.
[0040] This invention creates a virtual interactive serial port. When a test command is received from the software under test through the first serial port of the virtual interactive serial port, test information is determined based on the test command and communication command information. The test information is then fed back to the software under test through the second serial port of the virtual interactive serial port. The test status of the software under test when receiving the test information is obtained. The functional verification result of the software under test is determined based on the test status. Through this method, by using the created virtual interactive serial port to receive test commands from the software under test, feed back test information to the software under test, obtain the test status of the software under test, and thus determine the functional verification result, the invention achieves the process of interacting with the test software without the participation of the product or actual equipment. This effectively simulates the actual testing scenario of the software, improves the development efficiency of the test software, shortens the debugging cycle of the software development, reduces development costs, and provides guidance for the subsequent optimization and improvement of the test software. It not only has high control precision but also a wide range of applications. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the structure of a functional testing device for the hardware operating environment testing software involved in the embodiments of the present invention;
[0042] Figure 2 This is a flowchart illustrating the first embodiment of the functional verification method for the testing software of the present invention;
[0043] Figure 3 This is a flowchart illustrating the second embodiment of the functional verification method for the testing software of the present invention;
[0044] Figure 4 This is a schematic flowchart of an embodiment of the functional verification method for the testing software of the present invention;
[0045] Figure 5 This is a structural block diagram of the first embodiment of the functional verification device for the testing software of the present invention.
[0046] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0047] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0048] Reference Figure 1 , Figure 1 This is a schematic diagram of the functional verification device for the hardware operating environment testing software involved in the embodiments of the present invention.
[0049] like Figure 1 As shown, the functional verification device for this testing software may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0050] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the functional verification equipment for the test software, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0051] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a functional verification program for testing software.
[0052] exist Figure 1 In the functional testing device of the test software shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the functional testing device of the test software of the present invention can be set in the functional testing device of the test software. The functional testing device of the test software calls the functional testing program of the test software stored in the memory 1005 through the processor 1001 and executes the functional testing method of the test software provided in the embodiment of the present invention.
[0053] This invention provides a method for functional verification of testing software, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of a functional verification method for testing software according to the present invention.
[0054] The functional verification method for testing software includes the following steps:
[0055] Step S10: Create a virtual interactive serial port.
[0056] It should be noted that the execution entity in this embodiment is the functional verification system of the test software. The functional verification system of the test software can build a virtual test channel. With the help of a virtual serial communication channel or network communication using the TCP / IP protocol, it can simulate the product and test equipment. By interacting with the host computer software of the test system, it can automatically complete the test process and verify the function of the test system software.
[0057] Understandably, when receiving a test instruction for the software under test, the functional test system uses a virtual serial port tool to establish a pair of virtual interactive serial ports for data exchange. The virtual interactive serial port contains two serial ports: a first serial port and a second serial port. The first serial port is used to receive data, and the second serial port is used to send data, thereby realizing data exchange with the software under test.
[0058] In practice, the software to be tested refers to the test system software whose functions need to be tested and verified.
[0059] Step S20: When a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port, the test information is determined according to the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port.
[0060] It should be noted that test commands refer to the communication commands sent by the software under test for each product test item. Communication command information refers to the mapping information of each test command and its corresponding feedback information configured in the functional verification system of the test software. The feedback information corresponding to each test command is the test information. For example, when the test command is "provgetbt sticker", the test information is "prov getbt sticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat,PASS".
[0061] Understandably, when the functional verification system of the testing software receives the test command sent by the software under test through the first serial port of the virtual interactive serial port, it searches for the test information corresponding to the test command in the communication command information, and feeds back the test information to the software under test through the second serial port of the virtual interactive serial port.
[0062] In the specific implementation, in order to ensure the normal return of test information, the communication command information needs to be configured in advance. Furthermore, when the test command sent by the software under test is received through the first serial port of the virtual interactive serial port, the test information is determined according to the test command and the communication command information. Before feeding back the test information to the software under test through the second serial port of the virtual interactive serial port, the following steps are also included: obtaining multiple preset test commands and preset test information of each preset test command; configuring information according to each preset test command and the preset test information of each preset test command to obtain the communication command information.
[0063] It should be noted that, in practical applications, the test commands used when the software under test interacts with the product or device are fixed and identical. Therefore, acquiring all the test commands involved in the interaction between the software under test and the product or device constitutes the preset test commands. Furthermore, to ensure that the functionality of the software under test can be verified under various scenarios during functional testing, corresponding preset test information is determined based on the preset test commands. Each preset test command and its corresponding preset test information are configured and stored to obtain the communication command information. For example, to verify whether the software under test can correctly detect error messages in the test information and output a result indicating test failure and termination, the preset test information with the preset test command "prov getbt sticker" is configured as "prov getbt sticker*hdr,BLE addr,BLE IR,BLE ER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat". The correct test information should be "prov getbt". sticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat,PASS”.
[0064] Understandably, to ensure the virtual interactive serial port can normally receive instructions and send messages, further, before determining test information based on the test instructions and communication instructions when receiving test instructions sent by the software under test through the first serial port of the virtual interactive serial port, and before feeding back the test information to the software under test through the second serial port of the virtual interactive serial port, the method further includes: obtaining serial port configuration information; configuring the virtual interactive serial port according to the serial port configuration information; starting the virtual interactive serial port after the information configuration is completed, and executing the step of determining test information based on the test instructions and communication instructions when receiving test instructions sent by the software under test through the first serial port of the virtual interactive serial port, and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port; obtaining serial port configuration information; configuring the virtual interactive serial port according to the serial port configuration information; starting the virtual interactive serial port after the information configuration is completed, and executing the step of determining test information based on the test instructions and communication instructions when receiving test instructions sent by the software under test through the first serial port of the virtual interactive serial port. The step of determining test information based on the command information and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port; correspondingly, when receiving a test command sent by the software under test through the first serial port of the virtual interactive serial port, determining the test information based on the test command and communication command information, and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port, includes: when receiving a test command sent by the software under test through the first serial port of the virtual interactive serial port after information configuration is completed, determining the test information based on the test command and communication command information, and feeding back the test information to the software under test through the second serial port of the virtual interactive serial port after information configuration is completed.
[0065] In practical implementation, serial port configuration information refers to the configuration information of serial port parameters, including but not limited to baud rate, data bits, stop bits, and parity bits. The functional verification platform of the test software obtains the serial port configuration information, configures the parameters of the virtual interactive serial port according to the serial port configuration information, and after completing the information configuration, executes the operation of opening the virtual interactive serial port, thereby performing the interaction process through the configured virtual interactive serial port. That is, the first serial port of the configured virtual interactive serial port receives the test commands sent by the software under test, determines the test information according to the test commands and communication command information, and uses the second serial port of the configured virtual interactive serial port to feed back the test information to the software under test.
[0066] Step S30: Obtain the test status of the software under test when it receives the test information.
[0067] It should be noted that the test status refers to the output state of the software under test indicating whether the test is proceeding normally. Test status includes two states: test failed and terminated, and test ran normally. When the software under test receives test information, it will output the corresponding test status based on that information. For example, if the functional verification system returns an error message, the software under test will output a test failed and terminated status when it receives an error message.
[0068] Step S40: Determine the functional verification result of the software under test based on the test status.
[0069] It should be noted that after obtaining the test status of the software under test under each test command, the test results of the software under test under each test function can be determined, thereby completing the functional test of the software under test.
[0070] Understandably, in order to ensure the effectiveness of the testing of the software under test and to determine whether the various verification functions of the software under test are normal, the step of determining the functional verification result of the software under test based on the test state further includes: determining the target verification state and the target verification function according to the test instruction; comparing the target verification state and the test state to determine the comparison result; and determining that the target verification function of the software under test has passed the verification when the comparison result shows that the target verification state and the test state are consistent.
[0071] In practical implementation, since the functional verification system for the testing software stores the test states that the software under test should output under each test instruction, the system determines the test states that the software under test should output based on the test instructions. These output test states are the target verification states and the target verification function corresponding to this test instruction. The target verification states and the test states output by the software under test are compared. If the comparison result shows that the target verification states and the test states are consistent, it indicates that the target verification function of the software under test has passed.For example, when the test command is "provgetbt sticker", the correct test information should be "prov getbt sticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat,PASS". However, the functional verification system for the testing software, in order to verify whether the software under test can correctly identify error messages, will use "prov getbt" instead of the correct information. The test information configuration for "sticker" is "provgetbtsticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat". At this time, the functional verification system of the testing software sends the error test information "prov getbtsticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat" to the software under test. Upon receiving "prov...", the software under test... When `getbtsticker*hdr,BLEaddr,BLEIR,BLEER|*dat,DA635EB41827,476f2d0cd1de1cc747bb2f9c55084dea,b1f28f05ced19b11a0be5b955ec5e8da*hdr,result|*dat”` is executed, the target verification state that the software under test should output is the state of test failure and termination. If the test state that the software under test actually outputs is also the state of test failure and termination, it means that the target verification state and the test state are consistent. The functional test of whether the software under test can correctly identify the error information has passed, and the functional test result is that the software under test can correctly identify the error information.
[0072] This embodiment creates a virtual interactive serial port. When a test command sent by the software under test is received through the first serial port of the virtual interactive serial port, test information is determined based on the test command and communication command information. The test information is then fed back to the software under test through the second serial port of the virtual interactive serial port. The test status of the software under test when receiving the test information is obtained. The functional verification result of the software under test is determined based on the test status. Through this method, the virtual interactive serial port is used to receive test commands from the software under test, feed back test information, and obtain the test status of the software under test to determine the functional verification result. This achieves the process of interacting with the test software without the participation of a product or actual equipment, effectively simulating the actual testing scenario of the software, improving the development efficiency of the test software, shortening the debugging cycle of software development, reducing development costs, and providing guidance for subsequent optimization and improvement of the test software. It not only has high control precision but also a wide range of applications.
[0073] refer to Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of a functional verification method for testing software according to the present invention.
[0074] Based on the first embodiment described above, step S20 in the functional verification method for the testing software in this embodiment includes:
[0075] Step S21: When the test instruction sent by the software under test is the first instruction received through the first serial port of the virtual interactive serial port, a preset error message is determined according to the first instruction and the communication instruction information, and the preset error message is fed back to the software under test through the second serial port of the virtual interactive serial port.
[0076] It should be noted that the first instruction refers to the instruction that configures the test information corresponding to the test instruction as a preset error message. The first instruction is used to verify whether the software under test can correctly identify the error message. When the test instruction sent by the software under test is the first instruction, it is received through the first serial port of the virtual interactive serial port. At this time, the preset error message corresponding to the first instruction is determined according to the first instruction and the communication instruction information, and the preset error message is fed back to the software under test through the second serial port of the virtual interactive serial port.
[0077] Step S22: When the test instruction sent by the software under test is the second instruction received through the first serial port of the virtual interactive serial port, the delay time and delay information are determined according to the second instruction and the communication instruction information, and the delay information is fed back to the software under test through the second serial port of the virtual interactive serial port according to the delay time.
[0078] It should be noted that the second instruction has a corresponding delay time, used to verify whether the software under test can correctly handle delayed return conditions. The test information corresponding to the second instruction is the delay information. The delay time exceeds the preset reception time, which refers to the normal time period during which the software under test receives the test information fed back by the functional verification system. For example, if the preset reception time is 5 seconds and the delay time is 10 seconds, the functional verification system of the software under test will feed back the delay information to the software under test through the second serial port of the virtual interactive serial port at 10 seconds. The software under test needs to receive the test information fed back by the functional verification system within 5 seconds. If this exceeds 5 seconds, the test status of the software under test should output a test failure and termination status.
[0079] It is understandable that, in order to verify whether the various functions of the software under test are normal, the test status under the corresponding scenarios of each function should be obtained. Further, obtaining the test status of the software under test when receiving the test information includes: when the test instruction is a first instruction, obtaining the error scenario status of the software under test when receiving the test information; when the test instruction is a second instruction, obtaining the delay scenario status of the software under test according to the preset reception time and the test information.
[0080] In the specific implementation, when the test instruction is the first instruction, the test status output by the software under test upon receiving the test information corresponding to the first instruction is obtained. The first instruction is used to verify whether the software under test can correctly identify error information, and the test status output by the software under test upon receiving the test information corresponding to the first instruction is the error scenario status. When the test instruction is the second instruction, the status output by the software under test upon receiving the test information corresponding to the second instruction is obtained. Since the second instruction is used to verify whether the software under test can correctly handle delayed return situations, when the test instruction is the second instruction, the software under test will not receive test information within the preset receiving time. At this time, if the software under test can correctly handle the delayed return situation, it will output a test failure and termination status when the preset receiving time is reached. If the software under test can receive test information under the second instruction, it means that the software under test is still in the message receiving state after the preset receiving time has expired, and outputs a test running normally status, thus determining that the software under test cannot correctly handle the delayed return situation.
[0081] It should be noted that, in order to verify whether the software under test can properly process received messages in a segmented return scenario, the step of determining the functional verification result of the software under test based on the test state further includes: when the test instruction is a third instruction, obtaining the test data packet of the software under test according to the test state; obtaining preset test information according to the third instruction; comparing the preset test information and the test data packet to determine the comparison result; and determining the segmented verification result of the software under test based on the comparison result.
[0082] Understandably, the third instruction refers to the instruction that configures the test information corresponding to the test instruction into several test data packets for feedback. The third instruction is used to verify whether the software under test can correctly process the received messages in a segmented return scenario. When the test instruction is the third instruction, the functional verification platform of the test software will divide the test information corresponding to the third instruction into several test data packets and feed them back to the software under test. If the software under test can correctly process the received messages, it will determine the length of the correct test message to be received when sending each instruction, and compare the length of the returned test data packet with the length of the correct test message. If the length of the returned single test data packet is inconsistent with the length of the correct test message, it needs to continue receiving within the preset receiving time until no test message is returned or the receiving time reaches the preset receiving time. Then, all the test data packets received within the preset receiving time are concatenated to output the correct test message. The test message output by the software under test after the preset receiving time is the test data packet received by the software under test. The preset test message is the test information corresponding to the third instruction without message splitting. After the software under test outputs the corresponding test status, it indicates that the software under test has completed processing the test data packet. At this time, the test data packet output by the software under test after processing is obtained, and the information content and character length of the preset test information and the test data packet are compared. If they are consistent, it means that the software under test has correctly processed the received message. The segmented test result includes two results: the software under test can correctly process the received message when the test information is returned in segments, and the software under test cannot correctly process the received message when the test information is returned in segments.
[0083] In specific implementations, such as Figure 4As shown, when performing functional testing on the software under test, a virtual interactive serial port is created, the corresponding communication command information is pre-configured, and the serial port parameters are configured. After configuration, a simulation test is executed, and the test failure scenario is verified respectively, that is, to verify whether the software under test can correctly identify error information; the delayed return scenario is verified, that is, to verify whether the software under test can correctly handle delayed return situations; and the segmented return scenario is verified, that is, to verify whether the software under test can correctly handle the received messages when the test information is returned in segments. Finally, the functional testing of the software under test is completed.
[0084] This embodiment, when receiving a test command (first command) from the software under test via the first serial port of the virtual interactive serial port, determines preset error information based on the first command and the communication command information, and then feeds back the preset error information to the software under test via the second serial port of the virtual interactive serial port. When receiving a test command (second command) from the software under test via the first serial port of the virtual interactive serial port, determines a delay time and delay information based on the second command and the communication command information, and then feeds back the delay information to the software under test via the second serial port of the virtual interactive serial port based on the delay time. Through this method, different test information is fed back under different commands, thereby creating different test scenarios and sequentially verifying the various functions of the software under test, ensuring the authenticity, comprehensiveness, and accuracy of the functional verification tests performed on the software under test.
[0085] In addition, refer to Figure 5 The present invention also proposes a functional testing device for testing software, the functional testing device comprising:
[0086] Create module 10 to create a virtual interactive serial port.
[0087] The feedback module 20 is used to determine test information based on the test instruction and communication instruction information when it receives a test instruction sent by the software under test through the first serial port of the virtual interactive serial port, and to feed back the test information to the software under test through the second serial port of the virtual interactive serial port.
[0088] The acquisition module 30 is used to acquire the test status of the software under test when it receives the test information.
[0089] The determination module 40 is used to determine the functional verification result of the software under test based on the test status.
[0090] This embodiment creates a virtual interactive serial port. When a test command sent by the software under test is received through the first serial port of the virtual interactive serial port, test information is determined based on the test command and communication command information. The test information is then fed back to the software under test through the second serial port of the virtual interactive serial port. The test status of the software under test when receiving the test information is obtained. The functional verification result of the software under test is determined based on the test status. Through this method, the virtual interactive serial port is used to receive test commands from the software under test, feed back test information, and obtain the test status of the software under test to determine the functional verification result. This achieves the process of interacting with the test software without the participation of a product or actual equipment, effectively simulating the actual testing scenario of the software, improving the development efficiency of the test software, shortening the debugging cycle of software development, reducing development costs, and providing guidance for subsequent optimization and improvement of the test software. It not only has high control precision but also a wide range of applications.
[0091] In one embodiment, the feedback module 20 is further configured to acquire multiple preset test instructions and preset test information for each preset test instruction;
[0092] Information configuration is performed based on each preset test command and the preset test information of each preset test command to obtain communication command information.
[0093] In one embodiment, the feedback module 20 is further configured to acquire serial port configuration information;
[0094] Configure the virtual interactive serial port according to the serial port configuration information;
[0095] After the virtual interactive serial port is started and the information configuration is completed, the following steps are performed: when a test instruction is received from the software under test through the first serial port of the virtual interactive serial port, the test information is determined according to the test instruction and the communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port;
[0096] Accordingly, when a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port, the test information is determined based on the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port, including:
[0097] When a test instruction sent by the software under test is received through the first serial port of the virtual interactive serial port after information configuration is completed, the test information is determined according to the test instruction and communication instruction information, and the test information is fed back to the software under test through the second serial port of the virtual interactive serial port after information configuration is completed.
[0098] In one embodiment, the feedback module 20 is further configured to, when receiving a test instruction sent by the software under test as a first instruction through the first serial port of the virtual interactive serial port, determine a preset error information based on the first instruction and the communication instruction information, and feed back the preset error information to the software under test through the second serial port of the virtual interactive serial port;
[0099] When the test instruction sent by the software under test is the second instruction received through the first serial port of the virtual interactive serial port, the delay time and delay information are determined according to the second instruction and the communication instruction information, and the delay information is fed back to the software under test through the second serial port of the virtual interactive serial port according to the delay time.
[0100] In one embodiment, the acquisition module 30 is further configured to acquire the error scenario state of the software under test when it receives the test information, when the test instruction is the first instruction;
[0101] When the test instruction is the second instruction, the delay scenario state of the software under test is obtained according to the preset reception time and the test information.
[0102] In one embodiment, the determining module 40 is further configured to obtain the test data packet of the software under test according to the test state when the test instruction is a third instruction;
[0103] Obtain preset test information according to the third instruction;
[0104] The preset test information and the test data packet are compared to determine the comparison result.
[0105] The segmented test results of the software under test are determined based on the comparison results.
[0106] In one embodiment, the determining module 40 is further configured to determine the target inspection status and target inspection function according to the test instruction;
[0107] The target inspection state and the test state are compared to determine the comparison result;
[0108] When the comparison result shows that the target inspection state and the test state are consistent, it is determined that the target inspection function of the software under test has passed the inspection.
[0109] Since this device adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0110] Furthermore, embodiments of the present invention also propose a storage medium storing a functional verification program for test software, wherein when the functional verification program for test software is executed by a processor, it implements the steps of the functional verification method for test software as described above.
[0111] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0112] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0113] In addition, for technical details not described in detail in this embodiment, please refer to the functional verification method of the test software provided in any embodiment of the present invention, which will not be repeated here.
[0114] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0115] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0117] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method of functional verification of testing software, characterized by, The function verification method of the test software comprises the following steps: a virtual interactive serial port is created, the virtual interactive serial port is used for data interaction and is established based on a virtual serial port tool; when a test instruction sent by the to-be-tested software is received through a first serial port of the virtual interactive serial port, test information is determined according to the test instruction and communication instruction information, the test information is fed back to the to-be-tested software through a second serial port of the virtual interactive serial port, the communication instruction information is mapping information of each test instruction and corresponding feedback information of each test instruction configured in a function verification system of the to-be-tested software; a test state of the to-be-tested software when the test information is received is acquired; a function verification result of the to-be-tested software is determined according to the test state.
2. The method of claim 1, wherein the test software is a program for testing a function of a device. Before the step of determining the test information according to the test instruction and the communication instruction information and feeding back the test information to the to-be-tested software through the second serial port of the virtual interactive serial port when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port, the method further comprises the following steps: a plurality of preset test instructions and preset test information of each preset test instruction are acquired; information configuration is performed according to each preset test instruction and the preset test information of each preset test instruction, and the communication instruction information is obtained.
3. The method of claim 1, wherein the test software is a program for testing a function of a device. Before the step of determining the test information according to the test instruction and the communication instruction information and feeding back the test information to the to-be-tested software through the second serial port of the virtual interactive serial port when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port, the method further comprises the following steps: serial port configuration information is acquired; information configuration is performed on the virtual interactive serial port according to the serial port configuration information; the virtual interactive serial port after the information configuration is started, and the step of determining the test information according to the test instruction and the communication instruction information and feeding back the test information to the to-be-tested software through the second serial port of the virtual interactive serial port when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port is executed; correspondingly, the step of determining the test information according to the test instruction and the communication instruction information and feeding back the test information to the to-be-tested software through the second serial port of the virtual interactive serial port when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port comprises the following steps: when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port after the information configuration, the test information is determined according to the test instruction and the communication instruction information, and the test information is fed back to the to-be-tested software through the second serial port of the virtual interactive serial port after the information configuration.
4. The method of claim 1, wherein the test software is a program for testing a function of a device. the step of determining the test information according to the test instruction and the communication instruction information and feeding back the test information to the to-be-tested software through the second serial port of the virtual interactive serial port when the test instruction sent by the to-be-tested software is received through the first serial port of the virtual interactive serial port comprises the following steps: When a test instruction sent by the to-be-tested software is a first instruction received through a first serial port of the virtual interactive serial port, preset error information is determined according to the first instruction and the communication instruction information, and the preset error information is fed back to the to-be-tested software through a second serial port of the virtual interactive serial port; When a test instruction sent by the to-be-tested software is a second instruction received through the first serial port of the virtual interactive serial port, a delay time and delay information are determined according to the second instruction and the communication instruction information, and the delay information is fed back to the to-be-tested software through the second serial port of the virtual interactive serial port according to the delay time.
5. The method of claim 1, wherein the test software is a program for testing a function of a device. The test state of the to-be-tested software when the test information is received is acquired, including: When the test instruction is a first instruction, an error scene state of the to-be-tested software when the test information is received is acquired; When the test instruction is a second instruction, a delay scene state of the to-be-tested software is acquired according to a preset receiving time and the test information.
6. The method of claim 1, wherein the test software is a program for testing a function of a device. The function verification result of the to-be-tested software is determined according to the test state, including: When the test instruction is a third instruction, test data packets of the to-be-tested software are acquired according to the test state; preset test information is acquired according to the third instruction; content comparison is performed on the preset test information and the test data packets to determine a comparison result; a segmented verification result of the to-be-tested software is determined according to the comparison result.
7. The method of claim 1 to 6, wherein The function verification result of the to-be-tested software is determined according to the test state, including: a target verification state and a target verification function are determined according to the test instruction; comparison is performed on the target verification state and the test state to determine a comparison result; when the comparison result is that the target verification state and the test state are consistent, it is determined that the target verification function of the to-be-tested software is verified to pass.
8. A functional verification apparatus for testing software, characterized by comprising: The function verification device of the test software includes: a creation module configured to create a virtual interactive serial port, the virtual interactive serial port being used for data interaction and being established based on a virtual serial port tool; a feedback module configured to, when a test instruction sent by a to-be-tested software is received through a first serial port of the virtual interactive serial port, determine test information according to the test instruction and communication instruction information, and feed back the test information to the to-be-tested software through a second serial port of the virtual interactive serial port, the communication instruction information being mapping information of each test instruction and corresponding feedback information of each test instruction in a function verification system of the to-be-tested software; an acquisition module configured to acquire a test state of the to-be-tested software when the test information is received; a determination module configured to determine a function verification result of the to-be-tested software according to the test state.
9. A functional verification apparatus for testing software, characterized by comprising: The function verification device of the test software includes a memory, a processor, and a function verification program of the test software stored in the memory and capable of running on the processor, the function verification program of the test software being configured to implement the function verification method of the test software according to any one of claims 1 to 7.
10. A storage medium, characterized by The storage medium stores a function verification program of test software, and the function verification program of test software, when executed by the processor, implements the function verification method of test software according to any one of claims 1 to 7.
Citation Information
Patent Citations
DDR chip test method, device and equipment and computer readable storage medium
CN111210864A
Test equipment and test method
CN112752096A
Automatic testing method and device, control machine and automatic testing system
CN114153681A
Module test method and system, storage medium and electronic device
CN114780424A