Module 1
Module 1
Software Testing
● Bug Prevention
○ Bug Reporting
○ Debugging
○ Correction
○ Retesting
Review
Inspect &
Read the code
Do walkthroughs on the code & then do Testing
● Black Box Testing: Black box technique of testing in which the tester doesn’t
have access to the source code of the software and is conducted at the
software interface without any concern with the internal logical structure of the
software known as black-box testing.
● White-Box Testing: White box technique of testing in which the tester is
aware of the internal workings of the product, has access to its source code,
and is conducted by making sure that all internal operations are performed
according to the specifications is known as white box testing.
● Grey Box Testing: Grey Box technique is testing in which the testers should
have knowledge of implementation, however, they need not be experts.
Types of testing:
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
1. Unit Testing:
● Unit testing is the first level of software testing, which is used to test if software
modules are satisfying the given requirement or not.
● Unit testing involves analysing each unit or an individual component of the
software application. A unit component is an individual function or the smallest
testable part of the software.
● The primary purpose of executing unit testing is to validate unit components
with their performance and test the correctness of inaccessible code.
● Unit testing is also the first level of functional testing.
● Unit testing will help the test engineer and developers in order to understand
the base of code that makes them able to change defect causing code quickly.
The developers implement the unit.
○ Their roles are confused to be the same. But, there are differences in goals,
methods and psychology applied to these
7 A theory establishes what testing can do or Time, effort, how etc. depends on human ability
cannot do.
8 Test execution and design can be automated. Debugging - Automation is a dream.
Environment Unexpected
Environment
Model
Expected
Program
Program Tests Outcome
Model
Nature &
Bug Model
Psychology
Model For Testing:
It includes three models:
a model of the environment,
a model of the program and
a model of the expected bugs
a. Environment:
• A Program's environment is the hardware and software required to make
it run.
• For online systems, the environment may include communication lines,
other systems, terminals and operators.
• The environment also includes all programs that interact with and are
used to create the program under test - such as OS, linkage editor, loader,
compiler, utility routines.
c. Bugs:
• Bugs are more harmful than ever we expect them to be.
• An unexpected test result may lead us to change our notion of what a bug is
and our model of bugs.
• Some optimistic notions that many programmers or testers have about bugs
are usually unable to test effectively
The average number of test cases written per Test Case Effectiveness
2 40
requirement Failed Test Cases Percentage
3 Total no. of Test cases written for all requirements 200 Blocked Test Cases Percentage
12 Defects fixed 12
• Example of Software Test Metrics Calculation
Data retrieved during 1. Percentage test cases executed =
S No. Testing Metric test case
development (No of test cases executed / Total no of test cases written) x 100
1 No. of requirements 5
= (164 / 200) x 100
= 82
The average number of test cases written
2 40
per requirement
10 Defects accepted as valid by the dev team 15 4. Blocked Test Cases Percentage = (Total number of blocked tests
11 Defects deferred for future releases 5 / Total number of tests executed) x 100
= (4 / 164) * 100
12 Defects fixed 12
= 2.44
• Example of Software Test Metrics Calculation
Data retrieved during 5. Fixed Defects Percentage = (Total number of flaws fixed /
S No. Testing Metric test case
development Number of defects reported) x 100
1 No. of requirements 5
= (12 / 20) * 100
= 60
The average number of test cases written
2 40
per requirement
6. Accepted Defects Percentage = (Defects Accepted as Valid by
Total no. of Test cases written for all
3
requirements
200 Dev Team / Total Defects Reported) x 100
= (15 / 20) * 100
4 Total no. of Test cases executed 164
= 75
5 No. of Test cases unexecuted 36
6 No. of Test cases passed 100 7. Defects Deferred Percentage = (Defects deferred for future
releases / Total Defects Reported) x 100
7 No. of Test cases failed 60
= (5 / 20) * 100
8 No. of Test cases blocked 4 = 25
9 Total no. of defects identified 20
12 Defects fixed 12
Software Testing Tools
II. Logic Bugs: misunderstanding how case statements and logic operators behave,
e.g. Boolean expressions, logical expression
4. Coding Bugs
• Coding errors of all kinds can create any of the other kind of bugs.
• Includes syntax errors, may lead to many logic and coding bugs.
• The documentation bugs are also considered as coding bugs which may mislead the
maintenance programmers.
Tests require code that uses complicated scenarios & databases, to be executed.
Testing process is correct, but the criterion for judging software’s response to tests
is incorrect or impossible.
component
ii. Internal Interfaces
component
• External Interfaces: include devices, actuators, sensors, input terminals, printers, communication lines.
• Hardware Architecture Bugs: include address generation error, i/o device operation / instruction error, waiting too
long for a response, incorrect interrupt handling etc.
• Operating System Bugs: these are a combination of hardware architecture and interface bugs mostly caused by a
misunderstanding of what it is the operating system does.
• Software architecture bugs: Software architecture bugs are the kind that called - interactive.
• Control & Sequence bugs: include: missing, wrong, or redundant process steps, Ignored timing, assuming that events
occur in a specified sequence
• Resource management bugs: include: Wrong resource used, Resource is already in use, Resource dead lock etc
• Integration bugs: integration of the interfaces between, working and tested components.
1. Test Debugging:
Testing & Debugging tests, test scripts etc. Simpler when tests have localized affect.
Test execution bugs are eliminated by test execution automation tools & not using manual testing.