Software Testing: Zeeshan Ali Rana
Software Testing: Zeeshan Ali Rana
Note that we have made only one test case instead of three separate test
cases to check ABC in valid range. This one test could be any test cases with
any valid combination of A, B, C; for example see any of the valid range based
test cases.
Test cases based on equivalence classes within valid range
TC Id What to test A B C EO
1 EC 1 15 15 15 Equilateral
2 EC 2 10 20 10 Isosceles
3 EC 3 5 6 7 Scalene
4 EC 4 1 2 10 Not a triangle
Whitebox Testing
Control Flow Graph
Cyclomatic Complexity = E – N + 2 = 9 – 9 + 2 = 2
Statement testing
Branch testing
Path testing
…
Example
MxN?
M?
N?
M=N=100,000?
Levels of Testing
Module testing, component testing, or unit testing
Integration testing
System Testing
Function testing
Performance testing
Acceptance testing
Installation testing
Levels of Testing
Testing Organization Illustrated
Unit Testing
Code Review
Code walkthrough
Code inspection
Unit Testing
Testing the unit for correct functionality
Testing the unit for correct execution
Unit Testing
Steps in Testing
Requirements Documentation
Faults Design Faults Code Faults Faults
Reviews Fair Excellent Excellent Good
Prototypes Good Fair Fair Not applicable
Testing Poor Poor Good Fair
Correctness Proofs Poor Poor Fair Fair
Integration Testing
Big-bang
Bottom-up
Top-down
Sandwich testing
Integration Testing
Terminology
Component Driver: a routine that calls a particular
component and passes a test case to it
Stub: a special-purpose program to simulate the
activity of the missing component
Integration
Testing
System viewed as a hierarchy of components
Integration Testing
Bing-Bang Integration Example
All components integrated at once
Locating faults?
Integration Testing
Top-Down Integration Example
Only A is tested by itself
Stubs of B, C and D are used at first level
N-1 stubs required (N=Number of nodes)
Locating faults?
Integration Testing
Top-Down Integration Example
Integration Testing
Bottom-Up Integration Example
Drivers are used to call the child functions
Drivers are relatively intelligent
N - leaves drivers
Locating faults?
Integration Testing
Bottom-Up Integration Example
Integration Testing
Sandwich Integration Example
Viewed system as three layers
Employ BU where
writing drivers is
not costly
Employ TD where
stubs are easier to
Write
Locating faults?
Integration Testing
Call-Graph Based Testing
• Adjacency Matrix
• NxN matrix that tells which components call the other
components
• Pairwise Integration
• Test each pair (i.e. each edge)
• E testing sessions
• Neighborhood based Integration
• Integrate each neighborhood
• The nodes at one edge distance from the node to be
integrated
• N-sink nodes sessions
System Testing
System is tested as a whole
Different types of testing considered during System Testing:
- Functional Testing (GUI) - Scalability
- Performance Testing - Sanity
- Usability - Smoke
- Load - Regression
- Volume - Compatibility
- Stress - Installation
- Security - Ad hoc
Steps to do System Testing
The following steps are important to perform System Testing:
Step 1: Create a System Test Plan
Step 2: Create Test Cases
Step 3: Carefully Build Data used as Input for System Testing
Step 3: If applicable create scripts to
- Build environment and
- to automate Execution of test cases
Step 4: Execute the test cases
Step 5: Fix the bugs if any and re test the code
Step 6: Repeat the test cycle as necessary
Principles of System Testing
Regression Testing
Identifies new faults that may have been introduced as
current one are being corrected
Verifies a new version or release still performs the
same functions in the same manner as an older version
or release
Principles of System Testing
Regression Testing Steps
Inserting the new code
Testing functions known to be affected by the new
code
Testing essential function of m to verify that they still
work properly
Continuing function testing m + 1
Principles of System Testing
Configuration Management
Versions and releases
Production system vs. development system
Deltas, separate files and conditional compilation
Change control
Acceptance Tests
Purpose and Roles
Enable the customers and users to determine if the
built system meets their needs and expectations
Written, conducted and evaluated by the customers
Acceptance Tests
Types of Acceptance Tests
Pilot test: install on experimental basis
Alpha test: in-house test
Beta test: customer pilot
Parallel testing: new system operates in parallel with
old system
Result of Acceptance Tests
List of requirements that
are not satisfied
must be deleted
must be revised
must be added
Installation Testing
Before the testing
Configure the system
Attach proper number and kind of devices
Establish communication with other system
The testing
Regression tests: to verify that the system has been
installed properly and works
Software Testing Tools
Automated Testing Tools
Selenium, QTP, SilkTest, WinRunner, LoadRunner,
Jmeter
Testing Management Tools
TestManager, TestDirector
Bug Tracking/Configuration Management Tools
Bugzilla, Jitterbug, SilkRadar
When to Stop Testing
No time left
No money left
Statistical Criteria
Number of defects found per week becomes lower
than a set threshold
Test Planning
Establish test objectives
Design and Write test cases
Test test cases
Execute tests
Evaluate test results
Test Planning
Purpose of the Plan
Test plan explains
who does the testing
why the tests are performed
how tests are conducted
when the tests are scheduled
Test Planning
Contents of the Plan
What the test objectives are
How the test will be run
What criteria will be used to determine when the
testing is complete
Test Documentation
Test plan: describes system and plan for exercising all
functions and characteristics
Test specification and evaluation: details each test
and defines criteria for evaluating each feature
Test description: test data and procedures for each
test
Test analysis report: results of each test
Test Documentation
Documents Produced During Testing
Test Documentation
Test Plan
The plan begins by stating its objectives, which should
guide the management of testing
guide the technical effort required during testing
establish test planning and scheduling
explain the nature and extent of each test
explain how the test will completely evaluate system
function and performance
document test input, specific test procedures, and
expected outcomes
Test Documentation
Parts of a Test Plan
Testing Documentation
Test-Requirement Correspondence Chart
Requirement 2.4.1: Requirement 2.4.2: Requirement 2.4.3:
Generate and Selectively Retrieve Produced Specialized
Test Maintain Database Data Reports
2. Add field X
3. Change field X
4. Delete record X
5. Delete field X
6. Create index X
Retrieve record with a
requested
7. Cell number X
8. Water height X
9. Canopy height X