Interface testing method and interface testing system

Compilation and debugging tools run binary files in a simulated test environment to obtain interface test results, which solves the problem of low efficiency of existing interface tests and inability to meet the requirements of ISO 26262, and achieves efficient and accurate interface tests that comply with functional safety standards.

CN118760588APending Publication Date: 2024-10-11BLACK SESAME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410823000.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing interface testing methods are inefficient and prone to errors. They cannot meet the requirements of ISO 26262 functional safety integration testing and require changes to the source code of the software under test.

Method used

Generate binary files through compilation tools, and use software debugging tools to run debugging instructions in a simulated test environment to obtain interface test results, including function coverage and function call coverage, without manual statistics and avoiding adding print statements in the source code. needs.

Benefits of technology

It achieves efficient and accurate acquisition of interface test results, meets ISO 26262 functional safety integration test requirements, reduces the difficulty of test case design, and eliminates the need for additional tool confidence assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760588A_ABST
    Figure CN118760588A_ABST
Patent Text Reader

Abstract

The invention discloses an interface testing method and an interface testing system. The method comprises the following steps: compiling tested software by utilizing a compiling tool to obtain a binary file; a software debugging tool is utilized to call a required script file, the script file comprises a debugging instruction corresponding to the interface test, and the debugging instruction is sent to the simulation test environment; running the binary file in the simulation test environment; and obtaining a test result by using a software debugging tool after the binary file finishes running. By means of the steps, manual statistics of test results is not needed, the method is more accurate and efficient, printing statements do not need to be added in source codes of the tested software, the source codes do not need to be changed, confidence evaluation of the test codes does not need to be conducted, and therefore the ISO 26262 function security integration test requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of interface testing, and in particular to an interface testing method and an interface testing system. Background Art

[0002] Interface testing is a necessary testing link in the process of software integration testing. In the related art, one way is that in the process of testing the target interface in the software under test, the tester usually writes the test code for the target interface, and then performs interface testing on the corresponding target interface based on the written test code. However, the above-mentioned interface testing method requires manual statistics of the test results, which is inefficient and prone to errors, and cannot meet the basic requirements of ISO (International Organization for Standardization) 26262-Functional safety of road vehicles (for the sake of ease of description, ISO 26262-Functional safety of road vehicles, referred to as ISO 26262)-part6 (i.e., software-level product development, (Product development at the software level) in the integration testing stage. Another way is to add a print statement of a debugging nature to the source code of the target interface in the software under test, and test it by printing the log. However, this method requires changing the object under test, and therefore cannot meet the ISO 26262 functional safety integration test requirements.

[0003] In view of this, how to implement the software interface testing method to make it meet the functional safety integration testing requirements has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides an interface testing method and an interface testing system for implementing interface testing that meets functional safety integration testing requirements.

[0005] In a first aspect, the present application provides an interface testing method. The method comprises:

[0006] Use the compilation tool to compile the software under test to obtain a binary file;

[0007] Using a software debugging tool to call a required script file, the script file includes debugging instructions corresponding to the interface test, and sending the debugging instructions to the simulation test environment;

[0008] Running the binary file in the simulated test environment;

[0009] The software debugging tool is used to obtain the test result after the binary file is run.

[0010] As a possible implementation, the debugging instruction includes: a debugging instruction indicating a statistical coverage rate;

[0011] The test result includes: function coverage and / or function call coverage of the target interface.

[0012] As a possible implementation manner, the method further includes:

[0013] Utilizing a software debugging tool to insert a stub into the software under test, wherein the inserting a stub comprises setting a stub function for a target interface in the software under test;

[0014] The method of using a compilation tool to compile the software under test to obtain a binary file includes:

[0015] Use the compilation tool to compile the software under test after the instrumentation to obtain a binary file.

[0016] As a possible implementation manner, the target interface is an interface at a lower level than the interface called by the interface to be counted, and the target interface has a different name from the interface at a higher level.

[0017] As a possible implementation manner, the step of inserting a target interface of the software under test includes:

[0018] Each interface in the tested software is used as an interface to be counted, and the target interface is instrumented using a software debugging tool.

[0019] As a possible implementation manner, the method further includes:

[0020] Output a test report, wherein the test report includes: the test case, the debugging instruction and the test result.

[0021] As a possible implementation manner, the software debugging tool, the compilation tool and the simulation test environment are set on the same host.

[0022] As a possible implementation manner, the simulation test environment includes a simulator corresponding to the software debugging tool.

[0023] As a possible implementation manner, the software debugging tool is VectorCAST / C++, the compilation tool is ArmClang, and the simulator corresponding to the software debugging tool is the Trace32 simulator.

[0024] In a second aspect, the present application provides an interface testing system, the system comprising:

[0025] A compilation tool, configured to compile the software under test to obtain a binary file;

[0026] The software debugging tool is configured to call the script file required by it, the script file includes the debugging instructions corresponding to the interface test, and send the debugging instructions to the simulation test environment; obtain the test results after the binary file runs;

[0027] A simulated test environment is configured to run the binary file thereon.

[0028] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0029] In a fourth aspect, the present application provides an electronic device, including:

[0030] one or more processors; and

[0031] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the first aspects above.

[0032] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0033] 1) Compile the software under test using a compilation tool to obtain a binary file; use a software debugging tool to call the script file required by it, the script file includes debugging instructions corresponding to the interface test, and send the debugging instructions to the simulation test environment; run the binary file in the simulation test environment; use the software debugging tool to obtain the test results after the binary file runs, without the need for manual statistics of the test results, which is more accurate and efficient. In addition, this method does not need to add print statements in the source code of the software under test, does not change the source code, and does not need to perform confidence assessment of the test code, so it meets the ISO 26262 functional safety integration test requirements.

[0034] 2) The software debugging tools, compilation tools and simulators in this application can respectively adopt VectorCAST / C++, ArmClang, and Trace32 simulators. VectorCAST / C++, ArmClang, and Trace32 simulators have all passed ISO26262 certification and do not require additional tool confidence assessment, further meeting the ISO 26262 functional safety integration test requirements.

[0035] 3) Through this application, the function coverage and / or function call coverage of the tested software can be intuitively obtained, so that the tester can obtain quantitative and accurate test results.

[0036] 4) When using software debugging tools to instrument the software under test, you only need to consider the relationship between the interface under test and its calling interface, without considering other calling relationships. Therefore, before performing interface testing, when designing test cases, you only need to design test cases that can test the relationship between the interface under test and its calling interface, without considering the entire calling chain, which reduces the difficulty of test case design.

[0037] Of course, any product implementing the present application does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A system architecture diagram applicable to the embodiments of the present application;

[0040] Figure 2 A flowchart of an interface testing method provided in an embodiment of the present application;

[0041] Figure 3a A schematic diagram of a coverage statistics type selection interface provided in an embodiment of the present application;

[0042] Figure 3b A schematic diagram of a tested software selection interface provided in an embodiment of the present application;

[0043] Figure 3c A schematic diagram of the execution of an interface test case provided in an embodiment of the present application;

[0044] Figure 3d A schematic diagram showing that all interface test cases provided in the embodiment of the present application have been run successfully;

[0045] Figure 3e A schematic diagram of a test report provided for an embodiment of the present application;

[0046] Figure 4 A schematic diagram of the function call relationship provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0048] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0049] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0050] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0051] Currently, there are two ways to perform interface testing:

[0052] The first method is to write a specific test program for the target interface in the software under test and make an actual call. Through basic test methods such as the boundary value method and the equivalence class method, a variety of combinations of incoming parameters are designed to check the correctness of parameter transmission of the interface under test, the correctness of function implementation, the correctness of output results, and the integrity and rationality of fault-tolerant processing of various abnormal situations. However, this method has great limitations. First, this method requires manual statistics of test results (such as function coverage and function call coverage), which is prone to errors and has low statistical efficiency, and does not meet the requirements of ISO 26262 functional safety integration testing; secondly, the software under test is highly coupled (many call branches), and the design of the test program requires a lot of manpower; thirdly, a system may have many hierarchical structures. If each interface is tested separately, a corresponding test program needs to be written for each interface for testing, which consumes a lot of time and manpower.

[0053] The second method is to add debugging print statements to the source code of the target interface in the software under test, and perform testing by printing logs. However, this method has great limitations. First, the source code can only run one branch at a time, and the tested interfaces of other branches may not be covered; second, this method requires changing the object under test, so it cannot meet the ISO 26262 functional safety integration test requirements. Furthermore, the logs printed out by the source code run contain a lot of content, and it is time-consuming, laborious and error-prone to select the corresponding supporting materials; finally, this method requires manual statistical test results (such as function coverage and function call coverage), which is prone to errors and has low statistical efficiency, and does not meet the ISO 26262 functional safety integration test requirements.

[0054] In view of this, the present application provides an interface testing method. In order to facilitate the understanding of the present application, the system architecture on which the present application is based is first described. Figure 1 An exemplary system architecture 100 to which embodiments of the present application can be applied is shown. Figure 1 As shown in , the system architecture 100 may include: software debugging tools, compilation tools and simulation test environment. In some embodiments, the software debugging tools, compilation tools and simulation test environment are set on the same host. The host can be a PC (Personal Computer) or a host device such as a laptop computer.

[0055] The compilation tool is used to compile the software under test to obtain a binary file.

[0056] The software debugging tool is used to call the script file it needs, which includes debugging instructions corresponding to the interface test, and send the debugging instructions to the simulation test environment; obtain the test results after the binary file runs.

[0057] A simulated test environment on which binaries can be run.

[0058] In some embodiments, the compilation tool may be ArmClang. Among them, ArmClang is a C and C++ compiler designed for the Arm architecture. It can compile the software under test into machine code that can run on an Arm processor. In an embodiment of the present application, ArmClang can compile the software under test to obtain a binary file.

[0059] In some embodiments, the software debugging tool may be VectorCAST / C++. Among them, VectorCAST / C++ is an automated testing and code coverage statistics tool for C++ applications. In an embodiment of the present application, VectorCAST / C++ is used to call the required script file, and the script file includes debugging instructions corresponding to the interface test, and sends debugging instructions to the simulation test environment, and can also obtain test results after the binary file runs. In addition, the software debugging tool can also be implemented in other ways, such as c++test, etc. As long as the implementation method is within the spirit and principles of this application, it is within the protection scope of this application.

[0060] In some embodiments, the simulation test environment may include a simulator corresponding to the software debugging tool. The simulator may be a Trace32 simulator. Among them, the Trace32 simulator can simulate the simulation environment required for the binary file to run. In an embodiment of the present application, the binary file can be directly run on the Trace32 simulator. In addition, the simulation test environment can also be implemented in other ways, such as a virtual machine, etc., as long as the implementation method is within the spirit and principles of the present application, it is within the protection scope of the present application.

[0061] It should be noted that the aforementioned VectorCAST / C++, ArmClang and Trace32 simulators have all passed the ISO26262 functional safety certification and met the requirements of TCL3 (Too l Conf idence Level, tool confidence level), and no additional tool confidence level assessment is required.

[0062] It should be understood that Figure 1 The software debugging tools, compiling tools and simulators in the embodiment are only illustrative. According to the implementation requirements, there may be any number of software debugging tools, compiling tools and simulators.

[0063] Figure 2 A flowchart of an interface testing method provided in an embodiment of the present application, the method can be Figure 1 The system shown in the figure is installed and runs with software debugging tools, compilation tools and simulation test environment, such as Figure 2 As shown in , the method may include the following steps:

[0064] Step 201: Use a compilation tool to compile the software under test to obtain a binary file.

[0065] Step 203: using the software debugging tool to call the required script file, the script file includes the debugging instructions corresponding to the interface test, and sending the debugging instructions to the simulation test environment.

[0066] Step 205: Run the binary file in the simulation test environment.

[0067] Step 207: Utilize the software debugging tool to obtain the test result after the binary file is finished running.

[0068] Among them, the embodiment of the present application uses a compilation tool to compile the software under test to obtain a binary file; uses a software debugging tool to call the script file required by it, and the script file includes debugging instructions corresponding to the interface test, and sends the debugging instructions to the simulation test environment; runs the binary file in the simulation test environment; uses the software debugging tool to obtain the test results after the binary file runs, without the need for manual statistics of the test results, which is more accurate and efficient. In addition, this method does not need to add print statements in the source code, will not change the source code, and does not need to perform confidence assessment of the test code, so it meets the ISO 26262 functional safety integration test requirements.

[0069] The following is a summary of the embodiments of the present invention. Figure 2 Each step in the flowchart shown and the effects that can be further produced are described in detail.

[0070] The above step 201, namely "compiling the software under test using a compilation tool to obtain a binary file", is described in detail below in conjunction with an embodiment.

[0071] In some embodiments, since ArmClang has passed the ISO 26262 functional safety integration test requirements and meets the TCL3 tool confidence requirements, the compilation tool can use ArmClang without the need for additional tool confidence evaluation.

[0072] To give a specific example, you can query the product major version information Product: Arm Development Studio GoldEdition 2022.0, product minor version information Component: Arm Compiler for Embedded FuSa 6.16.2, tool name Tool: armclang[5e007d00] through version query instructions such as root@u-Vostro-3671:~#armclang--version. This embodiment of the application verifies that the compilation environment is ready by querying the product major version information, product minor version information, and tool name.

[0073] As a possible implementation method, in an embodiment of the present application, ArmClang is used to compile the software under test to obtain a binary file.

[0074] It should be noted that, before executing step 203, the software under test can be plugged with a software debugging tool, and the plugging includes setting a pile function to the target interface of the software under test. Then, the software under test after the plugging is compiled using a compilation tool to obtain a binary file. The target interface is a next-level interface of the interface called by the interface to be counted, and the target interface has a different name from the interface above it.

[0075] In some embodiments, each interface in the software under test is used as an interface to be counted, and a stub function is set for the target interface in the software under test using a software debugging tool.

[0076] In certain embodiments, the interface to be counted can be the interface between the internal modules of the tested software, or can be the interface that the tested software interacts with an external system. When needs statistics are needed to be counted the calling relationship between the interface to be counted and the interface called by it, the target interface of the tested software can be provided with a pile function.

[0077] Specifically, each interface in the tested software (interface between the tested software internal module, or the interface that tested software and external system are interactive) is as the interface for statistics, the realization that the target interface that needs to set pile function in the tested software is replaced with pile function, so that can be counted when target interface is called.When program execution arrives the code relevant to target interface, the software debugging tool can automatically jump in the pile function.

[0078] In one example, a hook function can be set for a target interface in the software under test through a software debugging tool. When the program executes to the target interface, it will jump to the hook function for execution, thereby replacing the original target interface implementation.

[0079] In another example, a custom code is injected into the memory space of the software under test through a software debugging tool. This code can be used as a stub function to replace the original target interface implementation.

[0080] In addition, other methods can be used to set stub functions for the target interface in the tested software using software debugging tools. As long as the implementation method is within the spirit and principles of this application, it is within the protection scope of this application.

[0081] It is understandable that, when performing interface testing, the embodiment of the present application only needs to consider the relationship between the current interface to be counted and its calling interface, without considering other calling relationships. Therefore, before the interface test, when designing test cases, it is only necessary to design test cases that can test the relationship between the interface to be counted and its calling interface, which reduces the difficulty of test case design.

[0082] As a possible implementation method, in an embodiment of the present application, each interface in the software under test is used as an interface to be counted, and VectorCAST / C++ is used to set a stub function for the target interface in the software under test.

[0083] The above step 203, i.e., "using a software debugging tool to call a required script file, wherein the script file includes debugging instructions corresponding to the interface test, and sending the debugging instructions to the simulation test environment" is described in detail below in conjunction with an embodiment.

[0084] In some embodiments, since VectorCAST / C++ has passed the ISO 26262 functional safety integration test requirements and meets the TCL3 tool confidence requirements, in the embodiments of the present application, the software debugging tool can use VectorCAST / C++ without the need for additional tool confidence assessment.

[0085] In some embodiments, the simulation test environment may include a simulator corresponding to the software debugging tool. Since the Trace32 simulator can simulate the simulation environment required for the binary file to run, and the Trace32 simulator has passed the ISO 26262 functional safety integration test requirements and meets the TCL3 tool confidence requirements, in the embodiments of the present application, the simulator can be a Trace32 simulator, and no additional tool confidence assessment is required. In addition, the simulation test environment can also be implemented in other ways, such as a virtual machine, etc. As long as the implementation method is within the spirit and principles of this application, it is within the scope of protection of this application.

[0086] It should be noted that since the Trace32 simulator simulates a bare board environment without an operating system (OS), it has passed the ISO 26262 functional safety integration test requirements and meets the TCL3 tool confidence requirements, and the binary files compiled by ArmClang cannot run in virtual machines such as qemu. Therefore, in the embodiments of the present application, the preferred simulator is the Trace32 simulator.

[0087] As a possible implementation method, in an embodiment of the present application, VectorCAST / C++ is used to call the required script file, which includes debugging instructions corresponding to the interface test and sends the debugging instructions to the Trace32 simulator.

[0088] In some embodiments, the debugging instruction may include: a debugging instruction indicating statistical coverage.

[0089] The above step 205, namely "running the binary file in the simulated test environment", is described in detail below in conjunction with the embodiments.

[0090] The command for viewing the script file that VectorCAST / C++ calls the Trace32 simulator to run the binary file can be, for example: root@u-Vostro-3671:~ / vcast / SupportFiles#cat. / psocScriptedBuffer.sh.

[0091] The above step 207, namely "obtaining the test result after the binary file is run by using the software debugging tool", is described in detail below in conjunction with an embodiment.

[0092] In some embodiments, Figure 3a As shown in the figure, selecting function coverage statistics and function call coverage statistics needs to meet the ASIL C / D functional safety level. Figure 3b As shown, select the C file in the software under test (i.e. Figure 3b Then create a test project. Use VectorCAST / C++ to get the test results after the binary file runs.

[0093] In some embodiments, the test results include: function coverage and / or function call coverage of the tested software. Therefore, the embodiment of the present application does not need to manually count function coverage and function call coverage, which reduces the probability of error and improves statistical efficiency.

[0094] In some embodiments, a test report is output, and the test report includes: test cases, debugging instructions, and test results. Exemplarily, the test report is presented to the user in HTML format or PDF format. The user can intuitively see the test results (such as function call rate and / or function call coverage) through the test report, without the need for manual statistics of test results, thereby improving statistical efficiency and being less prone to errors.

[0095] It should be noted that, in the embodiment of the present application, an interface test case is designed for the target interface to be tested according to the design document. Figure 3c As shown in the figure, a check mark next to an interface test case indicates that the interface test case has passed the test.

[0096] It is also necessary to explain that the interface test cases of each component are put into a test environment to run and export the test report. Figure 3d As shown in the figure, all interface test cases have passed. F stands for function coverage and FC stands for function call coverage. It should be noted that the component includes a large function point, which requires multiple interfaces to implement. Figure 3eThe figure shows the exported test report. The test report indicates that for all interfaces (INTERFACE_ALL), the report creation date, the report creation time, and 797 test cases (Testcases) all passed (797 / 797PASS), the overall expected (Expected) passed (the expected number of passed / the total expected number, i.e. (2564 / 2564PASS)), all passed (2564 / 2564PASS), the function coverage (Function Coverage) is 100%, and the function call coverage (Function CallCoverage) is 100%.

[0097] It should be noted that for the VectorCAST / C++ software debugging tool, the stub function takes effect globally after being checked, so the following ideas are used to design interface test cases.

[0098] First, for the interfaces to be counted in the software under test, test cases need to be designed to cover them;

[0099] Secondly, no test cases can be designed for target interfaces that are only called in the software under test but do not call other interfaces (i.e. at the end of the call chain);

[0100] Furthermore, the purpose of the test is to verify the calling behavior of the interface to be counted, so the interface directly called by the interface to be counted as the test entry cannot be tested by setting a stub function;

[0101] Finally, in order to reduce the difficulty of designing test cases, the subsequent interface calls within the interface to be counted as the test entry can be tested by setting stub functions.

[0102] For example, Figure 4 The calling hierarchy relationship between the interfaces in the software to be tested. The first layer testA() is used as the test entry and can call the second layer testA1(), testA2() and testA3(). All interfaces in the second layer are prohibited from stub testing. The second layer testA1() can call the third layer testA11(), testA12() and testA13(). testA2() can call the third layer testA21(), testA22() and testA23(). testA3() can call the third layer testA31(), testA32() and testA2(). The third layer interface can be stub tested, but because the third layer testA2() has the same name as the second layer testA2(), the third layer testA2() cannot be stub tested.

[0103] Based on the above embodiments, Figure 1 The functions of each part in the system shown are summarized as follows:

[0104] The compilation tool is used to compile the software under test to obtain a binary file.

[0105] The software debugging tool is used to call the script file it needs, which includes debugging instructions corresponding to the interface test, and sends the debugging instructions to the simulation test environment; and obtains the test results after the binary file is run.

[0106] A simulated test environment is used to run the binary file thereon.

[0107] As a possible implementation, the debugging instruction includes: a debugging instruction indicating a statistical coverage rate;

[0108] The test result includes: function coverage and / or function call coverage of the target interface.

[0109] As a possible implementation manner, the method further includes:

[0110] Utilizing a software debugging tool to insert a stub into the software under test, wherein the inserting a stub comprises setting a stub function for a target interface in the software under test;

[0111] The method of using a compilation tool to compile the software under test to obtain a binary file includes:

[0112] Use the compilation tool to compile the software under test after the instrumentation to obtain a binary file.

[0113] As a possible implementation manner, the target interface is an interface at a lower level than the interface called by the interface to be counted, and the target interface has a different name from the interface at a higher level.

[0114] As a possible implementation manner, the step of inserting a target interface of the software under test includes:

[0115] Each interface in the tested software is used as an interface to be counted, and the target interface is instrumented using a software debugging tool.

[0116] As a possible implementation manner, the method further includes:

[0117] Output a test report, wherein the test report includes: the test case, the debugging instruction and the test result.

[0118] As a possible implementation manner, the software debugging tool, the compilation tool and the simulation test environment are set on the same host.

[0119] As a possible implementation manner, the simulation test environment includes a simulator corresponding to the software debugging tool.

[0120] As a possible implementation manner, the software debugging tool is VectorCAST / C++, the compilation tool is ArmClang, and the simulator corresponding to the software debugging tool is the Trace32 simulator.

[0121] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0123] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a computer program product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0124] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. An interface testing method, characterized in that: The method comprises: Use the compilation tool to compile the software under test to obtain a binary file; Using a software debugging tool to call a required script file, the script file includes debugging instructions corresponding to the interface test, and sending the debugging instructions to the simulation test environment; Running the binary file in the simulated test environment; The software debugging tool is used to obtain the test result after the binary file is run.

2. The method according to claim 1, characterized in that The debugging instructions include: debugging instructions indicating statistical coverage; The test result includes: function coverage and / or function call coverage of the tested software.

3. The method according to claim 1, characterized in that The method further comprises: Utilizing a software debugging tool to insert a stub into the software under test, wherein the inserting a stub comprises setting a stub function for a target interface in the software under test; The method of using a compilation tool to compile the software under test to obtain a binary file includes: Use the compilation tool to compile the software under test after the instrumentation to obtain a binary file.

4. The method according to claim 3, characterized in that The target interface is an interface at a lower level than the interface called by the interface to be counted, and the target interface has a different name from the interface at the higher level.

5. The method according to claim 4, characterized in that The target interface in the software under test is provided with a stub function, comprising: Each interface in the tested software is used as an interface to be counted, and a stub function is set for the target interface in the tested software using a software debugging tool.

6. The method according to claim 1, characterized in that The method further comprises: Output a test report, wherein the test report includes: the test case, the debugging instruction and the test result.

7. The method according to any one of claims 1 to 6, characterized in that The software debugging tool, the compilation tool and the simulation test environment are arranged on the same host.

8. The method according to claim 7, characterized in that The simulation test environment includes a simulator corresponding to the software debugging tool.

9. The method according to claim 8, characterized in that The software debugging tool is VectorCAST / C++, the compilation tool is ArmClang, and the simulator corresponding to the software debugging tool is the Trace32 simulator.

10. An interface testing system, characterized in that: The system comprises: A compilation tool, configured to compile the software under test to obtain a binary file; The software debugging tool is configured to call the script file required by it, the script file includes the debugging instructions corresponding to the interface test, and send the debugging instructions to the simulation test environment; obtain the test results after the binary file runs; A simulated test environment is configured to run the binary file thereon.