Search

CN-115168232-B - AUTOSAR platform-based test method and device, electronic equipment and storage medium

CN115168232BCN 115168232 BCN115168232 BCN 115168232BCN-115168232-B

Abstract

The method comprises the steps of obtaining a test text, wherein the test text comprises at least one assertion and at least one function description information, the assertion is used for indicating a predicted execution result corresponding to the function description information of the assertion, determining a target code corresponding to the test text and used for realizing functions indicated by the function description information, generating an executable file according to the target code based on an automatic integrated environment scheduling tool and downloading the executable file to a target singlechip, and automatically running the target singlechip based on a test environment script to obtain a test result, wherein the test result comprises the predicted execution result corresponding to the at least one function description information and an actual execution result. The method and the device can automatically execute the target code to obtain the test result through automatically integrating the environment scheduling tool and the test environment script.

Inventors

  • Zhuang Tianran

Assignees

  • 中汽创智科技有限公司

Dates

Publication Date
20260512
Application Date
20220728

Claims (8)

  1. 1. A test method based on an AUTOSAR platform, the method comprising: Obtaining test text, wherein the test text comprises at least one assertion and at least one function description information, and the assertion is used for indicating a predicted execution result of the function description information corresponding to the assertion; Generating a configuration file and a static code according to the test text, wherein the configuration file represents configuration information of a vehicle electronic control unit, the static code is used for determining an implementation mode of each function description information, and the static code under an AUTOSAR platform is an invariable code; The method comprises the steps of obtaining a configuration code corresponding to a configuration file through a configuration tool, determining an object code according to the configuration code and the static code, wherein the configuration tool is a tool chain of an AUTOSAR platform, and developing the configuration code through a man-machine interaction interface; based on an automatic integrated environment scheduling tool, generating an executable file according to the target code, and downloading the executable file into a target singlechip; and automatically running the target singlechip based on a test environment script to obtain a test result, wherein the test result comprises a predicted execution result and an actual execution result corresponding to at least one piece of function description information.
  2. 2. The method of claim 1, wherein the generating an executable file from the object code comprises: Integrating a test project according to the target code and the test text, wherein the test project can be executed through compiling; compiling the test engineering to generate the executable file.
  3. 3. The method according to claim 1, wherein the obtaining, by a configuration tool, a configuration code corresponding to the configuration file includes: Determining a configuration item of the configuration tool; and generating the configuration code in response to the condition that the configuration item is complete in configuration.
  4. 4. The method of claim 1, wherein the automatically running the target single-chip microcomputer based on the test environment script to obtain a test result comprises: simulating a test environment required by the operation of the target singlechip based on the test environment script; and based on the test environment, automatically operating the target singlechip to obtain the test result.
  5. 5. An AUTOSAR platform-based testing device, comprising: an acquisition module for acquiring test text, wherein the test text comprises at least one assertion and at least one function description information, and the assertion is used for indicating a prediction execution result of the function description information corresponding to the assertion; The code preliminary generation module is used for generating a configuration file and a static code according to the test text, wherein the configuration file represents configuration information of a vehicle electronic control unit, the static code is used for determining an implementation mode of each function description information, and the static code under an AUTOSAR platform is an unchangeable code; The target code sub-module is used for obtaining a configuration code corresponding to the configuration file through a configuration tool, determining a target code according to the configuration code and the static code, wherein the configuration tool is a tool chain of an AUTOSAR platform, and the tool chain develops the configuration code through a man-machine interaction interface; the executable file generation module is used for generating an executable file according to the target code based on an automatic integrated environment scheduling tool and downloading the executable file into a target singlechip; the test module is used for automatically running the target singlechip based on a test environment script to obtain a test result, wherein the test result comprises a predicted execution result and an actual execution result corresponding to at least one piece of function description information.
  6. 6. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the AUTOSAR platform-based testing method of any one of claims 1-4.
  7. 7. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the AUTOSAR-platform-based testing method as set forth in any one of claims 1-4.
  8. 8. A computer program product, characterized in that it comprises a computer program stored in a readable storage medium, from which at least one processor of a computer device reads and executes the computer program, so that the device performs the test method based on the AUTOSAR platform according to any one of claims 1 to 4.

Description

AUTOSAR platform-based test method and device, electronic equipment and storage medium Technical Field The invention relates to the technical field of automobile electronic integrated testing, in particular to a testing method and device based on an AUTOSAR platform, electronic equipment and a storage medium. Background AUTOSAR (Automotive Open System Architecture, automobile open system architecture) is a collaborative development framework of an automobile electronic system commonly participated by global automobile manufacturers, parts suppliers and various research and service institutions, and establishes an open automobile Electronic Control Unit (ECU) standard software architecture. The development of basic software based on an AUTOSAR platform relates to numerous software function requirements and standard definitions, and in the process of integrated test, the number of test cases is huge, so that the number of test cases is doubled, the manual execution of the integrated test is difficult and low in efficiency, and in the development process, the problem is frequent. How to quickly carry out regression test and how to enable a large number of test cases to execute test in an automatic mode and quickly locate problem points is a technical problem to be solved. Disclosure of Invention In order to solve at least one technical problem set forth above, the disclosure provides a test method, a test device, an electronic device and a storage medium based on an AUTOSAR platform. In one aspect, the present disclosure provides a test method based on an AUTOSAR platform, where the method includes: Acquiring test text, wherein the test text comprises at least one assertion and at least one function description information, and the assertion is used for indicating a prediction execution result of the function description information corresponding to the assertion; determining an object code corresponding to the test text, wherein the object code is used for realizing functions indicated by the function description information; based on an automatic integrated environment scheduling tool, generating an executable file according to the target code, and downloading the executable file into the target singlechip; And automatically running the target singlechip based on the test environment script to obtain a test result, wherein the test result comprises a predicted execution result and an actual execution result corresponding to at least one piece of function description information. In an alternative embodiment, generating an executable file from object code includes: Integrating test engineering according to the target code and the test text, wherein the test engineering can be executed through compiling; compiling test engineering to generate an executable file. In an alternative embodiment, determining the object code corresponding to the test text includes: Generating a configuration file and a static code according to the test text, wherein the configuration file represents configuration information of the vehicle electronic control unit, and the static code is used for determining an implementation mode of each function description information; And obtaining the target code according to the configuration file and the static code. In an alternative embodiment, the obtaining the object code according to the configuration file and the static code includes: obtaining a configuration code corresponding to the configuration file through a configuration tool; the object code is determined from the configuration code and the static code. In an alternative embodiment, the obtaining, by a configuration tool, a configuration code corresponding to the configuration file includes: Determining a configuration item of a configuration tool; and generating a configuration code in response to the condition that the configuration item is complete in configuration. In an alternative embodiment, based on the test environment script, automatically running the target singlechip to obtain a test result, including: simulating a test environment required by the operation of the target singlechip based on the test environment script; and automatically operating the target singlechip based on the test environment to obtain a test result. In a second aspect, the present invention further provides a test device based on an AUTOSAR platform, including: The system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring test text, the test text comprises at least one assertion and at least one function description information, and the assertion is used for indicating a prediction execution result of the function description information corresponding to the assertion; the object code determining module is used for determining an object code corresponding to the test text, and the object code is used for realizing the function indicated by each function description i