This post describes how SISAM can be used to build a simple environment for automated testing of embedded applications.
Overview
For developing applications with a long life cycle it is very important to ensure that a new release contributes no regression comparing to the previous release. This may become a challenge when an application provides number of capabilities, operates in number of modes or implements number of states. A common approach for addressing this challenge is to establish an automated test environment.
Figure 1 shows a typical automated test environment. It consists of
Typical sequence of events for automated testing:
- Actor uses Batch Controller to start a specific test batch
- Batch Controller reads test cases that constitutes the batch
- Batch Controller calls Test Tool for executing a test case from the batch
- Test Tool reads input test data for the specified test case, applies stimuli to the Testable Application, captures, preprocesses and records application responses
- Batch Controller, upon completion of a test case (all test cases), calls Comparator to compare a test output to a corresponding test master.
- Comparator compares test output and master, writes discrepancies (if any) and signals success/failure
- Batch Controller, upon completion of all test cases, aggregates test results and signals a batch result (success/failure) to the Actor.
A simple test environment
A simple environment for automated testing can be implemented as the following
Component | Implemented as |
---|---|
Batch Controller | A script for shell/command interpreter |
Test Case | A script for shell/command interpreter |
Test Batch | A group of scripts/a folder |
Test Data | A data files or command line parameters |
Test Output | A data file |
Master | A data file |
Comparator | File content comparator |
Discrepancies | File content differences |
Test Tool | Simple Sampler based tool |
Test Tool
To use this simplest automated test environment for testing embedded applications, the Test Tool should be a command-line utility, capable to apply stimuli to the testable application and capture the application response to a file.
SISAM & SITEST
Filters
Due to nature of embedded applications acquired data may vary from run to run even for valid runs. This variability is very application specific; it may make impossible output-to-master comparison, and thus may easily bury the idea of automated testing. To address this issue, acquired data should be filtered and coarsened to the level at which all valid runs would produce identical outputs while invalid runs would still have some difference in the output data. Such a filter should be a command line utility that reads from standard input and writes to standard output. Of course, writing a filter requires additional efforts, however, from authors’ experience, implementing a simple filter does not require any significant efforts.
Function Generators
SISAM is only capable to provide static stimuli for a period of data acquisition. Therefore, if the test conditions require some alternating stimuli applied in parallel with data acquisition, a "function generator" can be used in conjunction with SISAM. A "function generator" is an embedded application that accepts a static input (function ID) and generates a variable function on output.
Post a Comment