RTE interface test method and test device, computer storage medium and electronic equipment

By dynamically testing interface type and connection interaction information while connecting RTE interfaces with lower-level components, the problem of static document verification not being able to identify interfaces in dynamic environments is solved, and more comprehensive interface testing is achieved, improving the testing effect.

CN120523734APending Publication Date: 2025-08-22GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510611522.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

In the prior art, the RTE interface test method only passes static document information verification, and cannot confirm the correctness of the interface in a dynamic environment, resulting in great limitations in the test results and the development defects cannot be identified.

Method used

When the RTE interface is connected to the lower-level components, the interface type and connection interaction information are obtained, the functions to be tested and the test code are determined, and the functions to be tested are called based on the test code for dynamic testing, different application scenarios are simulated, and the test results are generated.

Benefits of technology

It realizes the identification of development defects in RTE interface testing in advance, improves the adequacy and effectiveness of the test, ensures that the test environment is consistent with the operating environment, and reduces the fault identification time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120523734A_ABST
    Figure CN120523734A_ABST
Patent Text Reader

Abstract

The invention discloses an RTE interface testing method and device, a computer storage medium and electronic equipment, and the method comprises the steps: obtaining a connection state of an RTE interface; when it is detected that the connection state is a lower-layer connection state, obtaining the interface type of the RTE interface and current connection interaction information; and determining a to-be-tested function and a test code corresponding to the interface type and the current connection interaction information, calling the to-be-tested function based on the test code, and generating a test result of the RTE interface. Therefore, according to the method, under the condition that the RTE interface is connected with the lower-layer component, the to-be-tested function corresponding to the RTE interface is called through the test code, the RTE interface is tested based on the input and output results of the to-be-tested function, development defects of the RTE interface can be recognized in advance, and the development efficiency of the RTE interface is improved. Meanwhile, different application scenes are simulated through dynamic input of the to-be-tested function in the testing process, the testing sufficiency and effectiveness of the RTE interface are considered, and the testing effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of RTE (Run-Time Environment) interface testing, and in particular to an RTE interface testing method, a computer-readable storage medium, an RTE interface testing device, and an electronic device. Background Art

[0002] In the AUTOSAR (AUTomotive Open System Architecture) architecture, the RTE module provides services for communication between upper-layer software components and between upper-layer software components and the underlying layers. The correct mapping relationship of each interface in the RTE module ensures the normal implementation of the integrated system functions.

[0003] Related technologies use static testing to extract interface name information from both the system interface design document and ARXML (AUTOSAR Extensible Markup Language, the extensible markup language used in the automotive open system architecture standard) to create two interface information documents. These two generated interface information documents are then cross-referenced to determine if there are any inconsistencies in the interface information, indirectly confirming the correctness of the RTE interface configuration and completing the RTE interface test. However, document information verification can only determine whether the interface name and call setting relationship are correct, resulting in significant limitations in the test results. Summary of the Invention

[0004] The present application aims to solve, at least to a certain extent, one of the technical problems in the related art. To this end, the first purpose of the present application is to propose an RTE interface testing method, which calls the function to be tested corresponding to the RTE interface through test code when the RTE interface is connected to the lower-level components, and dynamically tests the RTE interface based on the input and output results of the function to be tested. This method can identify development defects of the RTE interface in advance, and at the same time, during the test process, different application scenarios can be simulated by dynamically inputting the function to be tested, taking into account the adequacy and effectiveness of the test of the RTE interface, thereby improving the test effect.

[0005] A second object of the present application is to provide a computer-readable storage medium.

[0006] The third objective of this application is to provide an RTE interface testing device.

[0007] The fourth objective of this application is to provide an electronic device.

[0008] To achieve the above-mentioned purpose, the first embodiment of the present application proposes an RTE interface testing method, including: obtaining the connection status of the RTE interface; when it is detected that the connection status is a lower-layer connection status, obtaining the interface type and current connection interaction information of the RTE interface; determining the function to be tested and the test code corresponding to the interface type and the current connection interaction information, calling the function to be tested based on the test code, and generating the test results of the RTE interface.

[0009] According to the RTE interface testing method of the embodiment of the present application, the connection status of the RTE interface is obtained. When the connection status is detected to be a lower-layer connection status, the interface type and current connection interaction information of the RTE interface are obtained, and the function to be tested and the test code corresponding to the interface type and the current connection interaction information are determined. The function to be tested is called based on the test code to generate the test result of the RTE interface. As a result, when the RTE interface is connected to the lower-layer component, the method calls the function to be tested corresponding to the RTE interface through the test code, and dynamically tests the RTE interface based on the input and output results of the function to be tested. The development defects of the RTE interface can be identified in advance. At the same time, different application scenarios are simulated by dynamic input of the function to be tested during the test process, taking into account the adequacy and effectiveness of the test of the RTE interface, thereby improving the test effect.

[0010] In addition, the RTE interface testing method according to the above embodiment of the present application may also have the following additional technical features:

[0011] According to one embodiment of the present application, a test result of an RTE interface is generated based on calling a function to be tested based on a test code, including: using the test code to call the function to be tested, calibrating the input of preset variables to the function to be tested, and obtaining the observed value of the corresponding output of the function to be tested, and determining the test result of the RTE interface based on the calibrated input value of the preset variable and the observed value.

[0012] According to one embodiment of the present application, the test result of the RTE interface is determined based on the calibrated input value of the preset variable and the observed value, including: when the calibrated input value of the preset variable is consistent with the observed value, determining that the RTE interface test has passed; when the calibrated input value of the preset variable is inconsistent with the observed value, determining that the RTE interface test has failed.

[0013] According to one embodiment of the present application, after determining the function to be tested and the test code corresponding to the interface type and the current connection interaction information, the RTE interface testing method further includes: generating a target code based on the function to be tested and the test code, and completing the call to the function to be tested based on the test code by executing the target code.

[0014] According to one embodiment of the present application, generating target code based on the function to be tested and the test code includes: implanting the function to be tested into the test blank code to generate RTE source code; and implanting the test code into the target call position of the RTE source code to generate target code.

[0015] According to one embodiment of the present application, the test code includes an enable flag, and the RTE interface test method further includes: when the enable flag is at a target level, executing the step of calling the function to be tested based on the test code.

[0016] According to one embodiment of the present application, the RTE interface testing method also includes: when it is detected that the connection status is the upper and lower layer connection status, obtaining the interface type and current connection interaction information of the RTE interface; determining the function to be tested corresponding to the interface type and the current connection interaction information, calling the function to be tested based on the component to be tested connected to the RTE interface, and generating the test result of the RTE interface.

[0017] To achieve the above-mentioned purpose, a second embodiment of the present application proposes a computer-readable storage medium on which an RTE interface test program is stored. When the RTE interface test program is executed by a processor, the above-mentioned RTE interface test method is implemented.

[0018] According to the computer-readable storage medium of the embodiment of the present application, when the RTE interface test program is executed by the processor, the above-mentioned RTE interface test method is implemented. Based on the above-mentioned RTE interface test method, the development defects of the RTE interface can be identified in advance, while taking into account the test adequacy and effectiveness of the RTE interface, thereby improving the test effect.

[0019] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an RTE interface testing device, including: a first acquisition module, used to obtain the connection status of the RTE interface; a second acquisition module, used to obtain the interface type and current connection interaction information of the RTE interface when it is detected that the connection status is a lower-layer connection state; a testing module, used to determine the function to be tested and the test code corresponding to the interface type and the current connection interaction information, call the function to be tested based on the test code, and generate the test result of the RTE interface.

[0020] According to the RTE interface testing device of the embodiment of the present application, the connection status of the RTE interface is obtained through the first acquisition module, and the interface type and current connection interaction information of the RTE interface are obtained through the second acquisition module when the connection status is detected to be the lower-layer connection status. The test module determines the function to be tested and the test code corresponding to the interface type and the current connection interaction information, and calls the function to be tested based on the test code to generate the test result of the RTE interface. As a result, when the RTE interface is connected to the lower-layer component, the device calls the function to be tested corresponding to the RTE interface through the test code, and dynamically tests the RTE interface based on the input and output results of the function to be tested. This can identify development defects of the RTE interface in advance. At the same time, during the test process, different interface application scenarios are preset by dynamically inputting different inputs to the function to be tested, which takes into account the adequacy and effectiveness of the test of the RTE interface and improves the test effect.

[0021] To achieve the above-mentioned purpose, the fourth embodiment of the present application proposes an electronic device, including a memory, a processor, and an RTE interface test program stored in the memory and runnable on the processor. When the processor executes the RTE interface test program, the above-mentioned RTE interface test method is implemented.

[0022] According to the electronic device of the embodiment of the present application, when the processor executes the RTE interface test program, the above-mentioned RTE interface test method is implemented. Based on the above-mentioned RTE interface test method, the development defects of the RTE interface are identified in advance, while taking into account the adequacy and effectiveness of the test of the RTE interface, thereby improving the interface test effect.

[0023] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 Flowchart of the RTE interface testing method according to an embodiment of the present application;

[0025] Figure 2 This is a schematic diagram of an RTE interface test under the AUTOSAR architecture according to a specific embodiment of the present application;

[0026] Figure 3 This is a flowchart of an RTE interface testing method according to a specific embodiment of the present application;

[0027] Figure 4 Schematic diagram of the connection of the RTE interface test device according to an embodiment of the present application;

[0028] Figure 5 Schematic diagram of the connection of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0030] The following describes the RTE interface testing method, computer-readable storage medium, RTE interface testing device, and electronic device proposed in the embodiments of the present application with reference to the accompanying drawings.

[0031] In related technologies, there are two methods for testing RTE interfaces:

[0032] (1) Static method: Extract the interface name information in the interface design document and ARXML respectively to form two interface information documents. The two generated interface information documents are used as references to each other. Whether the RTE interface configuration is correct can be indirectly confirmed by whether there is any inconsistency in the interface information.

[0033] (2) Dynamic method: With the help of software testing (such as software integration and software qualification testing), the test cases involved in the RTE interface are sorted out and tested in a dynamic way.

[0034] However, the document verification used in the static approach is essentially just proofreading the document content, and cannot confirm the code's performance in a dynamic environment. This means that there is a discrepancy between the test environment and the runtime environment for the RTE code. Dynamic methods can ensure consistency between the code test environment and the runtime environment, but they require additional XCP / CCP protocol code and test case design, increasing the workload for relevant personnel and potentially leaving potential bugs (software defects) for testing, which is detrimental to the overall quality and efficiency of software development.

[0035] In order to solve at least one of the above technical problems, the present application proposes an RTE interface testing method. When the RTE interface is connected to the lower-level component, the function to be tested and the test code corresponding to the interface type of the RTE interface and the current connection interaction information are determined, the function to be tested corresponding to the RTE interface is called through the test code, and the RTE interface is dynamically tested based on the input and output results of the function to be tested. The development defects of the RTE interface can be identified in advance, and the development efficiency and quality can be improved. At the same time, during the test process, different application scenarios are simulated by dynamic input of the function to be tested, so that the test environment and the operating environment are consistent, taking into account the adequacy and effectiveness of the test of the RTE interface, and improving the test effect.

[0036] The RTE interface testing method of the present application is described in detail below with reference to the accompanying drawings.

[0037] Figure 1 Flowchart of the RTE interface testing method according to an embodiment of the present application

[0038] like Figure 1 As shown, the RTE interface testing method of the embodiment of the present application includes the following steps:

[0039] S1, obtain the connection status of the RTE interface;

[0040] S2, when detecting that the connection state is a lower layer connection state, obtaining the interface type and current connection interaction information of the RTE interface;

[0041] S3, determining a function to be tested and a test code corresponding to the interface type and the current connection interaction information, calling the function to be tested based on the test code, and generating a test result of the RTE interface.

[0042] Specifically, the connection status of the RTE interface can be obtained through detection or user input, without specific limitation. When the RTE interface is connected only to the lower-layer component, it is in the lower-layer connection state; when the RTE interface is connected to both the upper-layer component and the lower-layer component, it is in the upper-lower-layer connection state. For example, in a system architecture where the vehicle controller is connected to the window module and the engine drive module through the corresponding interfaces of the RTE module, the vehicle controller is the upper-layer component of the RTE interface, and the window module and the engine drive module are the lower-layer components of the RTE interface.

[0043] When the RTE interface is in the lower-layer connection state, the list of interfaces to be tested is obtained through the Arxml file in the system. The list of interfaces to be tested includes the interface type and current connection interaction information of each RTE interface to be tested. The Arxml file is the AutoSAR interface description file, which contains the interface name, call information, partition deployment, formal parameters, and other content. In the AutoSAR architecture, RTE interface types are divided into SR (Sender-Receiver) interface and CS (Client-Server) interface. In the SR interface mode, the sender (Sender) sends data and the receiver (Receiver) receives data. The SR interface is suitable for scenarios with less data transmission and no need for frequent interaction. It has low communication overhead and a simple data transmission mechanism. In the CS interface mode, the client (Client) sends a request to the server (Server), and the server returns the result after processing the request. The CS interface is usually used in scenarios that require frequent interaction. It has the characteristics of strong interactivity, fast response speed, and secure access mode. The current connection interaction information is the communication requirement between the RTE interface and the component. For example, when the RTE interface is an SR interface, the current connection interaction information of the RTE interface is the two-way data interaction setting between the upper and lower layer components and the corresponding interaction parameter information.

[0044] In addition, the component version number of the RTE interface connection can be further determined, and the RTE interface description file matching the component version number can be determined to obtain the interface type of the RTE interface and current connection interaction information.

[0045] The corresponding function to be tested and test code are determined according to the interface type of the RTE interface and the current connection interaction information. The function to be tested of each RTE interface includes a write function and a read function. Taking the window component receiving the speed data of the transmitter component through the RTE interface as an example, the speed data of the engine component is used as the preset variable of the write function and is written through the write function. The write function outputs the intermediate data, and the read function receives the intermediate data and calculates and outputs the corresponding observation data to the window component. When the RTE interface is normal, the observation value is consistent with the value received by the write function, and the window component receives the correct speed data. When the RTE interface is abnormal, the observation value is inconsistent with the value received by the write function, and the window component cannot receive the correct speed data. The test code is used to replace the functions of the upper and lower layer components to implement the call test of the function to be tested.

[0046] By enabling the corresponding test code, you can set maximum, minimum, random, and loop values ​​for the preset variables of the function under test, making the test process more flexible in controlling the test scope and content. In addition, you can flexibly modify global variables based on needs to obtain the observed value of the corresponding output of the function under test to test the RTE interface.

[0047] This embodiment can perform interface testing on the function to be tested of the RTE interface in advance through test code when the RTE interface is only connected to the lower-layer components, which facilitates timely discovery of RTE interface faults and fault handling, reduces fault losses, and the test range of the global variables of the function to be tested can be flexibly set based on requirements to simulate the application environment of the RTE interface, thereby improving the reliability and effectiveness of the interface test results.

[0048] In one embodiment of the present application, a test result of an RTE interface is generated based on calling a function to be tested based on a test code, including: using the test code to call the function to be tested, calibrating the input of preset variables to the function to be tested, and obtaining the observed value of the corresponding output of the function to be tested, and determining the test result of the RTE interface based on the calibrated input value of the preset variable and the observed value.

[0049] Specifically, for example, a vehicle window module acquires the engine assembly's rotational speed via an RTE interface. The RTE interface is used to receive the rotational speed, which serves as a preset variable for the function under test. The input to the preset variable for the function under test can be calibrated based on a preset range. For example, the preset variable being the rotational speed, the calibrated input for the preset variable can include the preset maximum speed value, the preset minimum speed value, and random data outside the preset speed range. The observed values ​​of the function under test based on the input values ​​of the preset variable are then obtained. The calibrated input data for the preset variable is then compared with the corresponding observed values ​​to determine the RTE interface test result.

[0050] In one embodiment of the present application, the test result of the RTE interface is determined based on the calibrated input value of the preset variable and the observed value, including: when the calibrated input value of the preset variable is consistent with the observed value, determining that the RTE interface test has passed; when the calibrated input value of the preset variable is inconsistent with the observed value, determining that the RTE interface test has failed.

[0051] Specifically, taking the function to be tested including the write function functionA and the read function functionB as an example, the RTE interface test process is as follows:

[0052] a. The test code calls function functionA and writes the minimum value minA, the maximum value maxA of the preset variable and the random number randomA within the preset range.

[0053] b. The test code calls functionB, and reads the minimum value minB output by functionB when functionA writes the minimum value minA, the maximum value maxB output by functionB when functionA writes the maximum value maxA, and the random number randomB output by functionB when functionA writes the random number randomA.

[0054] c. If minA=minB, maxA=maxB, and randomA=randomB are all true, then it is determined that the RTE interface test fails; otherwise, the test fails.

[0055] In one embodiment of the present application, after determining the function to be tested and the test code corresponding to the interface type and the current connection interaction information, the RTE interface testing method further includes: generating a target code based on the function to be tested and the test code, and completing the call to the function to be tested based on the test code by executing the target code.

[0056] That is to say, the function to be tested and the test code are embedded in the same code to generate the target code, and the test work is completed by executing the target code, which makes the interface test operation easier to carry out and can complete the test of multiple RTE interfaces at the same time, thereby improving the test efficiency.

[0057] In one embodiment of the present application, generating target code based on the function to be tested and the test code includes: implanting the function to be tested into the test blank code to generate RTE source code; and implanting the test code into the target call position of the RTE source code to generate target code.

[0058] Specifically, combined Figure 2 As shown, after obtaining the list of testable interfaces from the ARXML file, you can determine which interfaces need to be tested. Based on the list of testable interfaces, you can then determine the test functions and test code for each RTE interface. First, use scriptcode to embed the test functions into the blank test code to generate the RTE source code. Scriptcode refers to code written in a scripting language, a lightweight programming language commonly used for automated tasks, system management, web page interaction, and other scenarios. Common scripting languages ​​include Shell, Python, and Perl.

[0059] Then, the test code is implanted into the target call location of the RTE source code to generate the target code, completing the mapping of the RTE interface. The test code is used to call the corresponding function to be tested. The RTE interface, the function to be tested, and the test code have a one-to-one correspondence.

[0060] Based on the target code, we used the buildIDE compilation tool to generate an executable file for the RTE interface test code and burned it to the development board. buildIDE (Integrated Development Environment, IDE) is a software development tool that provides code editing, compilation, and deployment functions. By compiling and burning the generated software version to the development board, we ensure that the code runs in a consistent environment.

[0061] Finally, run the target code on the development board and use scriptdebug to drive an embedded debugger (such as Lauderbach) to start debugging the development board. This calls the preset variables embedded in scriptcode, controls the changes in the calibration values ​​of the preset variables, and observes the observed quantities to compare whether the changes in the calibration and observed quantities are consistent with expectations. scriptdebug is used to drive an embedded debugger (such as Lauderbach) to start debugging the development board, call the preset variables embedded in scriptA, control the changes in the interface calibration values, and observe the observed quantities.

[0062] The test blank code may include multiple implantation locations for implanting the functions to be tested and the test codes corresponding to the RTE interfaces. As the target code is executed, the test of multiple RTE interfaces can be completed at one time, thereby improving the test efficiency.

[0063] In one embodiment of the present application, the test code includes an enable flag, and the RTE interface test method further includes: when the enable flag is at a target level, executing the step of calling the function to be tested based on the test code.

[0064] Specifically, an enable flag is embedded in the test code to meet different test requirements. For example, when the enable flag is set to 1, the function to be tested of the corresponding RTE interface is called and the test of the RTE interface is executed; when the enable flag is set to 0, the function to be tested of the corresponding RTE interface is not called and the test of the RTE interface is not executed.

[0065] This embodiment can control the enable flag bit according to the requirements, thereby executing the corresponding test code and realizing targeted testing of the RTE interface.

[0066] In one embodiment of the present application, the RTE interface testing method also includes: when it is detected that the connection status is the upper and lower layer connection status, obtaining the interface type and current connection interaction information of the RTE interface; determining the function to be tested corresponding to the interface type and the current connection interaction information, calling the function to be tested based on the component to be tested connected to the RTE interface, and generating the test result of the RTE interface.

[0067] Specifically, for example, a vehicle window assembly is connected to a transmitter assembly via an RTE interface, allowing the window assembly to obtain the engine assembly's rotational speed. The window assembly is the upper-level component of the RTE interface, and the engine assembly is the lower-level component. Both the window assembly and the engine assembly are components under test within the RTE interface. Once the RTE interface is connected to both the upper-level and lower-level components, the RTE interface's function under test can be directly called through the corresponding upper-level component, completing the RTE interface test.

[0068] As a specific embodiment of this application, Figure 3 As shown, the RTE interface testing method includes the following steps:

[0069] S101: Obtain a list of interfaces to be tested based on an Arxml file, wherein the list of interfaces to be tested includes the interface type and connection interaction information of each RTE interface.

[0070] S102: Determine the function to be tested and the test code corresponding to each RTE interface according to the list of interfaces to be tested.

[0071] S103: Implant the function to be tested into the test blank code to generate RTE source code.

[0072] S104: Embed the test code into the target call location of the RTE source code to generate the target code.

[0073] S105, by executing the target code, calling the function to be tested based on the test code, calibrating the input of preset variables to the function to be tested, and obtaining the observed value of the corresponding output of the function to be tested.

[0074] S106: Determine whether the calibrated input value of the preset variable is consistent with the observed value. If so, proceed to step S107; if not, proceed to step S108.

[0075] S107, RTE interface test passed.

[0076] S108, RTE interface test failed.

[0077] This embodiment can complete RTE interface verification before system integration compilation, identify development defects in advance, and preset different scenarios (maximum value / minimum value / random value, etc.) based on the idea of ​​designing test cases, taking into account the adequacy and effectiveness of verification, reducing the development and testing workload while ensuring quality.

[0078] In summary, according to the RTE interface testing method of the embodiment of the present application, the connection status of the RTE interface is obtained. When the connection status is detected to be a lower-layer connection status, the interface type and current connection interaction information of the RTE interface are obtained, and the function to be tested and the test code corresponding to the interface type and the current connection interaction information are determined. The function to be tested is called based on the test code to generate the test result of the RTE interface. As a result, when the RTE interface is connected to the lower-layer component, the method calls the function to be tested corresponding to the RTE interface through the test code, and dynamically tests the RTE interface based on the input and output results of the function to be tested. The development defects of the RTE interface can be identified in advance. At the same time, during the test process, different interface application scenarios are preset by dynamically inputting the function to be tested, taking into account the adequacy and effectiveness of the test of the RTE interface, thereby improving the test effect.

[0079] Corresponding to the above embodiment, the present application also proposes a computer-readable storage medium.

[0080] The computer-readable storage medium of the embodiment of the present application stores an RTE interface test program thereon, and when the RTE interface test program is executed by a processor, the RTE interface test method described above is implemented.

[0081] According to the computer-readable storage medium of the embodiment of the present application, when the RTE interface test program is executed by the processor, the above-mentioned RTE interface test method is implemented. Based on the above-mentioned RTE interface test method, the development defects of the RTE interface can be identified in advance, while taking into account the test adequacy and effectiveness of the RTE interface, thereby improving the test effect.

[0082] Corresponding to the above embodiment, the present application also proposes an RTE interface testing device.

[0083] like Figure 4 As shown, the RTE interface testing device of the embodiment of the present application includes: a first acquisition module 10, a second acquisition module 20 and a testing module 30.

[0084] Among them, the first acquisition module 10 is used to obtain the connection status of the RTE interface; the second acquisition module 20 is used to obtain the interface type and current connection interaction information of the RTE interface when it is detected that the connection status is a lower-layer connection status; the test module 30 is used to determine the function to be tested and the test code corresponding to the interface type and the current connection interaction information, and call the function to be tested based on the test code to generate the test results of the RTE interface.

[0085] According to one embodiment of the present application, the test module 30 calls the function to be tested based on the test code and generates the test results of the RTE interface. Specifically, it is used to: use the test code to call the function to be tested, calibrate the input of preset variables to the function to be tested, and obtain the observed value of the corresponding output of the function to be tested, and determine the test results of the RTE interface based on the calibrated input value of the preset variables and the observed value.

[0086] According to one embodiment of the present application, the test module 30 determines the test result of the RTE interface based on the calibrated input value of the preset variable and the observed value, and is specifically used to: when the calibrated input value of the preset variable is consistent with the corresponding observed value, determine that the RTE interface test has passed; when the calibrated input value of the preset variable is inconsistent with the corresponding observed value, determine that the RTE interface test has failed.

[0087] According to one embodiment of the present application, after determining the function to be tested and the test code corresponding to the interface type and the current connection interaction information, the test module 30 is also used to: generate a target code based on the function to be tested and the test code, and complete the call of the function to be tested based on the test code by executing the target code.

[0088] According to one embodiment of the present application, the test module 30 generates target code based on the function to be tested and the test code, specifically for: implanting the function to be tested into the test blank code to generate RTE source code; and implanting the test code into the target call position of the RTE source code to generate target code.

[0089] According to an embodiment of the present application, the test code includes an enable flag, and the test module 30 is further configured to: when the enable flag is at a target level, execute the step of calling the function to be tested based on the test code.

[0090] According to one embodiment of the present application, the second acquisition module 20 is also used to: when it is detected that the connection status is the upper and lower layer connection status, obtain the interface type and current connection interaction information of the RTE interface; the test module 30 is used to determine the function to be tested corresponding to the interface type and the current connection interaction information, call the function to be tested based on the component to be tested connected to the RTE interface, and generate the test result of the RTE interface.

[0091] It should be noted that for details not disclosed in the RTE interface testing device of the embodiment of the present application, please refer to the details disclosed in the RTE interface testing method of the above embodiment of the present application, and the details will not be repeated here.

[0092] According to the RTE interface testing device of the embodiment of the present application, the connection status of the RTE interface is obtained through the first acquisition module, and the interface type and current connection interaction information of the RTE interface are obtained through the second acquisition module when the connection status is detected to be the lower-layer connection status. The test module determines the function to be tested and the test code corresponding to the interface type and the current connection interaction information, and calls the function to be tested based on the test code to generate the test result of the RTE interface. As a result, when the RTE interface is connected to the lower-layer component, the device calls the function to be tested corresponding to the RTE interface through the test code, and dynamically tests the RTE interface based on the input and output results of the function to be tested. This can identify development defects of the RTE interface in advance. At the same time, during the test process, different interface application scenarios are preset by dynamically inputting different inputs to the function to be tested, which takes into account the adequacy and effectiveness of the test of the RTE interface and improves the test effect.

[0093] Corresponding to the above embodiment, the present application also proposes an electronic device.

[0094] like Figure 5 As described above, the electronic device 100 of the embodiment of the present application includes a memory 110, a processor 120, and an RTE interface test program stored in the memory 110 and executable on the processor 120. When the processor 120 executes the RTE interface test program, the above-mentioned RTE interface test method is implemented.

[0095] According to the electronic device of the embodiment of the present application, when the processor executes the RTE interface test program, the above-mentioned RTE interface test method is implemented. Based on the above-mentioned RTE interface test method, the development defects of the RTE interface are identified in advance, while taking into account the adequacy and effectiveness of the test of the RTE interface, thereby improving the test effect.

[0096] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0097] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0098] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0099] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0100] In this application, unless otherwise specified or limited, the terms "installed," "connected," "connect," "fixed," etc. should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.

[0101] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A runtime environment RTE interface testing method, characterized in that: include: Get the connection status of the RTE interface; When detecting that the connection state is a lower layer connection state, obtaining the interface type and current connection interaction information of the RTE interface; Determine a function to be tested and a test code corresponding to the interface type and the current connection interaction information, call the function to be tested based on the test code, and generate a test result of the RTE interface.

2. The RTE interface testing method according to claim 1, wherein: The calling of the function to be tested based on the test code to generate a test result of the RTE interface includes: The test code is used to call the function to be tested, the preset variables are calibrated and input to the function to be tested, and the observation value corresponding to the output of the function to be tested is obtained, and the test result of the RTE interface is determined according to the calibrated input value of the preset variables and the observation value.

3. The RTE interface testing method according to claim 2, wherein: The determining the test result of the RTE interface according to the calibrated input value of the preset variable and the observed value includes: When the calibrated input value of the preset variable is consistent with the observed value, determining that the RTE interface test passes; When the calibrated input value of the preset variable is inconsistent with the observed value, it is determined that the RTE interface test fails.

4. The RTE interface testing method according to claim 1, wherein: After determining the function to be tested and the test code corresponding to the interface type and the current connection interaction information, the method further includes: A target code is generated according to the function to be tested and the test code, and the call of the function to be tested based on the test code is completed by executing the target code.

5. The RTE interface testing method according to claim 4, wherein: Generating target code according to the function to be tested and the test code includes: Implant the function to be tested into a test blank code to generate RTE source code; The test code is implanted into the target call position of the RTE source code to generate the target code.

6. The RTE interface testing method according to claim 1, wherein: The test code includes an enable flag bit, and the method further includes: When the enable flag is at a target level, the step of calling the function to be tested based on the test code is performed.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When detecting that the connection state is an upper and lower layer connection state, obtaining the interface type and current connection interaction information of the RTE interface; A function to be tested corresponding to the interface type and the current connection interaction information is determined, the function to be tested is called based on the component to be tested connected to the RTE interface, and a test result of the RTE interface is generated.

8. A computer-readable storage medium, characterized in that An RTE interface test program is stored thereon, and when the RTE interface test program is executed by a processor, the RTE interface test method according to any one of claims 1 to 7 is implemented.

9. An RTE interface testing device, characterized in that: include: The first acquisition module is used to obtain the connection status of the RTE interface; A second acquisition module is configured to acquire the interface type and current connection interaction information of the RTE interface when detecting that the connection state is a lower layer connection state; The test module is used to determine the function to be tested and the test code corresponding to the interface type and the current connection interaction information, call the function to be tested based on the test code, and generate a test result of the RTE interface.

10. An electronic device, characterized in that: The invention comprises a memory, a processor and an RTE interface test program stored in the memory and runnable on the processor. When the processor executes the RTE interface test program, the RTE interface test method according to any one of claims 1 to 7 is implemented.