Test specifications for test automation: Easily created using a tool instead of a script

Test automation and intelligent solutions for creating test case specifications significantly improve the efficiency of hardware-in-the-loop (HiL) tests. Tool extensions can be used to create executable test specifications for automated HiL tests without the use of a scripting language.

Initial situation

HiL systems are widely used in industry and enable powerful test environments to be set up and test coverage to be increased. HiL tests offer a number of advantages over other test methods. Compared to tests in a real environment, HiL tests allow early testing in all development phases. They also enable better reproducibility of test cases, as the simulated environment of the test object ensures that the test process is independent of external factors such as weather conditions. In addition, the HiL test environment avoids risks from damage to the overall system and accidents during the test process that could result from possible defects – an additional cost saving. Other test methods that also use simulation techniques, such as software-in-the-loop (SiL) or model-in-the-loop (MiL), have the disadvantage that the software to be tested is not executed on the actual hardware and its interaction with external components cannot be observed. In addition, the HiL method offers the possibility of observing the behavior of the test object at its load limits, e.g., through stress and performance tests.

For HiL testing, the embedded system under test (SUT) is connected via its inputs and outputs to a HiL test bench, which models the system environment of the test object using simulated sensors, actuators, and mechanical and electrical components. The inputs of the test object are then stimulated with data from the environment model.

HiL tests are usually performed under real-time conditions. The management software for the HiL infrastructure is therefore often run on real-time capable hardware. There are various HiL hardware and software solutions from different manufacturers on the market. A widely used solution for HiL test equipment comes from NI (formerly National Instruments). NI offers the VeriStand software environment for managing HiL hardware components. This offers numerous control and management functions. VeriStand enables test engineers to configure I/O channels, integrate simulation models, log data, generate stimuli, and communicate with the hardware of the HiL system, for example.

In addition, VeriStand allows user-defined functionality to be added to the test environment. This is a great help, for example, in optimizing the creation of test case specifications.

A central front end for the test engine

The complexity, growing number of functions, and thus possible input and output signals of an average embedded system, such as an automotive control unit, leads to a high number of test cases, among other things.In order to master the enormous test scope of modern electronic systems, a high degree of continuous automation of the test process is essential. The basis for such test automation is the creation of test case specifications.

In VeriStand, test specifications can be created using programming and scripting languages. However, this requires the user to have certain programming skills and is relatively time-consuming. In order to provide a simple way to specify test cases for automated execution in a hardware-in-the-loop environment, it is advisable to integrate specialized tools into the test environment. Various tools from different manufacturers are available on the market for this purpose. In-house developments can also perform this function. ITPower Solutions has made its in-house test tool ContinoProva available for use in a HiL environment via a connection to NI VeriStand. The architecture of the tool used is, of course, important for this application.

The ContinoProva tool was originally designed for use in heterogeneous tool environments. It specializes in automating test execution and test evaluation. Thanks to its open client-server architecture, it can be used widely in almost all test environments and in every test phase. The tool abstracts from the user and programming interfaces of the test environment in which it is used and provides a uniform front end for the specification of tests and the control of connected hardware and software tools. Of course, this requires that connected tools have the appropriate APIs.

ContinoProva communicates with external tools via so-called services, which can call all relevant functions and methods of the corresponding tool via its programming interface (API) and receive its corresponding return values. Encapsulating communication in services enables use in different tool environments.

Figure 1

Figure 1 shows the schematic structure of the NI HiL test environment with the connected ContinoProva test tool. The tool runs on a Windows PC. This allows executable test scenarios to be specified on the PC using the tool and the data to be transferred to the real-time system for further processing. The basis for communication between ContinoProva and VeriStand is the implemented service, referred to here as the NI HiL service. As the test engine, VeriStand controls and communicates with the HiL environment and the test object. The output signals and data from the test object are sent back to ContinoProva via VeriStand for evaluation and further use.

Test control

The NI HiL service enables read and write access to all channels used in a VeriStand project and also offers operations for stimulating and recording the channels at a given time interval. These channels are used in VeriStand for user-defined provision of functionalities such as real-time stimulus generation, data acquisition for measurements, and parameter definition. The ASAM standard was developed to ensure the compatibility of tools in the development process and to enable continuous data exchange. It defines protocols, data models, file formats, and interfaces (APIs) for software development and testing in the automotive environment.

The NI HiL service was implemented based on the ASAM standard “ASAM AE XIL – Generic Simulator Interface.” This allows ports to be configured, data to be recorded, and variables to be stimulated. The common file formats of the ASAM standard were used in this context.

The VeriStand operations ReadChannel and WriteChannel form the cornerstones for the specification of test cases in the test scenario shown below as an example. The ReadChannel operation can be used to read the current value of the corresponding channel. The WriteChannel operation sets the channel to the specified value.

The HiL service now offers the option of reading signal waveforms from all common ASAM-compatible file formats for the stimulation of a channel in a given time interval. Signal waveforms are recorded in the ASAM file format MDF4.

Figure 2

Figure 2 shows a test specified for VeriStand with ContinoProva. As shown in the tree structure on the left side of the image, this test consists of several test groups, which in turn contain several test sequences. A test sequence is formed by a series of test steps that are processed sequentially. Test steps are the smallest test execution units. The operations of a test step are called test tasks. In this case, the test of an engine control unit is demonstrated. The figure shows an example of the window for the test task “DesiredRPM = 4000”. Here, the engine speed is to be set to the defined value. In the test task, the WriteChannel operation from the NI HiL service and the value 4000 for the input signal command_RPM are called. This method allows test cases for all components and tools in the HiL environment to be easily created and managed via the central user interface.

Conclusion

The described connection of a test tool to a HiL system with NI VersiStand as the test engine significantly reduces the testing effort. Test resources, time, and costs for the development and maintenance of test programs and scripts can be saved, and the functionality provided by the tool can be used for the test process. The test engineer can specify and manage test cases using the tool GUI and execute them immediately in VeriStand. By outsourcing the test specification from the technical infrastructure of the HiL system, the test cases can be designed from a purely logical and subject-specific perspective and are therefore less dependent on their specific implementation. This further simplifies the management of the test cases.

Do you have any questions? Get in touch! We are happy to assist you!

I am your sales representative and will be happy to advise you on all questions relating to our services and products! Get in touch or simply make an appointment for a free consultation.

Sebastian Stritz
E-Mail: sebastian.stritz@itpower.de
Phone: +49 (0)30 6098501-17