|
A Test Strategy may attempt to define the tests using a number of generic classes of testing such as 'unit', 'class', 'module' and 'sub-system'. Some Test Strategies assume that the meanings of these generic names are obvious. It is obvious what a 'module' is. In other cases the Test Strategy attempts to define what the terms mean in this strategy. Definitions and rules are given that are intended to allow different people to come up with the same lists of 'units', 'classes', 'modules' etc. when they look at the software.
This approach is typically intended to work as follows:
- Identify types of software object that are of interest - say 'units', 'modules' and 'sub-systems'.
- Using these definitions the instances of each type within the software can be agreed on.
- Rules from the strategy that define the testing to be performed for each type of object are then applied to each instance of the type. This is intended to give the requirements for testing that particular item.
Extensive experience of this approach as a basis for defining software testing requirements has identified some major issues. In the real world this approach can be ineffective and at worst can be detrimental. The problems with this approach are described in this section.
The Uses of Generic Classes
The three main uses of generic classifications of test in test planning & management are:
- Identifying the instances of each classification within the system.
- For each instance defining what is adequate testing of the instance.
- For each classification / classification instance bounding exactly what is to be tested.
Problems of clarity of understanding and communication are often encountered in each of these areas. These problems are:
- The Identification Problem
- The 'What Is Adequate Testing?' Problem.
- The 'What Is Being Tested?' Problem.
In addition the diverse structure of software creates another problem:
These problems are discussed below.
The Identification Problem
The definitions are intended to be used to identify the instances of 'modules', 'sub-systems' etc. that exist within the system. This is relatively easy when the item equates to a language construct such as a function, class or package or even to an identified development deliverable coming from one team. It is far more difficult for other types of item. For example 'sub-systems' are harder to define. The result can be definitions containing large numbers of criteria with exceptions and guidance. Despite careful draughting there are always cases that are missed and disputes.
The relative ease with which some types of items, particularly language related ones, can be defined may lead to a focus on these as the targets for assurance activities when more appropriate ones exist. They are chosen because it was clear how to identify them and not because they were the things that needed testing.
The 'What Is Adequate Testing?' Problem
When defining the 'rules' for testing identifying 'functions', 'units', 'classes', 'modules', 'sub-systems', etc. is only one issue. The second one is that for each identified instance the rules need to answer the questions:
- Does it need testing?
- If so what types of testing?
- For each type of testing how rigorous should the testing be?
The need for this can be seen if a strategy includes 'functions' or 'class' as a type of target. A medium sized system may contain thousands of functions or hundreds of classes. A small percentage will warrant formal rigorous 'function' or 'class' testing - given real world resource constrains the vast majority will not be formally tested as standalone items but will be tested as part of larger assemblies. There may be a number levels of testing in-between these two limiting cases. So in this approach rules must be written to define the testing applicable to a particular 'function' or 'class'.
Defining these rules is extremely difficult. They tend to be complex open to interpretation and result in arbitrary cut off points. For example why should one additional method mean a class needs formal testing?
The' What Is Being Tested?' Problem
Identifying an instance of an item and the testing that is required on it still does not define what makes up the entity to be tested. An example will be used to illustrate this issue.
|
|
Alarm Manager
The alarm manager class provides a service allowing client software to create and manage alarms that when due will call a call-back method. Clients can create and delete alarms. Alarms are one-shot or periodic. One-shot alarms are automatically removed after operating. Alarm management events and alarm operation events are logged.
The AlarmManager class provides the Alarm Manager service to client software. Client alarms are represented by instances of the ClientAlarm class. The AlarmManager maintains a population of instances of the ClientAlarm class one for each active client alarm. Instances of ClientAlarm are constructed and destroyed as required by the AlarmManager. The ClientAlarm class executes the client call-back method. The AlarmManager uses the system event logging service to log alarm management events and alarm operation events.
|
Given a test target definition of 'The AlarmManager class' the following questions arise:
- Does testing have to address the response of the AlarmManager if construction of a ClientAlarm instance fails?
- Does testing address the management of a population of ClientAlarm instances or the operation of these alarms up to the execution of the call-back method?
- Is the implementation of the ClientAlarm part of the software under test?
- Is the implementation of the system logging service part of the software under test?
- What about software called from the system logging service?
These questions must be answered in order to enable the design of appropriate tests and the creation of test builds that execute the tests on the right software. The questions are not generic ones they are specific to the particular item being considered. This results from the highly diverse structures found in software. There are few common patterns that can be used to identify generic questions and provide generic answers. Generally there will be unique questions relating to each 'unit', 'class', 'module', 'sub-system', etc. that must be answered before it is clear what is to be tested. The specific nature of these questions means that they can not be answered in advance in a strategy document.
|