Description
The use case test is a technique that is applied in particular to the testing of the quality characteristics of Suitability, Effectivity and User-friendliness. The test basis contains at least the use cases and preferably also the associated use-case diagram. There are various definitions of the concept of use case in circulation. In this section, the following definition is used:
Definition |
---|
A use case contains a typical interaction between a user and a system. The use case describes a complete piece of functionality that a system offers to a user and that delivers an observable result for the user. |
Besides various use case definitions, there are also various types of use case descriptions. The type can vary from organisation to organisation and even from project to project. The variations relate to the abstraction level, the scope and the degree of detail, with which a use case is described. Since a use case can be described in various ways, it makes sense to carry out a check before applying the use case test in order to examine whether the use case description employed contains sufficient information to be used for the use case test. The simplest way to perform this check is with a checklist (see the tip "Use cases checklist").
Tip |
---|
Use cases checklistThe detail content of a checklist for determining whether a use case is usable for the application of the use case test depends on the way in which a use case is described. Below are some checks that can be used as a basis for creating your own checklist:
|
ChecklistThe use case test focuses on the coverage of the interactions between the user and the system. The basic technique used here is:
Variations on the use case test can be created by applying other basic techniques, such as:
- Paths
- Decision points: modified condition/decision coverage
- Pairwise testing
The basic technique "checklist" is almost always usable. The effectiveness of the alternative basic techniques is strongly dependent on the content of the use case descriptions. In this section, the "checklist" basic technique is employed in an example. For an explanation of the other techniques, see "Coverage types and basic techniques".
In more detail |
---|
Use case diagramA use case describes a (part of the) functionality. A use case diagram indicates the system boundaries, reflects possible mutual relationships between use cases, and especially shows which relationships there are between the actors (users) and the use cases. A use case diagram is relatively simple. The three most important symbols are:
Use cases can have two types of connections: "extend" or "include":
The correspondence between extend and include is that, in both cases, similar behaviour is removed to avoid repetition. The difference between them is that an include relationship, in contrast to the extend relationship, often does not involve an actor. Furthermore, the include use case is always executed, whereas the extend use case is executed optionally. For more information on use cases/models, refer to the official Unified Modelling Language (UML) documentation of the Object Management Group (http://www.omg.org). |
Points of focus in the steps
In this section, the use case test is explained step by step. In this, the generic steps are taken as a starting point. An example is also provided, showing at each step how the technique works. A use case diagram is set up in the example according to the above description. Since no uniform agreements exist concerning a description of a use case, only relevant use case components have been used in the example.
Example |
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The figure below shows a use case diagram in which the student ("actor") can start an application ("TestDesignTechniqueAssessment"). After going through the logging-in procedure, the student selects a particular test design technique on which he wishes to be assessed. During the assessment, there is the possibility of giving the student an explanation when a wrong answer is given. There is also a possibility of providing an interim score relating to the number of correct answers given. After a certain number of questions have been posed, the application stops. The tutor ("actor") can follow the student's progress and results. As an example, some use case descriptions are provided:
|
In more detail |
---|
Besides the above-mentioned components (name, actor, preconditions, primary scenario, exceptions and postconditions) use-case components that are often used in use-case templates are:
|
1 - Identifying test situations
Below, it is set out step by step how the use case test is applied in this example:
Deriving test situations from the use case is largely dependent on the level of detail to which the use case is described. When there is little detail, it may be the case that only one test case can be described for a use case (e.g. the purpose of the use case). Under such circumstances, no logical test cases can be created for these test situations, since not enough information is present. If the use case contains more detail, then of course detailed test situations can be distinguished, which can immediately be seen as the logical test cases. In all cases, the recognised test situations are included on a checklist, so that it will be possible at the next stage to check off whether at least one logical test case has been created for each test situation.
Since no uniform description exists for use cases, it is not possible to provide a formal way of deriving test situations. Depending on the knowledge and expertise of the testers, one will find it easier than another (see also the tip).
Tip |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Depending on the way in which a use case is described, carrying out the following steps can help to get thoughts in order for identifying and describing test situations:
The result of the first three steps for the use case "StartUsecasetest" may look as follows:
With the aid of the above table and the use case description, test situations can be identified and described (step 4). |
Example |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Suppose that the use cases from the example "TestDesignTechniqueAssessment" were to contain almost no details; a checklist with test situations (these are not logical test cases) might look like this:
However, as the example does contain more detail, the test situations description does not have to be restricted to a checklist. In the table below, a few example test situations for the use case "StartUsecasetest" are described. These test situations are at once the logical test cases. For the description of a test situation, a layout that is similar to the use case description has been chosen.
The component "Priority" can be used to indicate whether it is mandatory or optional to execute the test case. It can also be used to determine the sequence of execution. |
2 - Creating logical test cases
If step 1 "Identifying test situations" has resulted only in a checklist, no logical and physical test cases can (at the moment) be created on the basis of the use cases. In that case, other parts of the test basis should be searched for additional information to enable the creation of the test cases. If step 1 has delivered detailed test situations, these are at once the logical test cases.
In a UCT test case traceability matrix, a track is kept (by checking off) of whether at least one logical test case has finally been made for all the recognised test situations.
Example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
With the checklist example, it will still be possible at a given point, on the basis of information from other parts of the test basis, to start creating logical test cases. The UCT test case traceability matrix (here completed with fictional values) might look as follows:
It can be seen from the matrix that no logical test cases (TCs) have yet been created for test situations 2a and 3. It can also be seen, for example, that test situation 1a occurs in various logical test cases. The simple UCT test case traceability matrix for the example with the detailed test situations (which are at once the logical test cases) looks as follows:
|
3 - Creating physical test cases
No remarks.
4 - Establishing the starting point
No remarks.
An overview of all featured Test Design Techniques can be found here.