Test clients can be generated from interface and component models. A test client generates on-the-fly test sequences of events based on the used model (interface or component) and sends these events to a system under test. An adapter is used as intermediary between the test client and the system under test. The adapter receives events from the test client and translates them to calls understandable by the system under test. It also receives the responses from the system under test and translates them to events understandable by the test client.

If the used interfaces contain triggers with parameters, replies and notifications with variables or any (*) value then one or more parameters file are required.

In order to generate a test client, add a new task to the .prj file similarly to the example:

import "Camera.interface"

Project Camera {

	Generate TestClient {
		// For components, use "for component" instead
	    Testclient_ICamera for interface ICamera
	    {
            // Input parameters for the interface (only required when the interface has commands/signals with input parameters and replies/notifications with variables or any (*) expression)
	        params: "ICamera.params"
	    }
	}
}

To generate the test client, run the .prj (right click on the .prj file → Run AsRun generators). The client can be started by executing the generated .bat/.sh in the src-gen/testclient folder.

Once the test client is started you will see a window like below:

image

The path to the executable file for the adapter has to be given in the field to the left of the 'Start' button. Pressing this button will start the adapter and the test client. The label of the button changes to 'Stop'. The events sent to and received from the system under test are shown in the window. The test process can be stopped by pressing the button 'Stop'. The process may also stop of its own if no further events can be generated based on the model or if an error is detected. Pressing 'Save Coverage Info' creates a file with information about the visited model states and the transitions that were traversed.

The test client works as follows:

The adapter plays a crucial role in the described communication. It is usually implemented manually, the implementation reflects the specifics of the system under test.

The interaction between the test client and the adapter is as follows:

The values in parameters files are used by the test client depending on the scenario:

Limitations: