Pdf.1 Flashcards
tries to find differences between the specified
(expected) and the observed (actual) system behavior.
Goal: To design tests that will systematically find ______.
Testing
defects
_________ makes sure that we have built the right product.
We check that the system meets its stated _______ and each
system function derives from some requirement.
☞ _________ deal mainly with validation.
Validation
requirements
Acceptance tests
________ makes sure that we have built the product right.
We check the __________ by ensuring that each
function works correctly and has no defects.
☞ Most _____ is targeted at doing verification
Verification
quality of the implementation
testing
Testing cannot show the __________.
(But it can increase quality and confidence!)
absence of software errors.
It is impossible to completely test a ___________.
(Most systems will have bugs in them that either users uncover
or that are never uncovered!)
nontrivial system.
Testing is a __________.
(We try to make the software fail!)
destructive activity
It is often difficult for software engineers
to effectively test their ______.
(Since they have no incentive to make their software fail!)
own software
It is imperative to have a plan for testing
if we want to uncover as _____ as
possible in the _______ possible time
Design tests that have the _____ likelihood of finding
defects with the ______ amount of time and effort.
many defects
shortest
highest
minimum
A test plan specifies:
1. A _________: what tests to perform; how to perform them;
required test and code coverage; percentage that should
execute with a specific result.
- A _______ for the testing: when to run which tests.
- An estimate of ______ required: human/system.
testing strategy
schedule
resources
Key problem: choosing a test suite (input set) that is:
_______ enough to finish quickly;
_____ enough to validate and verify the software.
small
large
A program’s behaviour is the
_______ for ________ input sets.
“same”
“equivalent”
________ - A partition of the inputs into sets with the same behavior so that we
can test with one value from each set.
Two problems
1. The notion of same behaviour is _____.
______: execution equivalence
_________: revealing subdomains
- Discovering the sets of inputs requires perfect knowledge.
Need to use _______ to approximate the sets cheaply.
Ideal test suite
subtle
Naïve approach
Better approach
heuristics
We say a program has the “same behaviour” for two inputs if it
1. gives a ________ on both, or
2. gives an ___________ on both
correct result
incorrect result
A _________ is a subset of the set of possible inputs.
A subdomain is revealing for an error, E,
1. if each element in the subdomain has the __________.
2. if the program has error E, then it is _______ by the test.
subdomain
same behaviour
revealed
To partition the inputs/outputs into revealing subdomains we use _______ based on
– ____________ (i.e., the actual code).
– ______________ (e.g., requirements specification,
algorithm used, input/output data structures).
A good heuristic gives:
– _________
– for all errors in some class of errors E, ___________ that some
subdomain is revealing for E.
Different heuristics target different classes of errors.
– In practice, we usually combine __________.
heuristics
program-dependent information
program-independent information
few subdomains
high probability
multiple heuristics.
_______ is one way of testing the system.
test case
Basic steps of a test case
1. Choose _____________.
2. Define the ____________.
3. Run the ___________ and record the
_____.
4. Compare the _______________
input data/software configuration
expected outcome
program/method against the input, result
results against the expected outcome
__________
“testing-in-the-small”
Verify component logic based on data or control structures.
Test cases use knowledge of the _______________.
☞ Availability of source code is _________.
________
“testing-in-the-large”
Verify component functionality based on the inputs and outputs.
Test cases use knowledge of ______________.
☞ Availability of source code is ________.
Verify no _____________ after making a change.
Uses selective White Box and Black Box test cases.
White Box, internal workings of a component, required
Black Box, specified functionality of a component, not required
Regression
new defects are introduced
independent paths in the code at least once.
☞ __________
logical decisions on their true and false sides.
☞ ____________
loops at their boundaries and within their bounds.
☞ ___________
internal data structures to ensure their validity.
☞__________
Basis Path Testing
Condition Testing
Loop Testing
Data Flow Testing
BASIS PATH TESTING
Overview
1. From the code, draw a _____________.
2. Determine the ____________ of the flow graph.
3. Determine a basis set of ______________ based
on the cyclomatic complexity.
4. Prepare test cases that force the ___________ in
the basis set.
corresponding flow graph
cyclomatic complexity
linearly independent paths
execution of each path
BASIS PATH TESTING
Each circle represents one or more
____________
non-branching source code statements
BASIS PATH TESTING
___________ - A quantitative measure of the
logical complexity of the code.
- provides an upper bound on the
number of paths that need to be tested in the code
cyclomatic complexity V(G)
☞ V(G) = the number of _______ (areas bounded by nodes and
edges—area outside the graph is also a region)
☞ V(G) = the number of _______ - the number of ______ + 2
☞ V(G) = the number of _________ nodes + 1
regions
edges, nodes
(simple) predicate
BASIS PATH TESTING
__________. a path that introduces at least one new set of processing statements or a new condition.
☞An independent path must traverse at least _____ in the flow graph
that has not been traversed _______ the path is defined.
________. the set of linearly independent paths through the code.
☞A basis set in not unique.
Test cases derived from a basis set are guaranteed to execute every
statement at least one time during testing.
☞This is only the minimum number of test cases required.
Independent path
before
Basis set: