Software Testing CS4153 - 2
Software Testing CS4153 - 2
CS4153
PE-VII
By:
Dr. Akshay Jadhav
When do
defects
arise?
FOUNDATIONS OF SOFTWARE
TESTING
ISTQB CERTIFICATION
Dorothy Graham, Erik van Veenendaal,
Isabel Evans, Rex Black
Page 5
Re q u i r e m e n t 1 : T h i s r e q u i re me nt wa s c o r r e c t l y
u n d e r s to o d , d e s i g n e d, b u i l t , a n d t e s t e d, r e s u l ti ng i n
s o f t wa r e t h a t m e e t s b o t h f u n c t i o na l a n d n o n - f u n c ti o n a l
a t t r i but e s .
Re q u i r e m e n t 2 : E r r o r s o c c u r r e d d u r i ng c o d i n g , l e a di ng t o
d e f e c t s . T h e s e a r e t y p i c a l ly e a s y t o s p o t a n d c o r r e c t d u r i ng
testing because the product does not meet the design
s p e c i f i c a ti o n s .
Re q u i r e m e n t 3 : D e f e c ts w e r e i n t r o d uc e d i n t h e d e s i g n
p h a s e d u e t o m i s ta ke s b y t h e d e s i g n e r. T h e s e d e f e c t s a r e
h a r d e r t o d e t e c t d u r i ng t e s t i ng b e c a u s e t h e s o f t wa r e wa s
b u i l t a c c o r d i ng t o t h e f l a w e d d e s i g n, m a k i n g t h e m d i f f i c ul t
and costly to fix.
Re q u i r e m e n t 4 : T h e d e f e c t s o r i g i na te d d u r i n g t h e
r e q u i re me nts d e f i ni ti o n p h a s e . A l t h o u g h t h e s o f t wa r e
m e e t s t h e f l a w e d r e q u i re me n ts a n d d e s i g n , i t m a y b e
r e j e c t e d b y t h e u s e r o r c u s t o m e r. D e f e c ts f o u n d a t t h i s
s t a g e , p a r t i cul a rl y d u r i ng a c c e p ta nc e t e s t i n g o r l i ve u s e ,
a r e ve r y c o s t l y. S t u d i e s s h o w t h a t d e f e c t s f r o m
r e q u i re me nts a n d d e s i g n m a ke u p n e a r l y h a l f o f a l l d e f e c t s
i n s o f t wa r e p r o j e c t s .
Origin of
Defects
A fault (defect) model
can be describe d as a
link between the error
made (e.g., a missing
require me nt , a
misunderst ood design
element, a typographical
error), and the
fault /def e ct in the
sof tware .
Origin of Defects
Requirements Issues: Defects often originate from unclear, incomplete, or misunderstood requirements. If the
requirements are not correctly captured or interpreted, the software may not meet the users' needs, leading to defects.
Design Flaws: Poor software design or architecture can introduce defects. This may occur due to a lack of
understanding of the system requirements, inappropriate design choices, or failure to consider non-functional
requirements such as performance and security.
Coding Errors: Mistakes made during the coding phase are a common source of defects. These can be due to
typographical errors, logical errors, or a misunderstanding of how a particular function or feature should be implemented.
Testing Gaps: Insufficient or ineffective testing can lead to defects going undetected until later stages of development or
even after deployment. This can happen if the testing process fails to cover all scenarios or if the test cases themselves
are flawed.
Environmental Factors: Differences in the development and production environments, such as hardware, operating
systems, or configurations, can cause defects. For example, software that works in a developer's environment may fail in
the production environment due to these differences.
Human Factors: Human error is a significant contributor to defects. This can stem from a lack of experience, fatigue,
miscommunication among team members, or simple oversight.
Myers approach to testing
Myers has a similar approach to testing. He describes the
successful test as one that reveals the presence of a
(hypothesized) defect. He compares the role of a tester to
that of a doctor who is in the process of construct ing a
diagnosis for an ill patient. The doctor develops hypotheses
about possible illnesses using her knowledge of possible
diseases, and the patient s‘ symptom s. Tests are made in
order to make the correct diagnosis . A successf ul test will
reveal the problem and the doctor can begin treatment .
Completing the analogy of doctor and ill patient, one could
view defective sof tware as the ill patient . Testers as
doctors need to have knowledge about possible defects
(illnesses) in order to develop defect hypotheses.
Myer’s hypotheses
• select the testing levels (unit, integration, etc.)appropriate for the tests;
Cost of Fixing Defects : The cost of f inding and f ixing defects increase s signif icant ly as
the sof tware progresses through its development stages. Early detection, such as
during the requirement s or design phases, is much cheaper than f ixing defects found
later, like during acceptance testing or af ter implementat ion.
Early vs. Late Detecti on : If a defect is detected early, such as in the requirem ents or
design stages, it can be corrected with minimal expense. However, if a defect goes
unnoticed until later stages, it becomes much more costly to f ix because rework may be
needed across multiple stages, and previous testing may need to be redone.
Impact of Late Detecti on : Defects found late in the process may sometim es not be
f ixed due to the high cost. Additionally, even if sof tware meets its specif ications, it may
still be rejected by users if those specif ications were f lawed, leading to dissatisf action
or, in extreme cases, the need to de -install the system entirely.
T h e c o s t a s s o c i a t e d w i t h d e f e c t s i n s o f t w a r e c a n b e s i g n i f i c a n t a n d va r i e s d e p e n d i n g
on when the defect is detected and corrected. Costs increase exponentially as
d e f e c t s a r e f o u n d l a t e r i n t h e d e ve l o p m e n t c yc l e o r a f t e r t h e s o f t wa r e h a s b e e n
released.
Te s t i n g P h a s e C o s t s : D e f e c t s f o u n d d u r i n g t h e t e s t i n g p h a s e a r e m o r e e x p e n s i v e
Defect
to fix because they often require code changes, retesting, and regression testing.
The closer to release the defect is found, the higher the cost due to the potential
need for more extensive changes and testing.
• Po s t - Re l e a s e C o s t s : D e f e c t s t h a t a r e f o u n d a f t e r t h e s o f t w a r e h a s b e e n r e l e a s e d
to customers are the most expensive. These costs include customer support,
p a t c h e s o r u p d a t e s , p o t e n t i a l l e g a l l i a b i l i t i e s , a n d d a m a g e t o t h e c o m p a n y ’s
r e p u t a t i o n . F i x i n g d e f e c t s i n p r o d u c t i o n m a y a l s o i n vo l v e s i g n i f i c a n t d o w n t i m e
and disruption for users.
• Indirect Costs : These include the loss of customer trust, potential loss of
b u s i n e s s , a n d t h e i m p a c t o n t h e d e ve l o p m e n t t e a m ' s m o ra l e a n d p r o d u c t i v i t y.
Long-term, unresolved defects can also lead to increased technical debt.
Defect classes
Defects in sof tware can be
categorized into four major classes
based on their point of origin in the
sof tware development lifecycle:
Requirements /Specification Defects,
Design Defects, Coding Defects, and
Testing Defects. Each class reflects
specific phases where defects are
introduced and provides insight into
how testing can be most effectively
executed.
Requirements /Specification Defects
S o f t w a re r e q u i r em ents a n d d e s i g n b o t h a r e i m p o r t a nt a n d
s h o u l d b e a n a l y z e d i n a n e f f i c i en t w a y w i t h m o r e f o c u s .
R e q u ir em ents t h a t b a s i c a l l y d e s c r i b es f e a t u res an d
f u n c t i ona l i ti es o f t a r g e t p r o d u c t a n d a l s o c o n ve y s e x p e c ta t io ns
o r r e q u i re me nt o f u s e r s f r o m s o f t w a r e p r o d uc t.
3. Uninitialized Variable:
total_coin_value is not initialized, leading to potential garbage values.
Fix: Initialize it to 0.
Functional testing
Non-functional testing
Test execution Human testers execute test cases Test cases are executed using
process manually. automation tools and scripts.
Well-suited for exploratory and ad-hoc Less effective for exploratory testing
Exploratory testing
testing. without human intuition.
Software testing strategies are detailed plans that guide your approach to
testing and outline test objectives, scope, methodologies, and more. These
roadmaps assist in structured testing by specifying what, how, and when to
test. Test strategies furnish essential details for creating test documents.
Software testing strategies are integrated into every SDLC phase, enabling
early bug identification by guiding the review and verification of software
throughout the development lifecycle. Key roles of software testing
strategies throughout the SDLC include:
SDLC Phase Key Testing Strategies
•Requirement validation
Requirements analysis
•Risk analysis
•Comprehensive test planning
Planning
•Resource allocation
•Test case design
Design
•Traceability matrix
•Unit testing
Implementation
•Static analysis
•Integration testing
Integration
•Interface testing
•Functional testing
System •Non-functional testing (performance, security)
•Regression testing
•UAT planning
User acceptance (UAT)
•Beta testing
•Release readiness testing
Deployment
•Compatibility testing
•Maintenance testing
Post-deployment
•Performance monitoring
• Risk mitigation: Helps you mitigate unexpected challenges, like budget constraints, during
the software development process.
• Teamwork: Helps you develop better collaboration with different teams and leverages Agile
and DevOps work culture.
• Technological changes: Integrates new software technologies into your software development
process.
• Scalability: Allows you to scale the test process effectively by addressing agility.
• A meticulously planned sof tware testing strategy acts as the foundation
for your sof tware’s success, guiding you toward continuous improvement
and aligning seamlessly with user expectations.
• Finding the right balance between project dynamics is crucial for sof tware
testing strategies. The ability to adapt to evolving user requirements
ensures successful testing outcomes, delivering benefits to both your
development teams and end-users.
1. Inspections 2. Reviews
3. Walkthroughs 4. Desk-checking
Validation