Test design entities

In coverage-based test design we use a number of different terms for specific entities in the test design. There are logical relationships between these entities. Knowing these relationships will help to specify your tests in the best way.

Test design entities relationship diagram

Below figure shows the relationships between the three main entities in a test design: test situation, test case and test scenario. 

Test design entities relationship diagram

Test situation 

Definition

A test situation is an isolated condition under which the test object displays a specific behavior that needs to be tested.  

Test situations are derived from the test basis. This may be a document, or it may be input from a stakeholder, for example in a message or an interview.  

Definition

The test basis is the information that defines the required system behavior and is used as a basis for test design.  

Example 

The requirements specification for an IT system contains a rule that people will get a discount based on their age. For this specification the test situation could be as follows:  
A person that is 33 years or older will get a 10% discount on the entrance fee of the roller coaster.  

A test situation briefly and clearly describes an isolated situation. Still, depending on the scope of your testing it may be a very broad test situation. In an end-to-end-test for an insurance company the test situation might be as follows: when a person correctly applies for an insurance, they will receive a confirmation letter that describes their rights.  

Creating test situations is a specific part of the test design process. To create test situations, a specific test design technique can be used, but it may also be a matter of straightforward translation of the requirements into test situations.  

Sometimes, a team member in a testing role will first design all test situations before taking other steps in the test design. In a DevOps approach the same person would usually concurrently design test situations and test cases and also assemble them in test scenarios.

Test case 

A test case is used to examine whether the system displays the desired behavior under specific circumstances. A test case can therefore show whether a system indeed behaves as described in a test situation.

Definition

A test case is a set of preconditions, inputs, actions, expected results and postconditions used to examine whether the system displays the desired behavior under specific circumstances.  

Test cases will be created using a coverage-based test design technique or an experience-based approach. The number of test cases per test situation will vary, depending on the test design technique, which in turn is partly influenced by the type of test basis and the results of the quality risk analysis.

Depending on the test design technique that is applied, the relationship between test situations and test cases will be one-to-many, many-to-one or many-to-many, which is indicated in the test design entities relationship diagram earlier in this chapter. (Note that the definition of a one-to-many relationship does also include a one-to-one relationship.)

Example 

For the test situation above (a person that is 33 years or older will get a 10% discount) we could apply the test design technique boundary value analysis. For this technique, based on the risk level, we could decide to create 2, 3 or 4 test cases for this test situation, so it is a one-to-many relationship.  

  • In the case of low risk, we would test a person aged 32 who does not get a discount and a person aged 33 who does get a discount. 
  • In the case of medium risk, we would add the test case of a person aged 34 who does get a discount. 
  • And in the case of high risk we would add the test case of a person aged 31 who does not get a discount. 

Read more about boundary value analysis in "Data-oriented testing with EP and BVA".  

A test case can be worked out in both a logical test case and a physical test case. In the example

above the result is described as logical test cases.  

Definition

A logical test case describes, in logical terms, the circumstances in which the system behavior is examined by indicating which test situations are covered by the test case. 

A tester may execute a test based on the logical test case. However, this requires that the tester finds or creates test data at the time of test execution. Normally, executing based on logical test cases only works well if the execution is done by the same person that created the logical test cases. If someone else, or in case of test automation a machine, is executing the tests, each logical test case must be elaborated into a physical testcase.  

Definition

A physical test case is the concrete elaboration of a logical test case, with choices having been made for the values of all required inputs and settings of the environmental factors. In principle, one logical test case has one physical test case.  

Example

If we elaborate the logical test case that says a person aged 33 gets a discount, there are many things to take into account. Usually, the age of a person is not stored in the database, we therefore need to have a date of birth in the physical test case. And this date of birth needs to be exactly 33 years less than the date used for the test execution (usually the system date). Also, we will need some other relevant data for the person, such as a name and/or ID. And we need to elaborate how to check if the person indeed gets a discount, this could be a simple yes or no, but it may also be necessary to calculate the amount on an invoice to check if it is lower than normal.  

In case the starting situation =

System date 1 January 2020
Regular ticket price €25,00

The physical test case would be as follows: 

Name Glenford Bohm
Date of Birth 1 January 1987
Ticket Price (expected result) € 22,50

 

The act of creating logical test cases is referred to as logical test design; this term may also include the creation of test situations. The act of creating physical test cases is referred to as physical test design; this term may also include the creation of test data, test scenarios and test scripts.  

Definition

Test data is data that exists (for example, in a database or in a test case) before a test is executed, and that affects or is affected by the component or system under test.

Test scenario and test script

Often, especially in the case of a coverage-based test approach, all tests are first defined and then all tests are executed. This approach requires some structure and order. The physical test cases are therefore grouped in one or more test scenarios.  

Definition

A test scenario is a sequence of physical test cases to manually or automatically execute them in an efficient manner. 

There are various considerations to take into account when doing this grouping to create test scenarios. The test cases in one scenario should have something in common, for example a processing order. With some test design techniques, one test case is a long list of test steps; such a test case on its own is already a complete scenario. In such a situation, there will only be one test case per test scenario. When tests are automated, the team will also create test scripts together with the test scenarios.  

Definition

A test script is the test automation code related to one or more test scenarios to automatically execute tests.