CN113360391A - Embedded software black box testing method based on RT-Linux - Google Patents

Embedded software black box testing method based on RT-Linux Download PDF

Info

Publication number
CN113360391A
CN113360391A CN202110703606.1A CN202110703606A CN113360391A CN 113360391 A CN113360391 A CN 113360391A CN 202110703606 A CN202110703606 A CN 202110703606A CN 113360391 A CN113360391 A CN 113360391A
Authority
CN
China
Prior art keywords
test
environment model
thread
test environment
sending
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.)
Pending
Application number
CN202110703606.1A
Other languages
Chinese (zh)
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.)
Shanghai Zhenhong Information Technology Co ltd
Original Assignee
Shanghai Zhenhong Information 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 Shanghai Zhenhong Information Technology Co ltd filed Critical Shanghai Zhenhong Information Technology Co ltd
Priority to CN202110703606.1A priority Critical patent/CN113360391A/en
Publication of CN113360391A publication Critical patent/CN113360391A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • 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

Abstract

The invention discloses an embedded software black box testing method based on RT-Linux, which comprises the following steps: s1, generating a graphical test environment model, selecting a communication interface corresponding to the characteristics of a tested piece, configuring parameters of the communication interface, and compiling and debugging the graphical test environment model in an RT-Linux system; s2, generating a C code program of a test environment model under the RT-Linux system according to the graphical test environment model, operating the generated C code program, and building the test environment model; and S3, selecting the logic condition and the sending operation which need to be applied according to the test requirement of the tested piece, generating a C code program of the test case and executing the C code program. The invention effectively ensures that all tests have real-time performance, can achieve the aim of carrying out closed-loop simulation test on the tested piece, and has strong universality and high practicability.

Description

Embedded software black box testing method based on RT-Linux
Technical Field
The invention relates to the technical field of software testing, in particular to an embedded software black box testing method based on RT-Linux.
Background
Due to the characteristics of the embedded software, when testing the embedded software in a black box, a tester often needs to simulate a real environment to test a tested piece, and thus the tester needs to perform real-time closed-loop simulation testing on the tested piece. The embedded software often has a high requirement on real-time performance, so the test needs to be performed in an environment with good real-time performance, and the black box test method in the prior art is difficult to solve the problem of insufficient real-time performance.
Therefore, how to provide an embedded software black box testing method based on RT-Linux that effectively improves real-time performance is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the invention provides an embedded software black box testing method based on RT-Linux, which aims to solve the problem that the black box testing method in the prior art is not sufficient in real-time.
In order to achieve the purpose, the invention adopts the following technical scheme:
an embedded software black box test method based on RT-Linux comprises the following steps:
s1, generating a graphical test environment model, selecting a communication interface corresponding to the characteristics of a tested piece, configuring parameters of the communication interface, and compiling and debugging the graphical test environment model in an RT-Linux system;
s2, generating a C code program of a test environment model under the RT-Linux system according to the graphical test environment model, operating the generated C code program, and building the test environment model;
and S3, selecting the logic condition and the sending operation which need to be applied according to the test requirement of the tested piece, generating a C code program of the test case and executing the C code program.
Preferably, the specific contents of the C code program for generating the test environment model under the RT-Linux system in S2 include:
and acquiring a sending thread and a receiving thread of the test environment model, and generating a C code program of the test environment model in the RT-Linux system according to the sending thread and the receiving thread of the test environment model.
Preferably, the sending thread and the receiving thread of the test environment model include:
a sending thread communicating with the tested piece: sending data of a test environment model to a tested piece to the tested piece through various I/O interfaces;
a receiving thread communicating with the tested piece: receiving communication data sent by the tested piece to the test environment module through various I/O interfaces;
a sending thread communicating with the test case: transmitting the communication data received by the test environment model from the tested piece to the test case in an inter-process communication mode;
a receiving thread in communication with the test case: and receiving the data sent by the test case.
Preferably, the specific content of the C code program for generating the test case in S3 includes:
and acquiring a sending thread and a receiving thread of the test case, and generating a C code program of the test case in the RT-Linux system according to the sending thread and the receiving thread of the test case.
Preferably, the sending thread and the receiving thread of the test case include:
receive data thread in communication with the test environment model: receiving interface data sent by the tested piece from the testing environment model by adopting an inter-process communication mode;
data sending thread in communication with the test environment model: sending interface data to be sent in the testing step to the testing environment model;
the testing step executes a thread: each test step is automatically run in sequence according to the designed test step sequence.
According to the technical scheme, compared with the prior art, the embedded software black box testing method based on the RT-Linux is disclosed and provided, and all tests can be ensured to have real-time performance by operating the testing environment model and the testing case in the real-time operating system RT-Linux; the test environment model and the tested piece perform real data interaction, and the test case performs data interaction with the test environment model, so that the purpose of performing closed-loop simulation test on the tested piece can be achieved; in addition, the mode of automatically generating the code program according to the graphical model to build the test environment model is adopted, and compared with the mode of manually compiling the code in the prior art, the method has stronger universality and further improves the working efficiency and the practicability.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic flow chart of an embedded software black box testing method based on RT-Linux according to the present invention;
FIG. 2 is a schematic diagram of a black box testing method for embedded software based on RT-Linux according to the present invention;
FIG. 3 is a diagram illustrating an example of a graphical test environment model according to an embodiment of the present invention;
fig. 4 is a diagram illustrating an example of a graphical test environment model according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses an embedded software black box testing method based on RT-Linux, which comprises the following steps:
s1, generating a graphical test environment model, selecting a communication interface corresponding to the characteristics of a tested piece, configuring parameters of the communication interface, and compiling and debugging the graphical test environment model in an RT-Linux system;
s2, generating a C code program of a test environment model under the RT-Linux system according to the graphical test environment model, operating the generated C code program, and building the test environment model;
and S3, selecting the logic condition and the sending operation which need to be applied according to the test requirement of the tested piece, generating a C code program of the test case and executing the C code program.
It needs to be further explained that:
the test environment model is a module which is directly communicated with a tested piece through an interface, the module is an executable program which is constructed and compiled by C language, and the main function of the module is to be respectively responsible for communicating with the tested piece and a test case.
The test case is designed and created by a tester, mainly comprises a series of test steps, wherein the test steps comprise logic conditions and sending operation, and can carry out specified test according to the requirements of the tested piece. In order to ensure the real-time performance of the test, the test case is also an executable program generated by compiling the C language.
The traditional test environment model building method is mainly that a tester writes a section of code manually according to the characteristics of a tested piece, and then the code is put into a specified operating system for compiling and executing. The method has the defects that the universality is poor, different tested pieces need to be compiled to create a corresponding test environment model, the problems are effectively solved by automatically converting the graphical test environment model into the corresponding code, and the universality, the practicability and the working efficiency are improved.
If a communication interface which is not supported by the test environment model exists in the application process, the interface is only required to be driven and called under the RT-Linux operating system, and the expansion is very convenient.
In order to further implement the above technical solution, the specific content of the C code program for generating the test environment model in the RT-Linux system in S2 includes:
and acquiring a sending thread and a receiving thread of the test environment model, and generating a C code program of the test environment model in the RT-Linux system according to the sending thread and the receiving thread of the test environment model.
In order to further implement the above technical solution, the sending thread and the receiving thread of the test environment model include:
a sending thread communicating with the tested piece: sending data of a test environment model to a tested piece to the tested piece through various I/O interfaces;
a receiving thread communicating with the tested piece: receiving communication data sent by the tested piece to the test environment module through various I/O interfaces;
a sending thread communicating with the test case: transmitting the communication data received by the test environment model from the tested piece to the test case in an inter-process communication mode;
a receiving thread in communication with the test case: and receiving the data sent by the test case.
In order to further implement the above technical solution, the specific content of the C code program for generating the test case in S3 includes:
and acquiring a sending thread and a receiving thread of the test case, and generating a C code program of the test case in the RT-Linux system according to the sending thread and the receiving thread of the test case.
In order to further implement the above technical solution, the sending thread and the receiving thread of the test case include:
receive data thread in communication with the test environment model: receiving interface data sent by the tested piece from the testing environment model by adopting an inter-process communication mode;
data sending thread in communication with the test environment model: sending interface data to be sent in the testing step to the testing environment model;
the testing step executes a thread: each test step is automatically run in sequence according to the designed test step sequence.
It needs to be further explained that:
the test case of the black box test of the embedded software consists of a series of test steps, and the test steps can be divided into logic conditions and sending operations, for example, when the condition 1 is met, the sending operation A is executed, when the condition 2 is met, the sending operation B is executed, and the like. Aiming at the characteristic, the invention sets the test case to be composed of a condition and a sending execution.
In the invention, the tester can select proper 'condition' and 'sending execution' according to the actual requirement to organize the required test steps.
The following is a specific design description for "conditions" and "transmit execution":
"Condition" design Specification:
triggering conditions are as follows: an interface message is received from the tested piece, similar to the while (true) loop in the C language.
Judging conditions: it can be determined whether the value of a certain variable is equal to a fixed value/range segment/enumerated value, etc., similar to if, else in C language.
Circulation conditions are as follows: similar to the for loop in C language.
The design specification of "sending execution" can be divided into the following types according to types:
time delay: the time delay is specified and can be accurate to microsecond.
Sending a serial port message;
sending a network message;
sending a CAN bus message: sending CAN bus communication protocol message, and setting sending times, sending interval time and the like;
and send other interface type messages.
According to the basic 'condition' and 'sending execution', a tester can conveniently design various test cases meeting the requirements;
the test case generates a method description of executable programs under an RT-Linux system: the test case mainly has the functions of sending and receiving data and processing data and is mainly communicated with the test environment model, so that the test case can be conveniently generated into the C code by adopting the method.
After the test case generates a test code in a C language format, the test code can be compiled and executed by using a compiler compiling instruction under a Linux system.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (5)

1. An embedded software black box test method based on RT-Linux is characterized by comprising the following steps:
s1, generating a graphical test environment model, selecting a communication interface corresponding to the characteristics of a tested piece, configuring parameters of the communication interface, and compiling and debugging the graphical test environment model in an RT-Linux system;
s2, generating a C code program of a test environment model under the RT-Linux system according to the graphical test environment model, operating the generated C code program, and building the test environment model;
and S3, selecting the logic condition and the sending operation which need to be applied according to the test requirement of the tested piece, generating a C code program of the test case and executing the C code program.
2. The RT-Linux based embedded software black box testing method according to claim 1, wherein the specific content of the C code program for generating the test environment model in the RT-Linux system in S2 comprises:
and acquiring a sending thread and a receiving thread of the test environment model, and generating a C code program of the test environment model in the RT-Linux system according to the sending thread and the receiving thread of the test environment model.
3. The embedded software black box testing method based on RT-Linux according to claim 2, characterized in that the sending thread and the receiving thread of the testing environment model comprise:
a sending thread communicating with the tested piece: sending data of a test environment model to a tested piece to the tested piece through various I/O interfaces;
a receiving thread communicating with the tested piece: receiving communication data sent by the tested piece to the test environment module through various I/O interfaces;
a sending thread communicating with the test case: transmitting the communication data received by the test environment model from the tested piece to the test case in an inter-process communication mode;
a receiving thread in communication with the test case: and receiving the data sent by the test case.
4. The RT-Linux based embedded software black box testing method according to claim 1, wherein the specific content of the C code program for generating the test case in S3 comprises:
and acquiring a sending thread and a receiving thread of the test case, and generating a C code program of the test case in the RT-Linux system according to the sending thread and the receiving thread of the test case.
5. The embedded software black box testing method based on RT-Linux according to claim 4, characterized in that the sending thread and the receiving thread of the test case comprise:
receive data thread in communication with the test environment model: receiving interface data sent by the tested piece from the testing environment model by adopting an inter-process communication mode;
data sending thread in communication with the test environment model: sending interface data to be sent in the testing step to the testing environment model;
the testing step executes a thread: each test step is automatically run in sequence according to the designed test step sequence.
CN202110703606.1A 2021-06-24 2021-06-24 Embedded software black box testing method based on RT-Linux Pending CN113360391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110703606.1A CN113360391A (en) 2021-06-24 2021-06-24 Embedded software black box testing method based on RT-Linux

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110703606.1A CN113360391A (en) 2021-06-24 2021-06-24 Embedded software black box testing method based on RT-Linux

Publications (1)

Publication Number Publication Date
CN113360391A true CN113360391A (en) 2021-09-07

Family

ID=77536231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110703606.1A Pending CN113360391A (en) 2021-06-24 2021-06-24 Embedded software black box testing method based on RT-Linux

Country Status (1)

Country Link
CN (1) CN113360391A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915242A (en) * 2012-09-26 2013-02-06 北京广利核系统工程有限公司 Method for implementing code programming by graphical operations
CN103995777A (en) * 2014-05-29 2014-08-20 上海科梁信息工程有限公司 Automatic embedded software block box testing system and method
WO2017071519A1 (en) * 2015-10-30 2017-05-04 北京新能源汽车股份有限公司 Multi-platform general test method, apparatus and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915242A (en) * 2012-09-26 2013-02-06 北京广利核系统工程有限公司 Method for implementing code programming by graphical operations
CN103995777A (en) * 2014-05-29 2014-08-20 上海科梁信息工程有限公司 Automatic embedded software block box testing system and method
WO2017071519A1 (en) * 2015-10-30 2017-05-04 北京新能源汽车股份有限公司 Multi-platform general test method, apparatus and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张虹等: "嵌入式软件测试中的仿真建模方法研究", 《测控技术》 *
蒋崇武等: "面向嵌入式软件测试的仿真建模", 《计算机工程》 *

Similar Documents

Publication Publication Date Title
CN107907814B (en) Method for improving mass production test efficiency of chips
CN110543295B (en) Visual Web front-end project construction system
WO2012022065A1 (en) Method and system for realizing automatic tests of digital signal processor (dsp)
CN105740139B (en) A kind of debugging embedded software method based on virtual environment
CN110688313B (en) Fault injection method for software testing under VxWorks operating system
US9117018B2 (en) Method of debugging software and corresponding computer program product
CN102750143B (en) Based on the DSP development approach that MATLAB com component calls
KR100794130B1 (en) Automatic Function Testing Equipment for Application Software and Additional Service of Mobile Communication Terminal
CN110750453A (en) HTML 5-based intelligent mobile terminal testing method, system, server and storage medium
CN111901155B (en) Internet of things debugging method, device and system and storage medium
CN113360391A (en) Embedded software black box testing method based on RT-Linux
CN111050333A (en) Base station automatic test method and system
CN112346996B (en) Autonomous arrangement testing method for reliability of load identification module
CN111240658A (en) Console implementation method and terminal based on Unity engine
CN104461629B (en) PC terminals and its method for installing application program of mobile phone
CN104572425A (en) Program debugging method, device and system
CN111831546A (en) UI test framework method compatible with mobile terminal and PC terminal simultaneously
CN112433938A (en) Method and device for testing application of mobile terminal
CN108205106B (en) Real-time configuration method for FPGA test
CN114090454B (en) Interface automation test method, device, equipment and storage medium
CN113760235B (en) BLE development and debugging system and method
CN111737159B (en) Software debugging method, device, equipment and computer readable storage medium
CN115509153A (en) Secondary development method and device for narrow-band Internet of things NB-IoT communication module
CN117493168A (en) Water conservancy model calling method capable of conducting offline testing
CN113688032A (en) Fault injection verification method, system and terminal based on inter-process communication mechanism

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