![]() |
'Function Line' Assurance Targets |
|
|
|
|
|
|
|||||||||||||
|
|
Functions or procedures are a low level building block in many software systems. Function like targets are targets that are based on function like SDAs where:
Two examples of 'function-like' targets that are illustrated below. They are based on a 'function-like' service delivering assembly. The assembly is described first followed by the two examples of targets that use this assembly.
|
||||||||||||||
|
The rolling average SDA is an example of a function like SDA. It is illustrated below.
The rolling average function takes a numeric value and returns the mean value of the either:
The implementation maintains a queue containing all of the samples used in the last mean value. Speed of execution is critical so the implementation maintains an accumulated sum of all the samples in the last mean value. Calculating the mean involves:
Four functions GetNumInQueue(), AppendToQueue(), GetAndRemoveHeadOfQueue() and ResetQueue() are used by the main function to manipulate the queue data structure. These functions are shared functions that operate on any declared and initialised instance of the queue data structure, the queue is passed to these functions on invocation. The rolling average value is critical to the operation of the system and so provision is made to contain any corruption of the queue data structure. If a queue function returns an error or the number of items in the queue does not match the local count or an out of range value is removed from the queue then a recovery action is triggered. The queue and accumulator are reset and the current sample is then processed in the normal manner. A second error during this recovery process halts the system. The SDA definition for this would be:
|
|||||||||||||||
|
First Example of a Function Like Target - The complete Get Rolling Average SDA |
|||||||||||||||
|
When the software contains a function that operates like this one the obvious target for testing is the external behaviour of the SDA using the full implementation of all four functions. The Assurance Target would be:
Analysis and design of tests for this will focus on the sequence of calls to the main function and the responses to those calls. This is a pure black box test of the rolling average function. It should be noted that this target does not focus analysis on or permit easy testing of the behaviour required to recover from a queue corruption. This recovery action is internal as far as this target is concerned and so really falls outside the scope of the target.
|
|||||||||||||||
|
Second Example of a Function Like Target - The main GetRollingAverage() Function |
|||||||||||||||
|
An alternative would be to test the main function addressing both the invocation from the client and the interaction with the queue. Analysis would address what happens at the interfaces to the queue functions as well as at the calling interface. This is illustrated below:
The Assurance Target would be:
The internal interfaces are now brought into view for the purposes of analysing what the behaviour should be and what tests should be applied to prove that this is the case. This should cause the analysis process to address the corruption recovery behaviour. The queue software is now excluded from the software under test and so can be stubbed / modified to simulate queue corruptions during test execution. This target has more internal interfaces which will generally result in a more detailed analysis of the required behaviour for the software that remains within the target.
|
|||||||||||||||
|
The examples given illustrate the way that the Assurance Target style definition can be used to focus analysis and testing on a particular part of the software. A common pattern of definition has been used in both cases. It should be noted that if the approach adopted had been to identify 'function' testing within a strategy and the GetRollingAverage() function was selected for 'function' testing then either of the above forms of testing could result. It is likely that the choice would be made by the engineer doing the work rather than the test management process.
|
|||||||||||||||