DYNAMIC Testing
DYNAMIC Testing
DYNAMIC Testing
Specification-based
Experience - based
• Equivalence Partitioning
• Decision tables
• One event can cause only one action, but that the same
event - from a different state - may cause a different action
and a different end state.
Use case testing
Use Cases
o Introduced by Ivar Jacobson
Use Cases
o Introduced by Ivar Jacobson
o Use Case - Use cases describe the behavior of the system when the
sends one particular stimulus
o Associations - Associations between actors and use cases are indicated
in use case diagrams by solid lines.
o System boundary - the system boundary defines the limits of the system,
any functionality within the scope of the system,
represented by a rectangle drawn around the use cases
Use case diagrams help exposing requirements and planning the project
Use cases are powerful tools for analysts to use when partitioning
the functionality of a system.
o Example of Use Case Diagram
• Use cases can uncover integration defects, that is, defects caused by
the incorrect interaction between different components.
• Particularly good for finding defects that the users are most likely to
come across when first using the system
Experience-Based Techniques
• Non-Systematic techniques
• Helps find those elusive defects that are hard to find using more
systematic approaches
Error guessing
Exploratory testing
Error guessing
• No rules
• Exploring, finding out about the software, what it does, what it doesn't do,
what works and what doesn't work
• Most useful when there are no or poor specifications and when time is
severely limited
• Test design and test execution activities are performed in parallel typically
without formally documenting the test conditions, test cases or test scripts
Scenario: If you take the train before 9:30 am or in the afternoon after
4:00 pm until 7:30 pm ('the rush hour'), you must pay full fare.
A saver ticket is available for trains between 9:30 am and 4:00 pm, and
after 7:30 pm.
What are the partitions and boundary values to test the train times for
ticket types? Which are valid partitions and which are invalid partitions?
What are the boundary values? (A table may be helpful to organize
your partitions and boundaries.)
Derive test cases for the partitions and boundaries.
Are there any questions you have about this 'requirement'? Is anything
unclear?
2. Decision table exercise
Scenario: If you hold an 'over 60s' rail card, you get a 34% discount on
whatever ticket you buy. If you are traveling with a child (under 16), you can
get a 50% discount on any ticket if you hold a family rail card, otherwise you
get a 10% discount. You can only hold one type of rail card.
Produce a decision table showing all the combinations of fare types and
resulting discounts and derive test cases from the decision table.
‘Coverage item' is whatever we have been able to count and see whether
a test has exercised or used this item
Drawbacks
• Coverage refers to the percentage of requirements that have been tested by a set
of tests when discussed by business analysts, system testers or users and is
measured by requirements management tool or a test management tool.
• Coverage from a programmers’ perspective refers to the coverage of code, where
the structural elements would be identified using a tool
• Statements and decision outcomes are both structures that can be measured in
code and there is good tool support for these coverage measures
• Safety-critical code; code that is vital to the correct operation of a system, and
complex pieces of code are all examples of where structure-based testing is
carried out
Statement coverage
• We first check the coverage and then design test cases to achieve 100%
coverage
EXAMPLE:
1 READ A
2 READ B
3 C =A + 2*B
4 IF C> 50 THEN
5 PRINT large C
6 ENDIF
Analyze the coverage of a set of tests on our six-statement program:
Test 4: A = 32, B = 26
Notice that we measured coverage first, and then designed a test to cover
the statement that we had not yet covered
Decision coverage
Example:
READ A
READB
I F A>BTHENC = 0
ENDIF
READ A
READ B
I F A>B THEN C = 0
ENDIF
READ B
A>B C=0
ENDIF
Other structure-based techniques
• Branch Coverage
• Condition coverage
• Path coverage