4. Test design techniques Flashcards
What should we know before executing a test?
Before we can actually execute a test, we need to know what we are trying to test, the inputs, the results
that should be produced by those inputs, and how we actually get ready for and run the tests.
Where are test conditions, test cases and test procedures are documented?
Test Design specification, Test Case Specification and Test Procedure specification respectively
What is test analysis?
Test analysis is the process of looking at something that can be used to derive
test information. This basis for the tests is called the ‘test basis’. It could be a
system requirement, a technical specification, the code itself (for structural
testing), or a business process. The test basis
includes whatever the tests are based on.
What are test conditions?
From a testing perspective, we look at the test basis in order to see what could be tested - these are the test conditions. A test condition is simply something that we could test.
If we are looking to measure coverage of code
decisions (branches), then the test basis would be the code itself, and the list
of test conditions would be the decision outcomes (True and False).
Test conditions can be identified for test data as well as for test inputs and
test outcomes, for example, different types of record, different distribution of
types of record within a file or database, different sizes of records or fields in a
record.
Test conditions are documented in the IEEE 829 document called a Test
Design Specification
How the experts can call ‘a list of
things that we could test’?
For example, Marick refers to ‘test requirements’ as
things that should be tested. Although it is not intended to imply that everything
must be tested, it is too easily interpreted in that way. [Marick, 1994] In con-
trast, Hutcheson talks about the ‘test inventory’ as a list of things that could be
tested [Hutcheson, 2003]; Craig talks about ‘test objectives’ as broad categories
of things to test and ‘test inventories’ as the actual list of things that need to be
tested [Craig, 2002].
What is a strategy of test conditions identification?
When identifying test conditions, we want to ‘throw the net wide’ to identify
as many as we can, and then we will start being selective about which ones to
take forward to develop in more detail and combine into test cases. We could
call them ‘test possibilities’.
Having identified a list of test conditions, it is important to prioritize them,
so that the most important test conditions are identified (before a lot of time is
spent in designing test cases based on them). It is a good idea to try and think
of twice as many test conditions as you need
What is a test technique?
A testing technique helps us select a good set of tests from the total number
of all possible tests for a given system. Different techniques offer different ways
of looking at the software under test, possibly challenging assumptions made
about it. Each technique provides a set of rules or guidelines for the tester to
follow in identifying test conditions and test cases.
What is traceability?
Test conditions should be able to be linked back to their sources in the test
basis - this is called traceability. Traceability can be either horizontal through all the test documentation for
a given test level (e.g. system testing, from test conditions through test cases to
test scripts) or vertical through the layers of development documentation (e.g.
from requirements to components).
Why traceability is important?
• The requirements for a given function or feature have changed. Some of the
fields now have different ranges that can be entered. Which tests were
looking at those boundaries? They now need to be changed. How many tests
will actually be affected by this change in the requirements? These questions
can be answered easily if the requirements can easily be traced to the tests.
• A set of tests that has run OK in the past has started to have serious prob
lems. What functionality do these tests actually exercise? Traceability
between the tests and the requirement being tested enables the functions or
features affected to be identified more easily.
• Before delivering a new release, we want to know whether or not we have
tested all of the specified requirements in the requirements specification. We
have the list of the tests that have passed - was every requirement tested?
Should the detailed test cases be written down?
If you give an experienced user acceptance
tester with a strong business background a list of high-level test conditions, they
could probably do a good job of testing. But if you gave the same list to a new
starter who didn’t know the system at all, they would probably be lost, so they
would benefit from having more detailed test cases.
Test cases need to be detailed so that we can accurately check the results and
know that we have exactly the right response from the system. If tests are to be
automated, the testing tool needs to know exactly what to compare the system
output to.
What is “kiddie testing?”
If we simply
put in some inputs and think ‘that was fun, I guess the system is probably OK
because it didn’t crash’, then are we actually testing it? We don’t think so. You
have observed that the system does what the system does - this is not a test.
Boris Beizer refers to this as ‘kiddie testing’ [Beizer, 1990]. We may not know
what the right answer is in detail every time, and we can still get some benefit
from this approach at times, but it isn’t really testing.
What is an ‘oracle’?
In order to know what the system should do, we need to have a source of informa-
tion about the correct behavior of the system - this is called an ‘oracle’ or a test oracle.
What the test case specifies?
In addition to the expected results, the test case also specifies the environ-
ment and other things that must be in place before the test can be run (the pre-
conditions) and any things that should apply after the test completes (the
postconditions).
The test case should also say why it exists - i.e. the objective of the test it is
part of or the test conditions that it is exercising (traceability).
What is a test procedure or a test script?
The document that describes the steps to be taken in running a set of
tests (and specifies the executable order of the tests) is called a test proce-
dure in IEEE 829, and is often also referred to as a test script. Writing the test procedure is another opportunity to prioritize the tests, to
ensure that the best testing is done in the time available. A good rule of thumb
is ‘Find the scary stuff first’.
What are the types or categories of test desing techniques from the perspective of their primary soruce?
A specification, the structure of the system or
component, or a person’s experience.
What are the two main categories of testing techniques on a very general level?
Static and dynamic. Dynamic techniques are subdivided into three more categories: specification-based (black-box, also known as behavioral techniques), structure-based (white-box or structural techniques) and experi- ence-based. Specification-based techniques include both functional and non- functional techniques (i.e. quality characteristics).
How else static testing techniques can be called?
non-execution techniques
Where to apply the different categories of techniques?
Specification-based techniques are appropriate at all levels of testing (compo-
nent testing through to acceptance testing) where a specification exists.
Structure-based techniques can also be used at all levels of testing.
Developers use structure-based techniques in component testing and compo-
nent integration testing, especially where there is good tool support for code
coverage.
Experience-based techniques are used to complement specification-based
and structure-based techniques, and are also used when there is no specifica-
tion, or if the specification is inadequate or out of date.
Provide examples of specification-based techniques
- equivalence partitioning;
- boundary value analysis;
- decision tables;
- state transition testing.
Tell about Equivalence partitioning technique, please
Equivalence partitioning (EP) is a good all-round specification-based black-
box technique. It can be applied at any level of testing and is often a good tech-
nique to use first. It is a common sense approach to testing, so much so that
most testers practise it informally even though they may not realize it.
The idea behind the technique is to divide (i.e. to partition) a set of test con-
ditions into groups or sets that can be considered the same (i.e. the system
should handle them equivalently), hence ‘equivalence partitioning’.
Equivalence partitions are also known as equivalence classes - the two terms
mean exactly the same thing. The equivalence-partitioning technique then requires that we need test only
one condition from each partition.
What is an invalid partition?
Note that when we say a partition is ‘invalid’, it doesn’t mean that it repre-
sents a value that cannot be entered by a user or a value that the user isn’t sup-
posed to enter. It just means that it is not one of the expected inputs for this
particular field. The software should correctly handle values from the invalid
partition, by replying with an error message such as ‘Balance must be at least
$0.00’.
What is boundary value analysis?
Boundary value analysis (BVA) is based on testing at the boundaries between
partitions.
What is an open boundary?
This is called an ‘open boundary’, because one of the sides of the partition is left
open, i.e. not defined.
What is a boundary in respect of boundary value analysis?
With boundary value analysis, we think of the boundary as a dividing line
between two things. Hence we have a value on each side of the boundary (but
the boundary itself is not a value).
There is a school of thought that regards an actual value as a boundary
value. By tradition, these are the values in the valid partition (i.e. the values
specified). This approach then requires three values for every boundary two, so
you would have 0,1 and 2 for the left boundary, and 98, 99 and 100 for the right
boundary in this example. The boundary values are said to be ‘on and either
side of the boundary’ and the value that is ‘on’ the boundary is generally taken
to be in the valid partition.