Software Testing
EDITION : 2019
A ee)
——
Cae ao |
a
ac
CF |As per Revised Sylobus of
MSBTE - I SCHEME
Software Testing
1. ¥, Diploma (Semester - V)
Computer Engineering Group (CO/CM/CW)
Mrs. Anuradha A. Puntambekar
M.E. (Computer)
Formerly Assistant Professor in
PES. Moder College of Engineering,
Pune
Vaishali Rane
B.E., ME. (CMPN)
HOD (Compvier Engineering},
Thokur Polytechnic
Thokur Complex, Kandivali £, Mumbai-401 101
Nilesh J, Vispute
MTech. (Computer Science)
Senior Lecturer,
Pravin Rohidas Patil Polytechnic
Miro Bhayandar, Mumbai 401105
== TECHNICAL
2 PUBLICATIONS Wott: watieriabpebloafon.og
An Up-Thrust for Knowledge tips;/www facobo0% carvtechnicalputcatons
oSoftware Testing
T. ¥. Diploma (Semester - V)
Computer Engineering Group (CO/CM/CW)
Fiat Edo June 2019
© Copyright with A.A. Puntambekar, Veisheli Rane
All publishing nghts (printed and ebook version) reserved with Technical Publications. Ne part of thie book
should be reproduced in any form, Electronic, Mechericel, Photocapy or any information storage and
retviovel eystom without prior permission in writing, from Technical Publicatione, Pune.
Published by Ant Rooney Once Me 412, Sia) Pa Pie 4100, we
TECHNICAL 20 si. Str Se SEPP OG BN,
PEGLIGATICHS, £9! “ssssieisiapalsitrasy Waste | wvetemaquieawnssn
Printer +
hdc nda Exe, Nanded Vag Row
TER Dat Pine 41108
Price: © 85/-
ISBN 974-93-80180-04-6
Il ey |
sere |
9769309180046 [1] “PREFACE
The importance of Software Testing is well known in various engineering fields
Overwhelming respondse to our books on various subjects Inspired us to write this book.
The book is structured to cover the key aspects of the subject Software Testing.
The ook uses plain, lucid language to explain fundamentals of this subject. The book
provides logical method of explaining various complicated concepts and stepwise
methods to explain the important topics. Each chapter is well supported with necessary
illustrations, practical examples and solved problems, All chapters in this book are
arranged in a proper sequence that permits each topic to build upon earlier studies. All
care has been taken to make students comfortable in understanding the basic concepts
of this subject
Representative questions have been added at the end of each section to help the
students in picking important points from that section.
The book not only covers the entire scope of the subject but explains the philosophy of
the subject. This makes the understanding of this subject more clear and makes it more
interesting. The book will be very useful not only to the students but also to the subject
teachers. The students have to omit nothing and possibly have to cover nothing more.
We wish to express our profound thanks (0 all those who helped in making this boo8 a
reality. Much needed moral support and encouragement is provided on numerous
occasions by our whole family. We wish to thank the Publisher and the entire team of
Technical Publications who have taken immense pain to get this book in time with
quality printing
Any suggestion for the improvement of the book will be acknowledged and well
appreciated
Authors
A.A. Puntanbehar
Vaishalt Rane
Nilesh (). Dispute
Dedteated ts God.
‘SYLLABUS
Software Testing (22518)
‘Tesening Seneme] Crecit Examination Sehome
eras Theor Prectcal
ttre Paper| ESE PA Total ESE PA Total
°° Tyeax| min [wax [ao [max] win | wax [ ain | mex | in| ax | in
s[-[e[s 3 | 7 | 2 | | |r] «o | ase] 10 | 25 | 10 | 50 | 20
Unit Unit Outcomes (UOs) Topies and Sub-topics
{in cognitive domain)
Unit Je, Kenly exrors and bugs in the | 1.1 Software Testing, Objectives of Testing
basics of ven program 1.2. Failure, Error, Fault, Defect, Bug
Soiwrare, | b+ Prepare test case for tho given Terminology.
Testing and application 13 Test Case, When to Start and Stop
Testing | tc. Describe the Fntry and fit ‘Testing of Software (Entry and Fxlt
Methods Criteria for the given test Criteria.
application LA. Yorilicetion and Validation (V Mode),
Je. Validate the given application Quality Assurance, Quality Control
using, V model in relation with | 1.5 Methods of Testing: Static and dynamic
quality assurance. Testing
Je. Describe features of the given | 1.5 The box approach : White ox Testing,
testing method. Inspections, Walkthroughs, Technical
Reviews, Functional Testing, Code
Coverage Testing, Code Complexity
Testing
17 Black Box Testing: Requirement Based
Testing, Boundary Value Analysis,
Equivalence Partitioning,
nt-t | 20 Apps, specified testing evel | 2.1 Levels of testing
far the given web base it Testing» aver, Be
Teal | nce 2 ymin Tot Tope
el 4 , 2.2. Integration Testing: Top-Down
Testing 2b Apply Acceptance testing for Integration, Bottom-Up_ Integration
sgiven web based application
2e Apply the given performance | 9 3
testing for the specified
Bi-Directional Integration
Testing on Web Application
4 Peformance Testing : Load Testing,
application, Stross Testing, Security Testing,
femerate test cases for the Client-Server Testing
given application using | 2.4 acceptance Testing : Alpha Testing and
regression and GUI testing Beta Testing, Special Tests : Regression
Testing, GLI testingUnit. 3a, Prepare test plan for the given | 3 Test Planoning + Preparing a Test Plan,
application Deciding Test Approach Setting, Up
Nest 3b Identify the: resource Criteria for testing, —_ identifying
‘Management TRDiRaGi (GF Ke eR Responsibilities, Staffing, Resource
ect ® Requirements, Test Deliverables, Testing
application Res
3c. Prepare test cases for the given
Mopars test ass for he 08] 39 Tay Managment > Test. Infastractre
Sa eee xt or exceutca | -Matagement Test People Management
Prepare test sepoe of e@euled | 5.5 esr Propein + Base Linki Test PRL
pe tite, BISA ‘Test Case specification.
34 Test Reporting : Executing Test Cases,
Preparing Test Sunumary Report
Unit-1v | a, Classify defects on the basis
eer cotimated impact 4.1 Defect Classification, Defect
Marre ae | ab. Prepare defect template on the] Management Process
given application. 4.2 Defect Life Cycle, Defect Template
4e Apply defect management | 4.3 Estimate Expected Impact of a Defect,
process on the given Techniques for finding Defects,
application, Reporting a Defect
4d. Wirite procedure to find defect
using the given technique,
urit-¥ | 53, improve testing efficiency | 5:1 Manual Testing and Need for
Testing Took sing automated too! for xiven ‘Automated Testing, Tools
ering Toots application 52 Advantages and Disadvantages of Using
Meas nents | 5b Identity. ditterent testing. tools Toul
wo test the given application. | 5.3. selecting « Testing Tool
Se Describe Metrics andl! 5.4 Whon to Use Automated Tast Tool,
Meagurement for the iven Testing Using Automated Tools
iain etrics anc easurement s
Sa) Repliin Objet ‘crates wisece'| 7 “Mews and Measurement i: Types: of
used in the given testing
application,
‘Metrics, Product Metrics and “Process
Metrics, Object oriented metrics in
testing
oChapter - 4
12
13
TABLE OF CONTENTS
Basics of Software testing and
Testing Methods (1 - 1) to (1 = 20)
Software Testing.
1
LL Definition
1.1.2. Objectives of Software Testing.
113. Principles of
114 Skills oFSonware Tester
Failure, Error, Fault, Defect, Bug Terminology 1 -2
Test Case. . 1-2
LBL What is Test Case ?
13.2. Features of Test Cases.
When to Start and Step Testing of Software ?
Verification and Validation, Quality Assurance,
‘Quality Control
1.4.1. Verification and Validation (V Model).
14.1. Verification
Quality Assurance,
Quality Control
1.4.5. Difference between Quality Assurance and
Quality Control
Methods of Testing
LS.1. Static Testing
1.5.2. Dynamic Testn 1-8
‘The Box Approach 1-8
16.1 White Box Testing
wo
1.6.1.1 Inspections
1.6.1.2 Walkthrough
1.6.1.3 Technieal Reviews
1.6.1.4 Unit’Code Functional Testi
1.6.1.5 Cae Coverage Testing
16.1.6 Cote Complexity Testing
1.7 Black Box Testing. ..
LT. Requirement Based Testing
1.7.2. Boundaty Value Analysis
1.7.3. Equivalence Partition
LIA. Dilference between Black Box and White Box
Testing,
Uni Il
Chapter-2 Types and Levels of Testing
(2-1) to (2
2A Levels of Test
22 Unit Testing
Errors Identified during Unit Testing
Unit Testing and Debugging,
Driverand Stub.
Integration Testing
23.1 Top Down Integration
2 Bottom Up Integration
3. Bi-Directional Integration.
Testing on Web Application
24.1 Performance Testing
Process for Performance Testing,
Load Testing
Stress Testing,
2.4.5. Security Testing
20
= 16)24.6 Clicnt Server Testing 2-1 AU tee a
2:5 Acceptance Testin
; " Chapter-4 Defect Management
25.1 Alpha Testing (4-1) to (4-8)
2.52 Bota Testin
* 41 Defect Classification and Management. ......4=1
2.6 Special Tests .. sevecnenceoml ALL Defect Classification an
2.6.1 Regression Testing 2-14 4.1.2 Defect Management 4-2
262. GUT Testing “14
4.2 Defect Life Cycle and Template 4-4
2.2 Defect Template a4
Chapter-3 Test Management
(3-1) to (3-12) 43° Impact, Technique and Reporting verre
Estimate Expected Impact of a Defect ....4-S
Test Planning. commencement m "
43.2 ‘Techniques for Finding Defects 4-6
3.1.1 Preparing a Test Plan 3-1
43.3 Reporting a Defect 4-6
2 Deciding Test Approach
rin for Testing
3.1.4 [dentilying Responsibilities, Staffing and Chapter-5 Testing Tools and Measurements
Training Needs 3-2 eee
3.1.5. Identifying Resource Requirements ......3
5.1 Manual Testing and Need for Automated
3.1.6 ldemiffing Test Deliverables 3-3 fae
SALT Testing Tasks 3-3 5.1 Manual Testing
feaTgSiaH cctueecded 5.1.2 Advantages of Manual Testing
32.) Tost Ininscture Managemen a Disedvantages of Manual Testing / Limitation
of Manual T
sting. 5
3.22, Test People Management
S14 Comparison between Manual Testing and
3.3 Test Process. 3-6 Automation Testing, 5-3
ie 5.1.5 Need of Automated Testing Tools 5-3
5.1.6 Why Automated Testing 772 5-4
3-6
5-6 Advantages and Disadvantages of using Tools.
2.1 Advantage
34 Test Report 3-1
34.) Test Incident Report 3-11
3.4.2 Test Cyele Report 3-11
3.43 Preparing Test Summary Report 3-11 | 83° Selecting a Testing Too!vit
54 When 10 use Automated Test Tools, Testi
using Automated Tool 25-10
SA.1_ When Does Test Automation Make Sense ?
SA2 Testing using Automated Tools
(Test Automation).
25-11
5.5 Metrics and Measurement : Types of Metrics,
Product Motries and Process Metries, Object
Oriented Metries in Testing su
SS. Metros s-12
5.5.2. Whatis Software Test Measurement ?.,.5~13
553. Types of Metrics sei4
1 Types of Manual Test Meties ...., 5+
5.5.3.2 Examples of Software Testing Metrics
aseastenniee 3-14
Product Metics and Process Metrics, Object
Oriented Metres in Testing 5-15
5.54.1 Product motries and Process metrics 5-15
5.5.4.2 Object Oriented Metries s
Solved Sample Papers . s(S-1)to(S-4)
* TECHNICAL PUBLICATIONS" Anup rimeUNIT
Basics of Software Testing
and Testing Methods
[EA sottware Testing
1] Definition
« Testing is defined as execution of work product
with an intent to find the defect.
«Testing is a process of uncovering as many errors as
possible.
Testing is used to confirm that a program performs
its intended functions correctly.
[Objectives of Software Testing
Following are objectives of software testing ~
1) Testing should find the defects before customer
finds them out
2) ‘Testing should be applied all through the software
life cycle.
3) The testing must be conducted with some goal or
4) Testing must prevent the defects.
5) Tests the tests firsts.
6) During testing, find the scenario where the product
docs not perform as per the requirements and
perform testing there.
7) During testing, find the scenario where product
does things that it is not supposed to do.
8) Testing must be a fine balance of defect prevention
and defect detection.
[£3] Principles of Testing
‘The fundamental principles of testing are-
1
The goal of testing is to find the defects before
customer finds them out,
2. Always understand the reason behind the testing.
3. Testing is to be carried out throughout the
software life cycle anc not simply at the end of the
software development process.
First; test the test cases adopted for testing,
Testing encompasses defect prevention
Testing should help for both defect prevention and
defect detection
Testing is a process that need to be carried out
constantly.
Exhaustive testing is mot possible. During the
testing of the program, only the presence of defects
can be shown and not their absence.
‘The testing activity must be done with intelligent
and systematic automation tool.
10. Testing requires talented, committed staff who
possess the ability to work in a team.
[EEG] suns of sonware Tester
Following skills are required by software tester —
1) Analytical Skills :
+ Analytical skills are those skills that help to break
up a complex software system into smaller units to
gain bottor understanding of the system.
+ This Kind of skill also helps in creating appropriate
test cases.
2)Communication Skills:
+A software tester must have verbal as well as
written communication skills
+ He/she should be a good listener.
+ He should be able to convince the need for testing
the module to developer as well as customer.
anSoftee Testing
2 Basics of Sone Testing and Testing Methods
3) Presentation Skills
+ A good tester must also possess good presentation
skills to provide the exact status of the test project
and application under test.
+ The tester is supposed to present the test results to
developer team, customer and management team
and convince them for further improvements.
4) Technical
+ A good tester must have the knowledge of database,
programming, and commends.
+ HelShe should have knowledge and hands on
experience of test management
automation tools.
+ HelShe should be
techniques and skills required for testing,
tools, and
enthusiastic to lear new
'5) Management and Organization Skills:
+ Testing at times could be a demanding job
especially during the release of code.
oA manage
workload, have high productivity, exhibit optimal
software tester must _cificiently
time management, and organization skills.
Boord Questions
List all objectives of testing.
2. What is software testing ? State objectives of software
testing.
3. State any four testing principles.
CSR
4, Define software testing. List all skills of software
List and describe any four skills of softtoare tester
6. Define software testing and role of testi
Caso
71.2] Failure, Error. Fault, Defect, Bug Terminology
Following are some important terminologies used in
relation with software testing -
Mistake : It is an issue or a problem identified during
peer reviewing, It is of low cost and can be fixed
quickly.
Error: It is an issue identified internally or during unit
testing. Normally error occurs when human actions
produce undesirable results
Defect : It is an issue identified by customer.
Bug : Bug is an initiation of error or problem because
of which the fault may occur in the system.
Fault : It is a condition that causes the software to fail
to perform its required function.
Failure : It is the inability of a system or component to
perform required function
specification,
according to its
Board Question
1. Explain the terms mistake, error, defect, bug, fault and
failure in relation with software testing.
AT
7a] Test Case
A Test case is a set of conditions and expected results,
under which a tester will determine whether a system
under test satisfies requirements or works correctly.
Test cases are normally designed for particular test
scenario in order to verify compliance against a
specific requirement.
Various parameters using which the test case is
prepared are ~
1) Test case ID ; It is an ID for the test case
2) Test case scenario : The description of the scenario
for which the test case is to be prepared
3) Test case description : The purpose of the test case
is described under this section
4) Prerequisites +
fulfilled before execution of the test case must be
mentioned here,
Any precondition that must be
5) Test procedure : The siep by step procedure that
demonstrates the testing procedure.
6) Test data : The data to be used while conducting,
the test,
7) Expected result : The expected result of the test
Technica Publatene An tas frkronieageSoftore Testing
1-3
Basis of Softoure Testing end Testing Metis
8) Actual result: Actual result of the test which is to
be filled after executing the test
9) Status : The status can be PASS or FAIL or being a
test passed or failed.
[Eid] reatures of Test Cases
1. Test cases must be simple and transparent.
Do not assume functionalities and some extra
features for test case design.
3. Avoid repetition of test cases,
4. Test cases must be identifiable,
5. Create test case by keeping end user in mind.
When to Start and Stop Testing of Software ?
Entry criteria
+ Software testing should start early in the Software
Development Life Cycle. This helps to capture and
eliminate defects in the early stages of SDLC Le
requirement gathering and design phases.
+ An early start to testing helps to reduce the number
of defects and ultimately the rework cost in the end.
+ Definition : Entry criteria for testing can be defined
as “Specific conditions or on-going, activities that
must be present before a process can begin.” ‘The
Software Testing Life Cycle (STLC) specifies the
entry criteria required during each testing phase.
+ It also defines the time interval or the expected
amount of lead-time to make the entry criteria item
available to the process.
+ Following are the inputs necessary for the entry
criteria —
© The requirements documents
© Complete understanding of the application flow
© Test plan
Exit criteria
+ Definition : It can be defined as “The specific
jes that should be
conditions or on-going acti
fulfilled before completing the software testing life
cycle.”
+ The exit criteria can identify the intermediate
deliverables,
+ The following exit criteria should be considered for
completion of a testing phase
©. Ensuring all critical Test Cases are passed
©. Achieving complete Functional Coverage
© Identifying and fixing all the high-priority
defects
+ The output achioved through exit criteria are —
© Test summary report
© Test logs
Board Questions,
1. What is a
parameter.
est case’? Stale its is ification
2. What is entry and exit criteria of software testing ?
CSSA
3. Explain when to start ana stop testing
SSE
[Ea] verincation ana vaiaation, quality Assurance,
‘Quality Control
TAA] Verification and Validation (V Model)
+ ‘The software verification and validation is a
checking and analysis process of developing
software.
+ In V and V requirements review, design review,
code inspection and testing are the various activities
that are conducted,
+ Boehm has described the verification and validation
© Verification means asking "Are we building the
right product 2°
© Validation means asking “Are we building the
product right 2”
tat
Verification
+ Verification is a technique of evaluating whether
soitware product fulfills the requirements or
conditions imposed on them by standards and
processes.
+ This a static technique as there is no execution of
code or product. During verification, the work
‘Anup trae or nowteegeSafle Testing
product is carefully read and analyzed for detecting,
defects with respect to standard processes,
‘© Verification criteria : The verification is to ensure
whether the program running on a_ particular
platform ic the and
development processes.
sati requirements
‘Advantages
1. Each work product is analyzed for finding out the
defects, Hence it reduces the cost of finding and
fixing the defects from the system as a whole.
2. Verification confirms that during the development
of work product the software
processes are correctly followed
development
3. People can be trained for verification process as
there is no execution of code or product.
4. The defects can be located fasters as the individual
work productis getting analyzed,
Disadvantages
1. The verification process simply confirms that the
development process is completely followed or not,
it does not show whether the developed software
product is correct or not,
2. ‘The defects during the execution of work product
cannot be detected by verification
Taz
Validation
+ Volidation is a technique, to evaluate whether the
final built software product fulfils the customer
requirements.
‘+ It isalso called as dynamic testing as the application,
is executed during validation in order to find out
the defects
+ Normally the
independent users and functional experts
validation must be done
by
Advantages
1. Validation is the only to get ensured about the
functioning of the software product. Velidation
help to test the system during the execution.
2 The defects that can not be identified during
verification can be identified during validation
14
Basic of Suftware Testing ad Testing Methods
Disadvantages
1. The validation is the most time consuming process
because its aim is. to execute the
application/software or code and hence as a result
‘more test cases are needed to execute.
2. The cost of the product may get increased due to
validation as validation process is during. the
execution of the work product. The bugs fixed in
later stage of software development can result in
increase of cost.
Difference between Verification and Validation
Validation.
St
No.
Verification
Validation refers to
the sot of activities
that ensure that the
1. Verification refers to
the set of activities that
ensure software
conectly implements _ software that has been
the specific function. built is_traceable to
customer
requirements.
2, After a valid and Validation begins as
complete specification soon as project starts.
the verification starts
3, Verification is for Validation is for
prevention of errors. detection of errors.
4, Verification is Validation is
conducted using conducted using.
reviews, system testing user
walkthroughs, interface testing and
inspections and stress testing.
audits,
5. Verification is also. Validation canbe
termed as white box — termed as black box
testing oF static testing testing or dynamic
as work product goes testing as work:
through reviews, product is executed.
‘Validation finds about
20 to 30 % of the
defects.
Validation is based on
6, Verification finds
about 50 to 60 % of the
defects.
7. Verification is based
on the opinion of — the fact and is often
reviewer and may _ stable.
change from person to
person.
‘Anup trust for knonlesigeSoftware Testing
Basis of Sovae Testing and Testing Mithiads
8 The verification |The validation
‘verifies the problem validates the
statements, decisions requirements,
taken during the functionalities and
development and features ofthe
execution pats product,
9, Verification is about Validation is about
process, standard and the product.
sguideline.
EEz]v moat
+ V model means the Verification and Validation
model.
«This model is V-shaped hence is the name. It is just
like waterfall model in which each phase must be
completed before the next phase begins.
+ This model contains various stages of software
development along with various types of testing
that can be conducted at each stage of development.
The test plans serve as a link between the
development stages and various tests.
When will be V model applicable ?
Following are the situations in which the V model is,
applicable
1. The requirements are well defined and are not
ambiguous
2. The acceptance criteria is clear:
3. Project is short to medium size.
4. Technology and tools are not changing.
Moda!
+ As shown by this model at each stage specific
testing can be carried out. Refer Fig. 14.
=
as econ
cae ane
=a
Higher! ee,
coo ey
Low me! component
deean | “tesa
motemertton|—e| Ut,
Code
Fig. 1.4.1 The V-modet
Requirements analysis
As per the waterfall model of software development
process model the V model begins with requirements
gathering and analy:
Specification(SRS) is created during this phase, The
acceptance and system testing is conducted in which
the focus fs on meeting of functionalities specified in
the requirements gathering,
js. The Software Requirements
High level design
During this phase the system architecture is designed
It provides the overview of platform used, system,
product, and service or process. An integration test
plan is prepared and testing is conducted to test the
pieces of the software systems to ensure about the
ability to work together.
Low level design
During this phase actual software components are
designed. The relationship with other components are
defined at this level. Hence component testing is
conducted for this phase.
ToatnealPubiestns” in up tt frinonledgeSfaare Testing
Basics of Soture Testing and Testing Methats
Implementation
All coding takes place at this phase, The unit testing is,
carries out to test every source code module. The
creation and review of various test cases are carried
‘out in this phase.
‘Advantages
1. The V model is simple and easy to manage as cach
phase has well defined objectives and goals
Development and progress of this model is very
systematic.
It works well for small to medium sized projects
4, Testing starts from beginning of the development
stage and errors can be identified and corrected
from the beginning of the software development.
Disadvantages
1. This model is not suitable for large and complex
projects
2. For the projects in which the requirements are not
consistent, this model is not suitable.
3. The working software can not be produced during
the intermediate stage. It is available only at the
end of the development cycle.
4, There is no provision for risk analysis, Hence there
is always an uncertainty about the risks.
Board Questions
1. Describe V-model with labelled diagram. State its any
frvo advantages and disaloantages, Also write witere it
is opplicatle
Pe ES EC
Differentiate behveen verification and validation
CSE
3. Explain V model wth dingram
4 Describe Vmod! with abled digrar
Expltn vrifclion md oclation wit net diagram
STS ONTO
(Quality Assuranco
Software quality can be defined as “the
conformance to explicitly stated functional and
performance requirements, explicitly documented
development standards and implicit characteristics
that are expected of all professionally developed
software”.
Definition of quality assurance : It is planned and
systematic pattern of activities necessary to provide
a high degree of confidence in the quality of a
product. It provides quality assessment of the
quality control activities and determines the velidity
of the data or procedures for determining quality.
‘The quality assurance consists of set of reporting,
and auditing functions.
These functions are useful for assessing and
controlling the effectiveness and completeness of
quality control activities,
The goal of quality assurance is to ensure the
management of data which is important for product
quality,
144] Quality Control
Definition : Quality control is a process in which
activities are conducted in order to maintain the
quality of product. These activities are series of
inspections, reviews and tests used throughout the
software process. These activities ensure whether
each work product is satisfying the requirements
imposed ont.
While applying the quality control there should be a
feedback loop to the process which generates the
work product. With the help of such feedback we
can tune the process if it does not satisfy the
feedback
minimizing the defects in the software product
requirements. The loop helps in
‘The quality control activities can be fully automated
or it can be completely manual or it can be a
combination of automated tools and manual
procedures,
Toate Pubicetons” Anup tant fr oncdseSoftisare Testing
7 Basics of Softane Testing and Testing Methads
445] Difference between Quolity Assurance and
Quality Controt
Sr. Quality control Quality assurance
No.
a, This is an activity with This. is. an_ activity
the primary goal as to
prevent the defects.
with the primary
goal as to identify
and correct the
dofocts
2, This process is intended This process is
to provide the assurance intended te focus on:
that the quality request quality being
will be achieved requested,
3, This method is to This method is for
manage the quality quality validation.
verification,
4, It does not involve During this method
executing of ~— the the program — is
program. executed.
5 It is a preventive It is @ comective
technique, technique,
6 Wisaproactivemeasure It isa reactive
7, It involves the full It involves testing
software
life cycle.
evelopment phase of software
development life
cycle.
Its main goal is to
prevent defects in the
system. It is less time
consuming activity. is
consuming activity.
It's main goal is to
correct the defects in
the system, Hence it
more time
Board Questions
1 Give difference bettocen quality assurance and quality
control. (Any Four)
2. Describe quality assurance and quality control.
CaaS
[Ea] Methoas of Testing
[a saatic Testing
+ Definition : Static testing is a testing technique in
which software is tested without executing the code
As the code, requirement documents and design
documents ate tested manually in order to find
errors, itis called static,
+ This kind of testing is also called as verification
testing,
Static testing techniques :
+ Informal reviews
© In this technique, the team of reviewers just
‘checks the documents and give comments.
© The purpose is to maintain the quality from the
initial stage. It is non-documented in nature
+ Formal reviews
© It is well structured and documented and follow
six main steps: Planning, kick off, preparation,
review meeting, rework follow-up
The team of technical
experts will review the software for technical
© Technical reviews :
specifications. The purpose is to pin out the
Gilfference between the required specification
and product designed and then correct the Flaws.
It focuses on technical documents such as test
strategy, test plan, and requirement specification
Gocuments.
+ Walk-through : The author explains about the
software to the team and teammates can raise
questions if they have any. It is headed by the
author and review comments are noted down,
‘+ Inspection process : The meeting is headed by a
trained moderator. A formal review is done, a
record is maintained for all the errors and the
authors are informed to make rectification on the
given feedbacks
* Static code review : Code is reviewed without
execution, it is checked for syntax, coding standard,
and code optimization. It is also referred as white
box testing
Advantages :
1) This fast and easy technique used to fix errors
2) Ithelps in identifying flaws in code
3) With the help of automated tools it becomes very
easy and convenient to scan and review the
software.Sefare Testing
4) With static testing it is possible to find errors at
early stage of development life cycle.
Disadvantages :
1) It takes lot of time to conduct the testing procedure
if done manually.
2) Automated tools work for restricted sot of
programming languages
3) The austomated tools simply sean the code and can
not test the code deeply.
[£52] Dynamic Testing
Definition : Dynamic testing is a process by which
code is executed to check how software will perform in
a runtime environment. As this type of testing
conducted during code execution itis called dynamic.
tis also called as validation testing.
Dynamic testing techniques
Unit testing : As the name suggests individual units or
modules are tested. The source code is tested by the
developers,
Integration testing : Individual modules are clubbed
and tested by the developers. It is performed in order
to ensure that modules are working in a right manner
and will continue to perform flawlessly even after
integration
‘System testing : It is performed on a complete system
to ensure that the application is designed according to
the requirement specification document.
Advantages
1) Ihidentifies weak areas in a runtime.
2) Ithelps in performing detail analysis of code,
3) Itcan be applied with any application.
Disadvantages
1) Tt is not easy to find trained software tester for
performing dynamic testing
2) Itbecomes costly to fix errors in dynamic testing,
1a
Basics of Sofa Testing and Testing Methods
Difference between static and dynamic testing
St. Static testing Dynamic testing
No.
1 Static testing is a Dynamic testing is a
testing process which testing process. done
isdone at early stage later stage of
of development lle development life
ote
2 involves It involves functional
walkthrough, code and_non functional
review testing.
3. This testing is a a
verification process
4 This type of testing is
done during code
‘execution of code. execution.
it is about Itis about ee.
prevention,
6, _ Riscosteffective Itis costly
Board Questions
1. What is static. lsting
disadvantages of stati testing tea
Explain the static testing andl dynamic testing,
CSE oon
> State advantages and
3. Describe inspection under static testing.
4. Describe structural walk Hirougl under static testing.
Sse
Describe technical review under static testing.
LSS CST]
‘The Box Approach
Te
164
White Box Testing
‘+ In white box testing the procedural details are
closely examined.
+ In this testing the internals of software are tested to
make they operate according to
specifications and designs.
sure that
‘+ Thus major focus of white box testing is on internal
structures, logic paths, control flows, data flows,
internal data structures, conditions, loops, etc.
‘Arup tat for inonedeSeftanre Testing
+ The white box testing is also called as clear box,
glass box or open box testing,
Advantages :
1, Each procedure can be tested thoroughly. The
intemal structures, data flows, logical paths,
conditions and loops can be tested in detail
2. Ithelps in optimizing the code,
3. White box testing can be easily automated.
4. Due to knowledge of internal coding structure it is
easy to find out which type of input data can help
{n testing the application efficiently.
Disadvantages :
1. The knowledge of internal structure and coding is,
desired for the tested. Thus the skilled tester is
required for white box testing,
2. ‘This type of testing is costly.
3. Sometimes itis difficult to test each and every path
of the software and hence many paths may go
untested.
Basis of Softour Testing and Testing Methods
4. Maintaining the white box testing is very difficult
because it may use specialized tools like code
analyzer and debugging tools are required.
5, The missing functionality can not be identified.
Classification of white box testing
Following Fig. 1.6.1 represents the classification of
white box
+ Slatic testing is carried out only on source code. It
does not require any executable code.
+ Following are the tasks performed during. static
testing ~
1) To check whether code works according to
functional requirements or not.
2) To check whether the code is written according to
the design of system,
3) To check if any functionality of the code is missed
out or not,
4) To check whether the code handles errors properly
or not
Wate box testing
{T
‘Stale testing
‘Structural tastro)
|» desk erecking
ee |
Functional Code Code
| cede, ‘esting coverage comploxity
swalithrough
Le code |» Statsmonteoverags b> cyclomatic
inepecfon somploniy
|= Path coverage:
[> onsition coverage
|» Function coverage
Fig. 1.6.1
Techical Fubiotons Anup st forknonleigeSoftware
+ Various methods of static testing are —
1) Desk checking
2) Code walkthrough
3) Code review
4) Cade inspection
1.6.7.1] Inspections
‘The main goal of inspection is to find out the defects
Inspection is a kind of review by the group of peers by
following clearly defined processes. The inspection is
very formal process of verification.
Following are some guidelines given for the inspection
process -
1. The inspection must be conducted by the technical
people for technical people.
It is a structured process in which every participant
have definite role.
3. The focus of code inspection is to identify the
problems and not to solve them.
4. The review data is recorded and monitored for
further improvement.
‘The inspection is basically carried out by the team of
reviewers. The author of the team is moderator.
‘The moderator hes overall responsibility to ensure that
the review is done in proper manner and all the steps
of review process are followed.
The inspection process can be carried out in different
phases such as planning, preparation and overview,
group review meeting, rework and followup,
‘Advantages :
1. Single inspection can discover multiple errors; on
the other hand one error may hide another error,
From output of the system we cannot predict
whether the wrong output is due to existing error
or because of some new error.
2. Incomplete version of the system can be inspected
butit is difficult to test such version.
sting 1
Basics
10 of Softuare Testing and Testing Methods
3. Using inspections we can search for programming
defects, poor programming style or use of
inappropriate algorithm,
4, More than 90 % of errors can be detected by
conducting formal inspections. If the defects are
found during inspections, programmers can avoid
the some mistakes in the later phases of software
development.
Disadvantages :
1. Software engineers are reluctant to accept that the
inspections can be more effective for defect
detection and testing.
2, Project managers feel that inspections may require
additional cost if they are conducted during the
software design and development.
3. Since inspections take time to arrange and it slows
the development conducting
inspection is avoided
down process,
Roles and responsibilities
‘The program inspection is a formal process. It is
conducted with the help of four people and roles of
them are : Author, reader, tester and moderator.
Author or owner is a person who has created the
program or design. This person is responsible for
fixing the defects during the inspection process.
Moderator is the leader of the inspection process who
plans and co-ordinates the inspection. He reports the
process results to the chief moderator
Reader is the person who reads the code aloud to the
inspection team,
‘Tester or inspecior is the person who inspects the code
from testing perspective. He finds the errors, omissions
inconsistencies in the software.
Scribe recorcis the results of inspection meeting.
Chief moderator is responsible for inspection process
improvements, preparing or updating checklists
Inspection process
‘The inspection process can be illustrated by following
Fig. 1.62
Ar uptin frinautacpeSaftsore Testing
1 Basie of Softane Testing an Testing Mothods
Panna
ot nection
apecton
Folbwap
Travan
Inspeator
peeing
Fig. 1.6.2 Inspection process
Planning : he inspection process is planned by the
moderator. Various tasks that can be conducted during,
planning are:
©. Selecting inspection team
‘© Organising meeting room
‘© Ensuring that the required documents and
resources for the inspection are available.
Overview : The program or the code to be inspected is
presented to the inspection team during the overview.
The author of the program/code explains its purpose.
Individual preparation : Each inspection team member
then studies the code and tries to find the possible
defects.
Inspection meeting : During this meeting, the focus
should be on pinpointing the defects from each part of
the program, non-compliance to the standards and
poor-quality programming. But the inspection team
must not suggest how to correct the defects,
Rework : After the inspection meeting, author should
understand the mistakes and should correct the
identified defects. He should try to remove as many
anomalies as possible.
Follow-up : During this stage the reworked program is
presented to the moderator. The moderator then has to
decide whether the re-inspection is needed or not. If all
the identified defects are removed successfully and the
inspection team gets satisfied with the work product,
moderator approves the program for the release.
Inspection checks
During the inspection a checklist is prepared for
common programming errors. It can be prepared by
the person(s) having adequate experience in
application domain, This checklist is very useful to the
‘The checklist varies different
languages because different
programming languages have different programming
constructs. For example:
programmer. for
programming
‘Checklist for C Program
9 Is the loop executed for correct number of
times?
© Do the parameter and argument types in the
function call and definitions match ?
© Are the global variables definitions consistent
throughout the program ?
16.7.2] Walkthrough
+ Walkthrough is more formal than peer review
Many times itis called as semi-formal review.
During walkthrough author lead the review process
and other team members ask the questions and
identify the all possible errors.
+ The main purpose of walkthrough is to enable to
understand the contents of the documents under
review and to find the defects.
Walkthrough helps the teams to develop. the
communication during review.
Advantages :
1, Itis useful for the communication about the issues,
under review.
2. Team members can understand the things that are
expected during the review.
3. The problems are recorded and suggestions can be
obtained from all the team members. Hence all the
team members can participate in improvement of
the work product
An uptitorkromiedaeSoftee Tsing Ln Bases of Sore Testing and Testing Meth
iiaiieitatee product is ready for review. ‘The reviewer reviews
1. Is difficult to handle the team of large size during | ‘Re Work product as per his or her convenience and
wail throsgh sends the review report to the author. There is no
° e direct interaction of author and reviewer.
2. Itcan be time consuming activity.
Advantages :
Difference between walkthrough and inspection
Sr Walkthrough Inspection
No.
1, It is an informal It ig more formal
method of method of verification.
verification.
2, It is initiated by Ik is initiated by project
author. team.
a method of | This method involves
verification is not planned meetings, and
planned and — fixed roles are assigned
systematic. to the team members for
verification.
4, Author simply notes Recorder records the
the defects ond defects. Moderators
suggestions offered directs in uch a ways
by the team thatthe _ discussion
members. proceeds on productive
line,
6:13] Technical Reviews
+ This is an informal way of verification and
validation. There are two types of review - self
review and peer review.
The self review is normally done by the tester
himself who has written the test cases. Fe can verify
whether all the requirements are covered or not by
looking into software requirements specification
Whereas peer review is done by another tester who
hasn't written those test cases but is familiar with
the system under test. This type of review is also
known as maker and checker review.
‘There are two kinds of peer reviews - 1. Online peer
review and offline peer review.
The online peer review in which the author and the
reviewer sit together and review the work product
jointly, In this meeting any explanation can be
immediately provided by the author to the
reviewer,
The offline peer review is a kind of review in which
the author informs the reviewer that the work
1. Review is a very useful tool in defect finding.
2. Review can be conducted at convenient tin
ings of
both the author and reviewer.
Disadvantages :
1, Sometimes people involved in self review may not
conduct the review in reality due to time
constraints.
2. In peer review, if the other person doing the review
is not expert or possessing the lack of knowledge
about the system under review then his/her
suggestions may not be valid.
7.6.1.8] UnivCode Functional Testing
+ This is structural testing method in which some
quick checks are made before the code coverage
testing or code complexity testing,
+ Following are three approaches used during
unit/code functional testing
© Initially the developer performs some typical
tests or obvious tests with known input sets
and corresponding expected outputs. These te:
are repeated for multiple inputs and any obvious
mistakes can be removed from the code. This
increases the level of confidence. ‘These quick
tests are generally performed before the formal
reviews of static testing
For complex logic testing, developer prepares
the debug version of the code. The debug
version is a kind of version of your source code
in which the print statements are inserted at
intermediate places in the code. This can be done
to test if the program is executing through right
loops and iterations for right number of times.
iter fixing the errors, these print statements can
be removed.
‘Anup st ornateSoftaare Testing 113 Busies of Softuare Testing and Testing Metheds
© In this approach the code is run under a standard debugger or Integrated development
Environment(IDE). These standard tools debug each and every instruction of your program. The
developer can watch the values of variables or other functional parameters at each step in the
iteration,
7.6.15] Code Coverage Testing
+ ‘This is a testing process in which the test cases are designed and executed for different parts of code.
‘Thus some amount of code is covered by testing, The amount of code covered by testing is found out
by a technique called instrumentation of cade. The instrumentation of code can he performed used
some standard tools.
+ Code coverage testing can be performed using following techniques ~
Statement coverage
Path coverage
© Condition coverage
© Function coverage
Let us discuss these techniques ~
4) Statement coverage :
© There are various types of programming statements such as sequential control flow, if-else
statements, switch-case statements, loops such as for, while,do-while
© Sequential control flow statements : For these kind of statements, the test can be designed to run
through from top to bottom. A test case starts from top and runs covering full section of the code
upto bottom.
0 Ifelse statement: The test cases are written to cover all parts of code. That means the set of test
cases are executed for if part and another set of test cases are executed for else part.
© Switch-case statement ; There should be multiple test cases executed covering each case statement
in the switch-case control structure.
© Loop construct(for, while, do while) : This is the most complex part for statement coverage, Many
defects occur in the program if the loops do not execute correct
‘executed for -
_. Hence set of test cases must be
1) Exercising the loop at least once and maximum number of times to ensure all the normal
flow of execution of loop.
2) Skipping the loop completely, so that termination condition of the loop can be tested before
starting the loop.
3) Testing the boundary of the loop. Far example if the statement fs
while(i< =n)
{
}
Then the test case must be written when i has exact value of n or n-1
‘Testa Pubiesions” An wether irowiedseSoftare Testing Lu Basie of Sovae Testing and Testing Methods
Calculation of statement coverage
Statement coverage is an indication of the percentage of statements actually executed in a set of tests
‘The statement coverage can be calculated using the formula —
Total statements exercised
Statement coverage = Total number of executable statements * 1°
2) Path covorage:
©. This is a kind of testing in which the program is divided into number of distinct paths andl test
cases can be written for each path ofthe program.
© For example ~ Consider following code for simple subtraction ®
1. Input and y
aIeSyNeR Q
zm
4. else z= y~x
5. endif
6. output z
Refer Fig. 1.6.3 for flow graph.
Here we need to test two paths
©
Path 1: 1,2,3,5,6
Path 2: 1,2,4,5,6
‘© Thus regarciless of the number of statements in each of these paths, if we can execute these paths,
Fig. 1.6.3,
then we would have covered most of the typical scenarios.
0 Hence path coverage can be calculated using formula ~
Total paths exercised
x10
Path coverage = “Total number of paths in program
3) Condition coverage
9 Condition coverage exercises all kinds of situations that the path
coverage may not perform
© For example ~ Consider following code for simple subtraction
. Input x and y
if'x> y then
el
1
2
Bz-x-y
4
5.
endif
| output 2
Fig. 184
Testes! Fubiestons” An ap tt fr inaledneSoftens Testing 115 sis of Sone Testing and Testing Methods
5-6) for the conditions x > y
tion. Hence it is preferred to
Here by path coverage criteria two paths can be tested (1-2:3-5-6 and 1-2
and x