7 1SoftwareTesting
7 1SoftwareTesting
1
Software Testing
Testing is the process of exercising a program with the specific intent
of finding errors prior to delivery to the end user.
What Testing Shows
errors
requirements conformance
performance
an indication
of quality
2
Who Tests the Software?
Developer Tester
Understands the system but, Must learn about the system, but, will
will test "gently“ and, is driven attempt to break it and, is driven by
by "delivery" quality
3
Testing Strategy
System test
User Acceptance test
results
module
to be
tested
Interface
local data structures
Software boundary conditions
Engineer independent paths
test cases error handling paths
5
Integration Testing Strategies
6
Top Down Integration Bottom-Up Integration
A top module is tested with A
stubs
B F G B F G
cluster
Test stub to simulate the behaviors of software components that a module undergoing
tests depends on.
A Driver is to simulate the behavior of the upper level modules that are not yet
integrated. 7
Sandwich Testing
A
Top modules are
tested with stubs
B F G
C
Worker modules are grouped into
builds and integrated
D E
cluster
8
OOT Strategy
Class testing is the equivalent of unit testing
– Operations within the class are tested
– The state behavior of the class is examined
9
Smoke Testing
Is a type of software testing that comprises of a non-exhaustive set of tests that aim
at ensuring that the most important functions work.
The result of this testing is used to decide if a build is stable enough to proceed
with further testing. A common approach for creating “daily builds” for product
software
Smoke testing steps:
1. Software components that are translated into code are integrated into a “build.”
– A build includes all data files, libraries, reusable modules, and engineered
components that are required to implement one or more product functions.
§ A series of tests is designed to expose errors that will keep the build from properly
performing its function.
– The intent should be to uncover “show stopper” errors that have the highest
likelihood of throwing the software project behind schedule
§ The build is integrated with other builds and the entire product (in its current form)
is smoke tested daily.
1. The integration approach may be
top down or bottom up.
10
Software Testing: Definition
The execution of software for purposes of validation and verification
A test case is the tuple (i,o),where i is the test data and o=S(i) and S the
software under test.
Test Cases Example
Spec of software to test: capitalize a given word.
Set of 5 test data:
Spurs, Tottenham Hotspur, keaneR, spurs3, spurs Rule OK
• Corresponding test case are the 5 tuples:
– (Spurs, SPURS),
– (Tottenham Hotspur, error),
– (keaneR , KEANER),
– (spurs3, SPURS3),
– (spurs Rule OK, error)
11
Some really boring observations
It is impossible to completely test any nontrivial module or any system
Testing can only show the presence of bugs, not their absence (Dijkstra)
12
Good testing takes creativity
Testing is done best by independent testers
Programmers often stick to the data set that makes the program work
Testing in development
Component testing
– Unit or module testing
– Integration testing
Functional testing: to validate the software against the functional rqts.
System testing
13
Testing after development
Acceptance testing: Formal testing conducted to determine whether or not a
system satisfies its acceptance criteria and to enable the acquirer to determine
whether or not to accept the system.
Acceptance testing is a final stage of testing that is performed on a system before the
system being delivered to a live environment.
The acceptance testing process is designed to replicate the anticipated real-life use of
the product to ensure that what the consumer or end user receives is fully functional
and meets their needs and expectations.
14
Testing after development
Alpha test: A preliminary, in-house testing of a product to
discover obvious faults.
15
Testing after development
Beta test: Typically the last step in the testing of a product before
it is officially released. A beta test is often conducted with
customers in their offices.
– Beta testing is the last stage of testing and one of the Acceptance
Testing types
17
Testing Methods
2. Static Testing ("Dry Run Testing") tests the software that isn't actually used.
Syntax checking and manually reading the code to find errors are methods of
static testing.
Is mostly used by the developer (who designed or code the module).
It is usually the first type of testing done on any system (done as unit
testing).
'Static testing' is generally not taken as detailed testing, but checks mainly for
the sanity of the code/algorithm, and to assess if program is ready for more
detailed testing, where methods like code review, inspection and walkthrough
are used.
Static testing also applies to White box testing techniques.
18
Testing Methods, Cont…
4. Statistical Testing:
– Developers can utilize well-known statistics to direct the application of
testing, thereby reducing redundant testing,
19
Project Name:
Test Case Template
Step Test Steps Test Data Expected Result Actual Result Status (Pass/Fail) Notes
1 Navigate to login page User= [email protected] User should be able to login User is navigated to Pass
2 Provide valid username Password: 1234 dashboard with successful
3 Provide valid password login
4 Click on Login button
Post-conditions:
User is validated with database and successfully login to account. The account session details are logged in database.
Regression testing
Retesting to ensure previously working code does not fail as a result of
changes. Should be applied irrespective of testing strategy or method.
21
Exhaustive Testing
53 binary conditions
1 condition with 3 options
2^53 *3= 9,007,199,254,740,992*3 = 207,021,597,764,222,976 possible
combinations of conditions
At one second per test execution: 856,849,244 years to test all possible combinations.22
Selective Testing
Selected path
loop < 20 X
23
White-Box Testing
White-box testing involves testing the independent logic paths with full
implementation knowledge.
24
References