Lecture # 10 - Software Test Design Techniques - I
Lecture # 10 - Software Test Design Techniques - I
TESTING
LECTURE # 10
Case 1 – Username and password both were wrong. The user is shown
an error message.
Case 2 – Username is wrong, password is correct. The user is shown an
error message.
and so on.
State Transition Testing
Used where some aspect of the system can be described in
what is called a finite state machine.
This simply means that the system can be in a (finite) number
of different states, and the transitions from one state to
another are determined by the rules of the 'machine'.
This is the model on which the system and the tests are based.
Any system where you get a different output for the same
input, depending on what has happened before, is a finite state
system.
A finite state system is often shown as a state diagram.
State Transition Testing
State Transition Testing - Example
If you request to withdraw $100 from a bank ATM, you may
be given cash.
Later you may make exactly the same request but be refused
the money (because your balance is insufficient).
This later refusal is because the state of your bank account has
changed from having sufficient funds to cover the withdrawal
to having insufficient funds. The transaction that caused your
account to change its state was probably the earlier
withdrawal.
A state diagram can represent a model from the point of view
of the system, the account or the customer.
Exploratory Testing
Exploratory testing is a
simultaneous learning, test
design, and test execution
process.
In this testing, test planning,
analysis, design and test
execution, are all done together
and instantly.
This testing is about exploring
the system and encouraging
real-time and practical thinking
of a tester.
Exploratory versus Scripted
Testing
Think of scripted testing as
taking a train. It's on rails. It
will never deviate from that
path.
Exploratory testing is more
like driving a car. Your
general goal is to get from
point A to B, but you can take
any path and deviation that
catches your eye along the
way.
Exploratory Testing - Example
Test the “Edit Bookmark” functional area in a product.
There are two possible scenarios for your assignment:
1. Execute a test run
2. Perform exploratory testing of the “Edit Bookmark”
functional area.
In the first scenario, you would follow the steps outlined in the test
case to verify that each step works, reporting any bugs that are
found. But what if a critical bug — such as a crash, or data loss —
doesn’t occur during these steps?
You won’t find it.
Exploratory Testing - Example
In the second scenario, you explore or “test around”
editing bookmarks. At first, you might perform the same steps
as at the beginning of the test case. As testing progresses,
however, you might ask, “What happens when I click Edit,
delete the name, and try to save the bookmark with a blank
field?” Boom! The application crashes and deletes all of the
user data. You just found the most important bug by exploring
something that wasn’t a step in the test case.
Exploratory Testing v/s Ad-hoc
Testing
Exploratory Testing Ad-hoc Testing
Scenario # 1: If a = 5, b = 4
Scenario # 1: If a = 7
Total number of
decisions = 2
Decision Testing and Coverage
One more scenario is required to get 100% decision coverage.
It is important to note that 100% decision coverage
implies 100% statement coverage. (but not vice versa)
Decision v/s Coverage
To achieve 100% statement coverage of this
code segment just one test case is required, one
which ensures that variable A contains a value
that is greater than the value of variable B, for Read A
Read B
example, A = 12 and B = 10 If A > B
However, decision coverage requires each Then C = 0
End If
decision to have had both a True and False
outcome. Therefore, to achieve 100% decision
coverage, a second test case is necessary where
A is less than or equal to B. This will ensure
that the decision statement 'IF A > B' has a
False outcome.
Check your knowledge
One of the most important test goals
for your project is to have 100%
decision coverage. Therefore, we
have to execute the following three
tests for the control flow graph
shown.
Test01 covers path: A, B, D, E, G
Test02 covers path: A, B, D, E, F, G
Test03 covers path: A, C, F, C, F, C, F,
G
Check your knowledge
Which of the following
statements relating to the decision
coverage goal is TRUE?
Decision D has not been tested
completely.
100% decision coverage has been
achieved.
Decision E has not been tested
completely.
Decision F has not been tested
completely.
Check your knowledge
Why are both specification-based and structure-based testing
techniques useful?
They find different types of defects.
Using more techniques is always better.
Both find the same types of defects.
Because specifications tend to be unstructured.
Check your knowledge
Why are both specification-based and structure-based testing
techniques useful?
They find different types of defects.
Using more techniques is always better.
Both find the same types of defects.
Because specifications tend to be unstructured.
Check your knowledge
What is a key characteristic of structure-based testing
techniques?
They are mainly used to assess the structure of a specification.
They are used both to measure coverage and to design tests to
increase coverage.
They are based on the skills and experience of the tester.
They use a formal or informal model of the software or
component.