Software Testing Fundamentals
Software Testing Fundamentals
FUNDAMENTALS
Dr.P.Keerthika/Associate Professor/Department of
CSE/ Kongu Engineering College
Software Testing
Why Testing is important?
BASICS OF SOFTWARE TESTING
Overview
• Introduction
• Testing – Definition
• Approaches to Testing
• Essentials of Software Testing
• Principles of Software Testing
• Salient Features of Software Testing
• Test Policy & Challenges
• Test Strategy
• Test Planning
• Cost of Testing
• Categories of defect
• Developing Test Methodologies
• Testing Process
• Testing MEthodologies
Software Testing - Definition
• Execution of a work product with intent to find a
defect
• Detecting the difference between existing and
required conditions and to evaluate software
features
• As a process, designed to
– Prove that the program is error/defect free
– Establish that the software that software performs
functions correctly and fit for use
– Establish that all functional expectations are available
Software Verification & Validation
• Characteristics
– All defects found in last phase
– Cost-huge
– Huge rework, retesting, scrap, sorting of software components
– No corrective & preventive actions – arise from these defects
– Regression testing – correcting defects leads to creation of new defects –
dependent components affected
1. Big Bang Approach
• Organizations following Big Bang Approach
– Are less matured
– May spend huge cost of failure
– Needs several retesting & Regression Testing
– Observables:
• Verification activities (during SDLC) – can find 2/3 of total
defects
• Validation activities (in unit testing) – can find ¾ of remaining
defects
• Verification activities (during System testing) – 10% of total
defects
• Remaining 5% to 10% defects – identified only when the product
reaches customer – unless the organization takes preventive
measures
doesn’t
Big Bang Preventive Measures
go for
2. TQM Approach
• TQM Cost Triangle
– Stages of maturity
• 0 – highly matured
– No need of verification/validation
– Quality is free
• 1 – Verification done
– Will have appraisal cost
• 2 – validation
– filters the defects escaped from verification
– High validation cost
• 3 – defects found by customer
– Results in 1000 times much higher cost
2. TQM Approach
Less defects produced
Very few defects undetected
Defect removal costs
After coding (approx. 10 times >) before coding
During Production (approx. 100 times>) before coding
Software Testing
A SQA activity – in many places
But in Reality - it is a Quality Control (QC) activity
Basic Principles of Testing
Define the expected output or result for each test
case
Defects may be in the product or test case or test
plan
Developers or the development teams must not test
their own products
Inspect the results of each test completely and
carefully
Used to identify the weak processes, build right
processes and improve the process capability
Basic Principles of Testing
Include test cases for invalid and unexpected
conditions
Test the program to see if it does what it is not
supposed to do and what it is supposed to do
Do not plan tests with an assumption that no error
will be found
The probability of locating more errors in any
module is directly proportional to the no. of errors
already found in that module
Successful Testers & Test Cases
Successful Testers – must conduct SWOT analysis of
software and the processes used to make it
Successful Test Case – must consider all cases - +ve,
-ve, all scenarios
Testing during SDLC
Requirement Testing
Mock running of future application using requirement statements
Completeness of Requirement statements
User Expectation clarity
Measurability of expected results
Testability, Traceability of requirements at the end
Design Testing
completeness
Code Testing
Readability, maintainability in future, ability to integration testing
Problems:
Theoretically – all software must have
In reality – most software doesnot have
WHY???????
Requirement Traceability Matrix
Why???
If number of requirements is high,
Preparing RTM is difficult
One-one, Many – one, one- many, many - many
relationships exist
Needs more efforts to connect columns and rows
Requirementschanges frequently
Customer doesn‟t find any use of it – hence, will not pay
for it.
Requirement Traceability Matrix
Horizontal Traceability
Traced from requirement ---through----test results
Vertical Traceability
A requirement may have child requirements – Tracing from parent to
child requirements
Bidirectional Traceability
Horizontal in both directions – requirements to results, results to
requirements RISK TRACEABILITY MATRIX
Risk Traceability
Tracing the possibility of risk of failure
Essentials of Software Testing
SWOT Analysis
Strengths
Identifying strong areas
Weakness
Failure possibilities
Opportunity
Identifying space for improvement
Threats
Identifying risks that results in failure
Workbench
Tester‟s Workbench
Workbench
Tester‟s Workbench
For creating test strategy
Input
Test plan
Do Process
Writing test scenario
time to time
Examples
Definition
of functional coverage/requirement
coverage/feature coverage of a particular product
How much testing would be done manually
Developersbecoming testers
Independent testing team – outside organization
team
Senior
Management
Advantages
Test team is not under delivery pressure
Disadvantages
Always „us‟ Vs „them‟ mentality between the development
development process
Management may be excessively inclined towards either of
the team
Location of Test Team - Test Team Reporting to
Development Manager
heavy or simple
Developers Becoming Testers -
Advantages
Developers are not in need of knowledge
transfer.
Developers have better understanding of
automation testing
Less costly as there is no separate test team
products
Special skill required to do special tests may
context
They understand the scenario faced by the
actual users
Domain Experts Doing Software
Testing - Disadvantages
Domain experts may not understand what a
customer is looking for
Cost of development =
[no of resources for development project]
[ cost of capturing requirements, conducting analysis,
asking queries, elicitation of requirements + design
cost (both high level and low level design) + coding
cost (integrating & creating final product)]
Cost Aspect of Testing
Assessment of Cost of Testing
Cost of Prevention in testing
Cost of Appraisal in Testing
Cost of failure in Testing
Cost Aspect of Testing
Assessment of Cost of Testing
Based on
Type of application
Development and Testing methodology
Domain and Technological aspects
Maturity of Development and testing processes
Cost of testing – based on
Size
Importance of an application to a user
K f(x)
K- constant
Test planning
Should contain test objectives, methods applied for defining
test scenario, test cases and test data
Test objectives
What is the target
Methods - applied for testing efforts are defined at organizational levels
Structured Approach to Testing
Testing – done at all phases of SDLC
Wastes in Testing – due to Wrong approach
Waste in wrong development
Waste in testing to detect defects
Types of defects
Misinterpretation of specifications
Missing specifications
Features not supported
Root causes of defects
Defect, Error, Mistake in software
Developing Test Strategy
Select and rank test factors for the given
application
Identify the system development phases and
related test factors
Identify associated risks with each selected test
factor in case if it is not achieved
Identify phase in which risks of not meeting a test
factor need to be addressed
Developing Test Methodologies
(Test Plan)
Acquire and study test strategy as defined earlier
Determine the type of development project being
executed
Based on different organization
Based on criticality
Life
affecting software
Huge money affecting software
Disadv:
Does not check – user requirements-met correctly
Does not report whether decisions made are based on
requirements
Use of checklists
White box testing
Test case designing methodologies
Techniques
Statement coverage
Decision coverage
Condition coverage
Path coverage
Logic coverage
Gray Box Testing
Both verification & Validation
Advantages:
Tested - Both functionally and structurally
Disadvantage:
Usually done by automation tools
Hence, understanding is tough
Skills required by Tester
Testing Tips
Testing must occur throughout SDLC