CN111162972B - Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis - Google Patents

Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis Download PDF

Info

Publication number
CN111162972B
CN111162972B CN201911412584.2A CN201911412584A CN111162972B CN 111162972 B CN111162972 B CN 111162972B CN 201911412584 A CN201911412584 A CN 201911412584A CN 111162972 B CN111162972 B CN 111162972B
Authority
CN
China
Prior art keywords
test
code
analysis
protocol stack
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911412584.2A
Other languages
Chinese (zh)
Other versions
CN111162972A (en
Inventor
邵俊
卢玉斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yangzhou Hangsheng Technology Co ltd
Original Assignee
Yangzhou Hangsheng Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yangzhou Hangsheng Technology Co ltd filed Critical Yangzhou Hangsheng Technology Co ltd
Priority to CN201911412584.2A priority Critical patent/CN111162972B/en
Publication of CN111162972A publication Critical patent/CN111162972A/en
Application granted granted Critical
Publication of CN111162972B publication Critical patent/CN111162972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a vehicle-mounted Ethernet protocol stack automatic test method based on semantic analysis, which comprises the following steps: step 1), injecting a vehicle-mounted Ethernet protocol stack interface code into a source code analysis module for analysis to generate a grammar tree; step 2) sending the grammar tree into a test code generation module for analysis to generate a test code; step 3) sending the test codes to a test code compiling module, compiling corresponding test program files according to the types of the platforms, transferring the test program files adapting to different platforms to a program deployment and operation control module, and testing a protocol stack through the program deployment and operation control module; the reliability of the software is ensured.

Description

Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis
Technical Field
The invention relates to a vehicle-mounted Ethernet protocol stack testing method, in particular to a vehicle-mounted Ethernet protocol stack automatic testing method based on semantic analysis.
Background
In recent years, with the application of technologies such as internet of vehicles, unmanned, 5G, V X and the like in the vehicle-mounted field, automobiles not only meet the travel requirements of people, but also develop towards digitization, informatization and entertainment. The traditional in-vehicle bus CAN bus in the vehicle-mounted bus architecture is not capable of meeting the high-concurrency network demand of big data. The vehicle bus architecture is in urgent need of a new bus to meet the information exchange requirement in the vehicle. The on-board ethernet is then emerging.
In our daily life, a computer is plugged into a network cable to surf the internet, and a standard Ethernet is used, wherein the Ethernet is used as a physical connection medium, and a software protocol stack is required to be constructed on the Ethernet. In-vehicle ethernet, like a standard protocol stack, also requires a software protocol stack to be built on top of it so that the application layer can conveniently use ethernet technology. Unlike conventional ethernet, on-board system buses have stringent requirements for the effectiveness of messaging, the time consumed for messaging, and the time for message response. These differences also place higher demands on the test method of the on-board system bus. The functional test and the performance test of the software are highly expected to have a convenient, easy-to-use, quick and accurate vehicle-mounted Ethernet test method.
Conventional software testing typically implements software functionality testing manually or semi-manually, while software performance testing is typically a rough test through process monitoring. The function and performance test of the vehicle-mounted Ethernet protocol stack is generally carried out on the protocol stack interface by manually writing test cases, and when the requirements are changed, the test cases are required to be rewritten, so that time and labor are wasted, and human errors are easily introduced.
Disclosure of Invention
The invention aims to provide a vehicle-mounted Ethernet protocol stack automatic test method based on semantic analysis, which ensures that the whole test process does not need manual intervention, ensures the rapid iteration of software development and reduces human errors.
The purpose of the invention is realized in the following way: a vehicle-mounted Ethernet protocol stack automatic test method based on semantic analysis comprises the following steps:
step 1), injecting a vehicle-mounted Ethernet protocol stack interface code into a source code analysis module for analysis to generate a grammar tree;
step 2) sending the grammar tree into a test code generation module for analysis to generate a test code;
and 3) transmitting the test codes to a test code compiling module, compiling corresponding test program files according to the types of the platforms, transmitting the test program files adapting to different platforms to a program deployment and operation control module, and testing a protocol stack through the program deployment and operation control module.
As a further limitation of the present invention, the source code analysis module in step 1) analyzes the lexical, grammatical and semantic of the source code to generate a grammar tree containing function names, parameters and structures.
As a further definition of the present invention, the test code generation module in step 2) specifically includes:
step 2-1) interface data structure analysis; obtaining interface data types of the grammar tree, generating call reply data content according to the data types, generating a data structure for expanding function parameters when the call reply data content is expanded until the types are POD types, then reading test metadata in a test database, generating type examples, and assigning the metadata to the examples; if the data of the target data type is required to be specified, a default value can be declared and filled in the database;
step 2-2) interface function analysis; acquiring interface function names of a grammar tree, determining function actions by analyzing the interface functions, generating a calling relation frame code according to the calling relation analysis of the function names, and determining the content of the generated code according to the difference of the function actions;
step 2-3) the test program source code collects the test interface parameters in step 2-1) and the test code frame in step 2-2), generates the test program source code, and inserts the test process monitoring code into the test code; the monitoring code refers to the process, time and content of function call when the program runs, and can be used for testing user analysis; the brief summary test code generating module is used for obtaining function names and function parameters, reading a test database, inserting operation monitoring codes and finally generating the test codes.
As a further limitation of the present invention, the embedded scenarios of the control module deployed and run by the program in step 3) are: ssh telnet control, scp program deployment, adb installation deployment.
As a further limitation of the present invention, the method further includes the step 4) that the running process information is sent to the test report generating module to generate a test report, the test report generating module is used for collecting the tested information and arranging the report according to the information time stamp; and finally, generating a test report according to a certain format.
Compared with the prior art, the invention has the beneficial effects that: the full-automatic process ensures that the test of the interface of the vehicle-mounted Ethernet protocol stack is completed efficiently, rapidly and accurately, so that the human resource investment in the software test is greatly reduced, and the interference of human factors is reduced; the reliability of the software is ensured.
Drawings
FIG. 1 is a flow chart of the present invention.
FIG. 2 is a flow chart of source code analysis according to the present invention.
FIG. 3 is a flow chart of test code generation in the present invention.
FIG. 4 is a schematic diagram of an embodiment of the present invention.
FIG. 5 is a timing diagram of a test call in accordance with the present invention.
FIG. 6 is a timing diagram of event triggering in accordance with the present invention.
Detailed Description
The automatic test method of the vehicle-mounted Ethernet protocol stack based on semantic analysis as shown in the figures 1-3 comprises the following steps:
step 1), injecting a vehicle-mounted Ethernet protocol stack interface code into a source code analysis module for analysis, wherein the source code analysis module analyzes the lexical, grammatical and semantic of the source code to generate a grammar tree containing function names, parameters and structures;
step 2) sending the grammar tree into a test code generation module for analysis to generate a test code, which specifically comprises the following steps:
step 2-1) interface data structure analysis; obtaining interface data types of the grammar tree, generating call reply data content according to the data types, generating a data structure for expanding function parameters when the call reply data content is expanded until the types are POD types, then reading test metadata in a test database, generating type examples, and assigning the metadata to the examples; if the data of the target data type is required to be specified, a default value can be declared and filled in the database;
step 2-2) interface function analysis; acquiring interface function names of a grammar tree, determining function actions by analyzing the interface functions, generating a calling relation frame code according to the calling relation analysis of the function names, and determining the content of the generated code according to the difference of the function actions;
step 2-3) the test program source code collects the test interface parameters in step 2-1) and the test code frame in step 2-2), generates the test program source code, and inserts the test process monitoring code into the test code; the monitoring code refers to the process, time and content of function call when the program runs, and can be used for testing user analysis; the brief summary test code generating module is used for obtaining function names and function parameters, reading a test database, inserting an operation monitoring code, and finally generating a test code;
step 3) sending the test codes to a test code compiling module, compiling corresponding test program files according to the types of the platforms, and transmitting the test program files adapting to different platforms to a program deployment and operation control module, wherein the embedded scenes are as follows: ssh remote login control, scp program deployment, adb installation deployment, and protocol stack test through a program deployment and operation control module;
step 4) the running process information is sent to a test report generating module to generate a test report, and the test report generating module is used for collecting the tested information and arranging the report according to the information time stamp; and finally, generating a test report according to a certain format.
The invention will be further illustrated with reference to specific examples.
The SOME/IP protocol stack test includes:
1. calling an availability test: the client calls a protocol stack interface, and whether the server can receive corresponding data or not;
2. interface data serialization and anti-serialization testing: the sending end sends the data to the opposite side through SOME/IP protocol stack, the parameters need to be packed according to the agreed data format, the process is called serialization; after receiving the data, the receiving end unpacks the data according to the appointed format, and the process is called reverse serialization; judging whether the data of the receiving party and the sending party are consistent or not during the test;
3. calling a time sequence and delay test: when the interface tests, the client calls the interface to request data from the server, or the server actively notifies the registered event receiver of the event, and the interface of the protocol stack is triggered in the correct sequence and under the allowed delay in the processes.
The SOME/IP protocol stack interface is divided into such several types: method call, method return, event notification, attribute setup, and attribute acquisition interface.
As shown in fig. 4, the tested protocol stack code is first introduced into the compiling and testing server, and the code generating module in the compiling and testing server will analyze the interface code of the SOME/IP protocol stack and generate a syntax tree according to the flow as in fig. 2. The grammar tree passes the interface information to the test code generation module. For SOME/IP protocol stack method call and test case generation of method return, the input parameters of the method call need to acquire the "fingerprint" of the data (the fingerprint refers to the check byte generated by a certain algorithm, hash, CRC and the like can be used), in FIG. 3, when call reply data content is generated, the "fingerprint" is also generated; with the "fingerprint" it is then necessary to trigger an interface function that invokes the protocol stack to pass data from one end to the other. The compiling and testing server needs to add extra testing links as "testing channels" in order to control SOME/IP protocol stack sending and monitor data receiving during testing, and the "testing channels" suggest the use of other protocol stacks such as TCP/IP. "TestChannel" in fig. 5 means "test channel". The "test channel" is inserted into the test code during the process of monitoring code generation. The test channel records the fingerprint and the time stamp of the data sent by the sending end, and if the data needs to be returned to the calling end, the test channel correspondingly records the fingerprint and the time stamp of the returned data, and the test server judges the sending, receiving and returning reliability of the data through the test channel.
Method call and method return test: the overall flow is shown in fig. 5:
1. the compiling and testing server sends a 'TestChannel' method to a testing platform A through a 'testing channel', and the testing platform A triggers a corresponding protocol stack interface to send data to a testing platform B;
2. after receiving the message sent by the protocol stack, the test platform B generates a corresponding check byte by using a check function;
3. if the message needs to be returned, returning data and generating a return data check byte, and then sending calling information to a compiling and testing server through a testing channel;
4. after receiving the test data, the test platform A generates check bytes in the same way as the sending end and transmits the data to the compiling and testing server through a test channel.
Event notification test: when testing the event notification interface:
1. the compiling and testing server triggers the testing platform B to send event information;
2. when the test platform B monitors the event method to be triggered, the fingerprint and the time stamp are collected, and then call data are sent to a test and compiling server through a test channel;
3. the test platform B sends the fingerprint and the time stamp of the event to the compiling and testing server through the test channel after the event is sent;
4. the compiling and testing server analyzes the acquired information. Confirming whether the event is triggered correctly or not through analysis; the overall flow is shown in fig. 6.
And (3) testing the attribute: and the same method is called.
The invention is not limited to the above embodiments, and based on the technical solution disclosed in the invention, a person skilled in the art may make some substitutions and modifications to some technical features thereof without creative effort according to the technical content disclosed, and all the substitutions and modifications are within the protection scope of the invention.

Claims (4)

1. The automatic test method of the vehicle-mounted Ethernet protocol stack based on semantic analysis is characterized by comprising the following steps of:
step 1), injecting a vehicle-mounted Ethernet protocol stack interface code into a source code analysis module for analysis to generate a grammar tree;
step 2) sending the grammar tree into a test code generation module for analysis to generate a test code, which specifically comprises the following steps:
step 2-1) interface data structure analysis; obtaining interface data types of the grammar tree, generating call reply data content according to the data types, generating a data structure for expanding function parameters when the call reply data content is expanded until the types are POD types, then reading test metadata in a test database, generating type examples, and assigning the metadata to the examples; if the data of the target data type is required to be specified, a default value can be declared and filled in the database;
step 2-2) interface function analysis; acquiring interface function names of a grammar tree, determining function actions by analyzing the interface functions, generating a calling relation frame code according to the calling relation analysis of the function names, and determining the content of the generated code according to the difference of the function actions;
step 2-3) the test program source code collects the test interface parameters in step 2-1) and the test code frame in step 2-2), generates the test program source code, and inserts the test process monitoring code into the test code; the monitoring code refers to the process, time and content of function call when the program runs, and can be used for testing user analysis; the brief summary test code generating module is used for obtaining function names and function parameters, reading a test database, inserting an operation monitoring code, and finally generating a test code;
and 3) transmitting the test codes to a test code compiling module, compiling corresponding test program files according to the types of the platforms, transmitting the test program files adapting to different platforms to a program deployment and operation control module, and testing a protocol stack through the program deployment and operation control module.
2. The automatic test method of the vehicular ethernet protocol stack based on semantic analysis according to claim 1, wherein the source code analysis module in step 1) analyzes the lexical, grammatical and semantic of the source code to generate a grammar tree containing function names, parameters and structures.
3. The automatic test method of the on-board ethernet protocol stack based on semantic analysis according to claim 1, wherein the program deployment and operation control module embedded scenario in step 3) comprises: ssh telnet control, scp program deployment and adb installation deployment.
4. The automated test method of a vehicular ethernet protocol stack based on semantic analysis according to claim 3, further comprising the step of 4) transmitting the running process information to a test report generating module to generate a test report, wherein the test report generating module is used for collecting the tested information and arranging the report according to the information time stamp; and finally, generating a test report according to a certain format.
CN201911412584.2A 2019-12-31 2019-12-31 Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis Active CN111162972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911412584.2A CN111162972B (en) 2019-12-31 2019-12-31 Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911412584.2A CN111162972B (en) 2019-12-31 2019-12-31 Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis

Publications (2)

Publication Number Publication Date
CN111162972A CN111162972A (en) 2020-05-15
CN111162972B true CN111162972B (en) 2023-05-02

Family

ID=70560032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911412584.2A Active CN111162972B (en) 2019-12-31 2019-12-31 Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis

Country Status (1)

Country Link
CN (1) CN111162972B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037587B (en) * 2021-02-26 2022-07-29 清华大学 TCP/IP protocol stack testing method and device and electronic equipment
CN112799653B (en) * 2021-03-17 2021-09-10 中汽数据有限公司 Compiler for generating source code in test scenario and test scenario generation system
CN115134280B (en) * 2022-06-23 2023-11-24 安徽江淮汽车集团股份有限公司 Fault testing system and method for vehicle-mounted Ethernet
CN115225552A (en) * 2022-07-29 2022-10-21 重庆长安汽车股份有限公司 Test method, device, equipment and medium for real-time publishing subscription protocol
CN115361322B (en) * 2022-08-15 2023-10-17 华人运通(山东)科技有限公司 SOME/IP protocol test system and method
CN115883431B (en) * 2022-11-29 2024-06-04 重庆长安汽车股份有限公司 Terminal communication protocol performance test system, method, vehicle and storage medium
CN115865193B (en) * 2023-02-27 2023-05-09 中国人民解放***箭军工程大学 Device and method for testing reflective memory networking performance
CN117354208B (en) * 2023-09-28 2024-04-16 广州翼辉信息技术有限公司 Automatic CODESYS bus protocol stack testing method and system based on CI/CD
CN117667709B (en) * 2023-12-07 2024-05-17 长园智能装备(广东)有限公司 Design method of manufacturing industry automation test direction standard protocol stack

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315679A (en) * 2017-05-12 2017-11-03 昆明奥多智能科技有限公司 A kind of embedded software automation exact p-value method and test system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407973B (en) * 2014-11-25 2018-04-06 珠海格力电器股份有限公司 A kind of implementation method and device of automation cell test
CN106776343A (en) * 2017-01-13 2017-05-31 中国科学院软件研究所 A kind of web application automated test tool and method
US10628284B2 (en) * 2017-04-24 2020-04-21 Tektronix, Inc. System and method for bitstream decoding with compiler-generated syntax trees
CN107656873A (en) * 2017-10-23 2018-02-02 扬州航盛科技有限公司 Automatization test system and method for testing based on the vehicle-mounted softwares of Linux
CN110543421B (en) * 2019-08-31 2022-03-29 华南理工大学 Unit test automatic execution method based on test case automatic generation algorithm

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315679A (en) * 2017-05-12 2017-11-03 昆明奥多智能科技有限公司 A kind of embedded software automation exact p-value method and test system

Also Published As

Publication number Publication date
CN111162972A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111162972B (en) Automatic test method for vehicle-mounted Ethernet protocol stack based on semantic analysis
CN110377438B (en) Routing method, device and system of cross-process communication interface
CN110058864B (en) Micro-service deployment method and device
CN108459850B (en) Method, device and system for generating test script
CN111355802B (en) Information pushing method and device
US8175256B2 (en) Call center system and method for obtaining interface invoke information
CN111506311A (en) Internet rapid iterative development, integration and release method and middlebox enabling engine
CN112380229A (en) Service data synchronization method and device, nonvolatile storage medium and processor
CN115422036A (en) Vehicle-end SOA service call chain tracking method based on OpenTelemetry
CN107122307B (en) Internet of things execution system
CN114143369A (en) Service monitoring system of cloud platform
CN112399446A (en) Edge gateway communication method, device, computer equipment and storage medium
CN111597020A (en) Application Programming Interface (API) debugging method and debugging terminal
CN113010432B (en) White box simulation test method and system based on flow time sequence playback
CN114500348A (en) CDN gateway test method and system
CN111953796A (en) In-band management file transmission method, device and equipment and readable storage medium
CN103546463A (en) Additional-parameter transmission method and additional-parameter transmission device of integrated information platform and application system
CN113377361B (en) Method for realizing timing verification of data source based on linux crontad and jar packets
CN115529244B (en) Data acquisition and transmission rule configuration method and device for vehicle terminal, server and medium
CN110232027B (en) Method and system for performing system test based on editable data
CN117827680A (en) Interface testing method, device and server
CN117971593A (en) Data acquisition method, client, server, electronic device and storage medium
CN118264708A (en) Service call chain tracking method and system, storage medium and electronic equipment
CN117194196A (en) Data processing method and device
CN117478694A (en) Method and system for acquiring vehicle-end message data and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant