SlideShare a Scribd company logo
TESTING
Software Testing
Software Testing is a process of evaluating a system by
manual or automatic means and verify that it satisfies
specified requirements or identify differences between
expected and actual results.
Why Software Testing ????
 Error Free
 Efficient
 Secured
 Flexible
Software Testing is important as it may cause mission
failure, impact on operational performance and
reliability, if not done properly !
Software Faults and Failures Objective of Testing
•Objective of testing: discover faults
•A test is successful only when a fault is discovered
Fault identification is the process of determining
what fault(s) caused the failure
Fault correction is the process of making changes to
the system so that the faults are removed
 Is a level of the software testing process where
individual units/components of a software/system are
tested.
 The purpose is to validate that each unit of the software
performs as designed.
Software Faults and Failures
Software Faults and Failures
Unit Testing
 Each part tested
individually
 All components
tested at least
once
 Errors picked up
earlier
 Scope is smaller,
easier to fix errors
Unit Testing Ideals
 Isolatable
 Repeatable
 Automatable
 Easy to Write
Why Unit Test?
 Faster Debugging
 Faster Development
 Better Design
 Excellent Regression Tool
 Reduce Future Cost
Tools:
Test driver/harness
Code coverage analyzer
Automatic test case generator
BENEFITS
 Unit testing allows the programmer to refactor
code at a later date, and make sure the
module still works correctly.
 By testing the parts of a program first and then
testing the sum of its parts, integration testing
becomes much easier.
 Unit testing provides a sort of living
documentation of the system.
Unit Testing Techniques:
Functional testing techniques:
These are Black box testing techniques
which tests the functionality of the
application.
Some of Functional testing
techniques
 Input domain testing: This testing technique
concentrates on size and type of every input object in
terms of boundary value analysis and Equivalence
class.
 Boundary Value: Boundary value analysis is
a software testing design technique in which tests are
designed to include representatives of boundary
values.
 Syntax checking: This is a technique which is used
to check the Syntax of the application.
 Equivalence Partitioning: This is a software testing
technique that divides the input data of a software unit
into partition of data from which test cases can be
derived
Unit Testing Techniques:
Error based Techniques:
The best person to know the defects
in his code is the person who has
designed it.
BLACK BOX TESTING, also known as Behavioral
Testing, is a software testing method in which the
internal structure/design/implementation of the item
being tested is not known to the tester. These tests can be
functional or non-functional, though usually functional.
BLACK BOX
TESTING
Example
A tester, without knowledge of the internal structures of a website, tests
the web pages by using a browser; providing inputs (clicks, keystrokes)
and verifying the outputs against the expected outcome.
BLACK BOX TESTING
This method is named so because the software program,
in the eyes of the tester, is like a black box; inside which
one cannot see. This method attempts to find errors in the
following categories:
•Incorrect or missing functions
•Interface errors
•Errors in data structures or external database access
•Behavior or performance errors
•Initialization and termination errors
BLACK BOX TESTING
METHODS/TECHNIQUES
Following are some techniques that can be used for designing black
box tests.
Equivalence Partitioning: It is a software test design technique that
involves dividing input values into valid and invalid partitions and
selecting representative values from each partition as test data.
Boundary Value Analysis: It is a software test design technique that
involves the determination of boundaries for input values and
selecting values that are at the boundaries and just inside/ outside of
the boundaries as test data.
Cause-Effect Graphing: It is a software test design technique that
involves identifying the cases (input conditions) and effects (output
conditions), producing a Cause-Effect Graph, and generating test
cases accordingly.
Equivalence Class Partitioning (ECP).
1. Equivalence Class Partitioning :
The concept of equivalence partitioning technique comes from equivalence class which
in turn comes from equivalence relation. Equivalence class partitioning is a
technique of software black box testing in which input data is divided into
partitions of equivalent data that is valid and invalid values. This strategy is used to
minimize the number of possible test cases while maintains reasonable test coverage.
Steps involves in this technique are:
•Divide any input domain into two sets that is valid values and invalid values.
•Test cases are developed :
a. Assign unique identification number to each valid and invalid class of input.
b. Write the test cases i.e. valid and invalid test cases
As present in the above image, an “AGE” text field accepts only the numbers
from 18 to 60. There will be three sets of classes or groups.
Two invalid classes will be:
a) Less than or equal to 17.
b) Greater than or equal to 61.
One valid class will be anything between 18 to 60.
We have thus reduced the test cases to only 3 test cases based on the formed
classes thereby covering all the possibilities. So, testing with anyone value
from each set of the class is sufficient to test the above scenario.
Example of Equivalence Partitions •
Windows filename can contain any characters
except / : * ? " < > |.
• Filenames can have from 1 to 255 characters.
• Creating test cases for filenames:
• Will have equivalence partitions for valid
characters, invalid characters, valid length names,
names that are too short and names that are too
long.
From the name itself, we can understand that in this technique we
focus on the values at boundaries as it is found that many
applications have a high amount of issues on the boundaries.
Boundary means the values near the limit where the behavior of the
system changes. In boundary value analysis both the valid inputs
and invalid inputs are being tested to verify the issues.
BOUNDARY VALUE ANALYSIS
If we want to test a field where values from 1 to 100 should
be accepted then we choose the boundary values: 1-1, 1, 1+1,
100-1, 100, and 100+1. Instead of using all the values from 1
to 100, we just use 0, 1, 2, 99, 100, and 101.
Example
An exam has a pass boundary at 50 percent, merit at 75
percent and distinction at 85 percent. The Valid
Boundary values for this scenario will be as follows:
49, 50 - for pass
74, 75 - for merit
84, 85 - for distinction
Boundary values are validated against both the valid
boundaries and invalid boundaries.
The Invalid Boundary Cases for the above example can
be given as follows:
0 - for lower limit boundary value
101 - for upper limit boundary value
Example on Boundary Value Analysis Test
Case Design Technique:
Assume, we have to test a field which accepts
Age 18 – 56
Minimum boundary value is 18
Maximum boundary value is 56
Valid Inputs: 18,19,55,56
Invalid Inputs: 17 and 57
Test case 1: Enter the value 17 (18-1) = Invalid
Test case 2: Enter the value 18 = Valid
Test case 3: Enter the value 19 (18+1) = Valid
Test case 4: Enter the value 55 (56-1) = Valid
Test case 5: Enter the value 56 = Valid
Test case 6: Enter the value 57 (56+1) =Invalid
Example 2:
Assume we have to test a text field (Name)
which accepts the length between 6-12
characters.
Minimum boundary value is 6
Maximum boundary value is 12
Valid text length is 6, 7, 11, 12
Invalid text length is 5, 13
Test case 1: Text length of 5 (min-1) = Invalid
Test case 2: Text length of exactly 6 (min) = Valid
Test case 3: Text length of 7 (min+1) = Valid
Test case 4: Text length of 11 (max-1) = Valid
Test case 5: Text length of exactly 12 (max) =
Valid
Test case 6: Text length of 13 (max+1) = Invalid
Example 1 for Boundary Value Analysis :
Password field accepts minimum 6 characters and maximum 12 characters. [Range
is 6-12]
Write Test Cases considering values from Valid region and each Invalid Region
and Values which define exact boundary.
We need to execute 5 Test Cases for our Example 1.
1. Consider password length less than 6
2. Consider password of length exactly 6
3. Consider password of length between 7 and 11
4. Consider password of length exactly 12
5. Consider password of length more than 12
Note : 1st and 5th Test Cases are considered for Negative Testing
Example 2 for Boundary Value Analysis :
Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:
1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000
in our case.
2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.
3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001.
Example 3 for Boundary Value Analysis :
Name text box which allows 1-30 characters. So in this case writing test cases by entering each
character once will be very difficult so then will choose boundary value analysis.
So in this case at max 5 test cases will come:
Test case1: minimum -1 character: Validating not entering anything in text box
Test case2: minimum +1 character: Validating with only one char
Test case3: maximum -1 character: Validating with 29 chars
Test case4: minimum +1 character: Validating with 31 characters
Test case1: any one middle number: validating with 15 chars
Cause-effect graph is a software testing technique that involves
specifying the causes (input conditions) and effects (output
conditions) and producing a Cause-Effect Graph, and designed test
cases. Causes are the input conditions and effects are the output
conditions. The causes and effects are represented using Boolean
graphs. It is also known as Ishikawa diagram as it was invented by
Kaoru Ishikawa or fish bone diagram because of the way it looks.
steps involved in this technique are :
Specify causes and effects.
 Produce the cause effect graph.
Convert the cause-effect graph into decision table.
Convert decision table rules into the test cases.
CAUSE EFFECT GRAPH :
The Cause-Effect Diagram can be used under these
Circumstances:
•To determine the current problem so that right decision can be
taken very fast.
•To narrate the connections of the system with the factors affecting
a particular process or effect.
•To recognize the probable root causes, the cause for a exact effect,
problem, or outcome.
A “Cause” stands for a separate input condition that fetches about an internal
change in the system. An “Effect” represents an output condition, a system
transformation or a state resulting from a combination of causes.
Steps to proceed on Cause-Effect
Diagram:
Firstly: Recognize and describe the
input conditions (causes) and
actions (effect)
Secondly: Build up a cause-effect
graph
Third: Convert cause-effect graph
into a decision table
Fourth: Convert decision table
rules to test cases. Each column of
the decision table represents a test
case
SYMBOLS USED IN CAUSE-EFFECT GRAPHS:
4. Decision Table Testing :
Decision table testing is a software testing technique in which various input
combinations and their system behavior are represented in a tabular form. A decision
table places the causes (input conditions) and effects (output conditions) in a matrix. Each
column represents unique combination.
As the name describes that, there are logical relationships like :
if(Condition = True)
{
then action 1 ;
}
else
{
action 2;
}
Then a tester will identify two outputs for two conditions so based on the probable scenarios a
Decision table is created to design the test cases.
For Example:
Take an example of XYZ bank that provides interest rate for the
Male senior citizen as 10% and for the rest of the people 9%.
In this example condition, C1 has two values as true and false,
condition C2 also has two values as true and false. The number
of total possible combinations would then be four. This way we
can derive test cases using a decision table.
5) Error Guessing
This is a classic example of Experience-Based Testing.
In this technique, the tester can use his/her experience about the
application behavior and functionalities to guess the error-prone areas.
Many defects can be found using error guessing where most of the
developers usually make mistakes.
Few common mistakes that developers usually forget to handle:
Divide by zero.
Handling null values in text fields.
Accepting the Submit button without any value.
File upload without attachment.
File upload with less than or more than the limit size.
● White-box/Structure-based measures and its related
design techniques are described in BS7925-2 standard.
● A software testing technique whereby explicit
knowledge of the internal workings of the item being
tested are used to select the test data.
● White Box testing is based on specific knowledge of
the source code to define the test cases and to examine
outputs.
INTRODUCTION: WHITE BOX TESTING
● Testing based on an analysis of the internal structure of
the component or system.
● White Box testing is also known as Clear Box testing,
Glass Box testing, Transparent Box testing, and Structure-
Based testing.
● It can be applied at all levels of SDLC.
● Most of the defects are found in Unit, Component &
Integration levels is through White-box.
DEFINITION:
WHITE BOX TESTING
WHITE BOX TESTING
Unit testing
Unit testing
Unit testing
Unit testing

More Related Content

What's hot

Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
niharika5412
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Ryan Tran
 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartitionswornim nepal
 
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
Khizra Sammad
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
Sachin-QA
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
Ian McDonald
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
Hoang Nguyen
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
Pina Parmar
 
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to ConsiderWhitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
RapidValue
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
Vadym Muliavka
 
Boundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningBoundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioning
Sneha Singh
 
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
Agile Testing alliance
 
Test Case Design
Test Case DesignTest Case Design
Test Case Designacatalin
 
10 software testing_technique
10 software testing_technique10 software testing_technique
10 software testing_technique
University of Computer Science and Technology
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
Kiran Kumar
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
Kiran Kumar
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality Testing
Kiran Kumar
 
Black box testing
Black box testingBlack box testing
Black box testing
Abdul Basit
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
Khuong Nguyen
 
Structural testing
Structural testingStructural testing
Structural testingSlideshare
 

What's hot (20)

Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...Design Test Case Technique (Equivalence partitioning And Boundary value analy...
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartition
 
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to ConsiderWhitepaper Test Case Design and Testing Techniques- Factors to Consider
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
 
Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
 
Boundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningBoundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioning
 
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
Agile Testing Alliance Chapter presentation - Equivalence Partition and Bound...
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
10 software testing_technique
10 software testing_technique10 software testing_technique
10 software testing_technique
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
Software Quality Testing
Software Quality TestingSoftware Quality Testing
Software Quality Testing
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
 
Structural testing
Structural testingStructural testing
Structural testing
 

Similar to Unit testing

black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
SupunLakshan4
 
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptxEquivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Khayal Abbas Akhtar
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
Jimi Patel
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
bhushan Nehete
 
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptxBoundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
ANSHIKANIGAMRA201103
 
Software Testing strategies, their types and Levels
Software Testing strategies, their types and LevelsSoftware Testing strategies, their types and Levels
Software Testing strategies, their types and Levels
ranapoonam1
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
priyasoundar
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testingnickynicks76
 
lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
debjani12
 
Qc trg 16 apr 2020
Qc trg 16 apr 2020Qc trg 16 apr 2020
Qc trg 16 apr 2020
Aisha Saleem
 
Importance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and AgileImportance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and Agile
Chandan Mishra
 
Unit testing
Unit testingUnit testing
Unit testingmedsherb
 
Coding and testing In Software Engineering
Coding and testing In Software EngineeringCoding and testing In Software Engineering
Coding and testing In Software Engineering
Satya Bhushan Verma
 
Software Testing - Test Design Techniques
Software Testing - Test Design TechniquesSoftware Testing - Test Design Techniques
Software Testing - Test Design Techniques
Regina Vitalicio
 
Black boxtesting
Black boxtestingBlack boxtesting
Black boxtesting
funtest06
 

Similar to Unit testing (20)

black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
 
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptxEquivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptxBoundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
 
Software Testing strategies, their types and Levels
Software Testing strategies, their types and LevelsSoftware Testing strategies, their types and Levels
Software Testing strategies, their types and Levels
 
Testing
TestingTesting
Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decis...
 
Sqa
Sqa Sqa
Sqa
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testing
 
lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
 
Qc trg 16 apr 2020
Qc trg 16 apr 2020Qc trg 16 apr 2020
Qc trg 16 apr 2020
 
Importance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and AgileImportance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and Agile
 
Unit testing
Unit testingUnit testing
Unit testing
 
Coding and testing In Software Engineering
Coding and testing In Software EngineeringCoding and testing In Software Engineering
Coding and testing In Software Engineering
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
Software Testing - Test Design Techniques
Software Testing - Test Design TechniquesSoftware Testing - Test Design Techniques
Software Testing - Test Design Techniques
 
Black boxtesting
Black boxtestingBlack boxtesting
Black boxtesting
 

Recently uploaded

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 

Recently uploaded (20)

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 

Unit testing

  • 2.
  • 3.
  • 4.
  • 5. Software Testing Software Testing is a process of evaluating a system by manual or automatic means and verify that it satisfies specified requirements or identify differences between expected and actual results.
  • 6. Why Software Testing ????  Error Free  Efficient  Secured  Flexible Software Testing is important as it may cause mission failure, impact on operational performance and reliability, if not done properly !
  • 7. Software Faults and Failures Objective of Testing •Objective of testing: discover faults •A test is successful only when a fault is discovered Fault identification is the process of determining what fault(s) caused the failure Fault correction is the process of making changes to the system so that the faults are removed  Is a level of the software testing process where individual units/components of a software/system are tested.  The purpose is to validate that each unit of the software performs as designed.
  • 10. Unit Testing  Each part tested individually  All components tested at least once  Errors picked up earlier  Scope is smaller, easier to fix errors
  • 11. Unit Testing Ideals  Isolatable  Repeatable  Automatable  Easy to Write
  • 12. Why Unit Test?  Faster Debugging  Faster Development  Better Design  Excellent Regression Tool  Reduce Future Cost Tools: Test driver/harness Code coverage analyzer Automatic test case generator
  • 13. BENEFITS  Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly.  By testing the parts of a program first and then testing the sum of its parts, integration testing becomes much easier.  Unit testing provides a sort of living documentation of the system.
  • 14. Unit Testing Techniques: Functional testing techniques: These are Black box testing techniques which tests the functionality of the application.
  • 15. Some of Functional testing techniques  Input domain testing: This testing technique concentrates on size and type of every input object in terms of boundary value analysis and Equivalence class.  Boundary Value: Boundary value analysis is a software testing design technique in which tests are designed to include representatives of boundary values.  Syntax checking: This is a technique which is used to check the Syntax of the application.  Equivalence Partitioning: This is a software testing technique that divides the input data of a software unit into partition of data from which test cases can be derived
  • 16. Unit Testing Techniques: Error based Techniques: The best person to know the defects in his code is the person who has designed it.
  • 17.
  • 18. BLACK BOX TESTING, also known as Behavioral Testing, is a software testing method in which the internal structure/design/implementation of the item being tested is not known to the tester. These tests can be functional or non-functional, though usually functional. BLACK BOX TESTING
  • 19. Example A tester, without knowledge of the internal structures of a website, tests the web pages by using a browser; providing inputs (clicks, keystrokes) and verifying the outputs against the expected outcome. BLACK BOX TESTING
  • 20. This method is named so because the software program, in the eyes of the tester, is like a black box; inside which one cannot see. This method attempts to find errors in the following categories: •Incorrect or missing functions •Interface errors •Errors in data structures or external database access •Behavior or performance errors •Initialization and termination errors BLACK BOX TESTING
  • 21. METHODS/TECHNIQUES Following are some techniques that can be used for designing black box tests. Equivalence Partitioning: It is a software test design technique that involves dividing input values into valid and invalid partitions and selecting representative values from each partition as test data. Boundary Value Analysis: It is a software test design technique that involves the determination of boundaries for input values and selecting values that are at the boundaries and just inside/ outside of the boundaries as test data. Cause-Effect Graphing: It is a software test design technique that involves identifying the cases (input conditions) and effects (output conditions), producing a Cause-Effect Graph, and generating test cases accordingly.
  • 22. Equivalence Class Partitioning (ECP). 1. Equivalence Class Partitioning : The concept of equivalence partitioning technique comes from equivalence class which in turn comes from equivalence relation. Equivalence class partitioning is a technique of software black box testing in which input data is divided into partitions of equivalent data that is valid and invalid values. This strategy is used to minimize the number of possible test cases while maintains reasonable test coverage. Steps involves in this technique are: •Divide any input domain into two sets that is valid values and invalid values. •Test cases are developed : a. Assign unique identification number to each valid and invalid class of input. b. Write the test cases i.e. valid and invalid test cases
  • 23.
  • 24. As present in the above image, an “AGE” text field accepts only the numbers from 18 to 60. There will be three sets of classes or groups. Two invalid classes will be: a) Less than or equal to 17. b) Greater than or equal to 61. One valid class will be anything between 18 to 60. We have thus reduced the test cases to only 3 test cases based on the formed classes thereby covering all the possibilities. So, testing with anyone value from each set of the class is sufficient to test the above scenario.
  • 25. Example of Equivalence Partitions • Windows filename can contain any characters except / : * ? " < > |. • Filenames can have from 1 to 255 characters. • Creating test cases for filenames: • Will have equivalence partitions for valid characters, invalid characters, valid length names, names that are too short and names that are too long.
  • 26. From the name itself, we can understand that in this technique we focus on the values at boundaries as it is found that many applications have a high amount of issues on the boundaries. Boundary means the values near the limit where the behavior of the system changes. In boundary value analysis both the valid inputs and invalid inputs are being tested to verify the issues. BOUNDARY VALUE ANALYSIS
  • 27. If we want to test a field where values from 1 to 100 should be accepted then we choose the boundary values: 1-1, 1, 1+1, 100-1, 100, and 100+1. Instead of using all the values from 1 to 100, we just use 0, 1, 2, 99, 100, and 101.
  • 28. Example An exam has a pass boundary at 50 percent, merit at 75 percent and distinction at 85 percent. The Valid Boundary values for this scenario will be as follows: 49, 50 - for pass 74, 75 - for merit 84, 85 - for distinction Boundary values are validated against both the valid boundaries and invalid boundaries. The Invalid Boundary Cases for the above example can be given as follows: 0 - for lower limit boundary value 101 - for upper limit boundary value
  • 29. Example on Boundary Value Analysis Test Case Design Technique: Assume, we have to test a field which accepts Age 18 – 56
  • 30. Minimum boundary value is 18 Maximum boundary value is 56 Valid Inputs: 18,19,55,56 Invalid Inputs: 17 and 57 Test case 1: Enter the value 17 (18-1) = Invalid Test case 2: Enter the value 18 = Valid Test case 3: Enter the value 19 (18+1) = Valid Test case 4: Enter the value 55 (56-1) = Valid Test case 5: Enter the value 56 = Valid Test case 6: Enter the value 57 (56+1) =Invalid
  • 31. Example 2: Assume we have to test a text field (Name) which accepts the length between 6-12 characters.
  • 32. Minimum boundary value is 6 Maximum boundary value is 12 Valid text length is 6, 7, 11, 12 Invalid text length is 5, 13 Test case 1: Text length of 5 (min-1) = Invalid Test case 2: Text length of exactly 6 (min) = Valid Test case 3: Text length of 7 (min+1) = Valid Test case 4: Text length of 11 (max-1) = Valid Test case 5: Text length of exactly 12 (max) = Valid Test case 6: Text length of 13 (max+1) = Invalid
  • 33. Example 1 for Boundary Value Analysis : Password field accepts minimum 6 characters and maximum 12 characters. [Range is 6-12] Write Test Cases considering values from Valid region and each Invalid Region and Values which define exact boundary. We need to execute 5 Test Cases for our Example 1. 1. Consider password length less than 6 2. Consider password of length exactly 6 3. Consider password of length between 7 and 11 4. Consider password of length exactly 12 5. Consider password of length more than 12 Note : 1st and 5th Test Cases are considered for Negative Testing
  • 34. Example 2 for Boundary Value Analysis : Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis: 1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case. 2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999. 3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001. Example 3 for Boundary Value Analysis : Name text box which allows 1-30 characters. So in this case writing test cases by entering each character once will be very difficult so then will choose boundary value analysis. So in this case at max 5 test cases will come: Test case1: minimum -1 character: Validating not entering anything in text box Test case2: minimum +1 character: Validating with only one char Test case3: maximum -1 character: Validating with 29 chars Test case4: minimum +1 character: Validating with 31 characters Test case1: any one middle number: validating with 15 chars
  • 35. Cause-effect graph is a software testing technique that involves specifying the causes (input conditions) and effects (output conditions) and producing a Cause-Effect Graph, and designed test cases. Causes are the input conditions and effects are the output conditions. The causes and effects are represented using Boolean graphs. It is also known as Ishikawa diagram as it was invented by Kaoru Ishikawa or fish bone diagram because of the way it looks. steps involved in this technique are : Specify causes and effects.  Produce the cause effect graph. Convert the cause-effect graph into decision table. Convert decision table rules into the test cases. CAUSE EFFECT GRAPH :
  • 36. The Cause-Effect Diagram can be used under these Circumstances: •To determine the current problem so that right decision can be taken very fast. •To narrate the connections of the system with the factors affecting a particular process or effect. •To recognize the probable root causes, the cause for a exact effect, problem, or outcome.
  • 37. A “Cause” stands for a separate input condition that fetches about an internal change in the system. An “Effect” represents an output condition, a system transformation or a state resulting from a combination of causes. Steps to proceed on Cause-Effect Diagram: Firstly: Recognize and describe the input conditions (causes) and actions (effect) Secondly: Build up a cause-effect graph Third: Convert cause-effect graph into a decision table Fourth: Convert decision table rules to test cases. Each column of the decision table represents a test case
  • 38. SYMBOLS USED IN CAUSE-EFFECT GRAPHS:
  • 39.
  • 40. 4. Decision Table Testing : Decision table testing is a software testing technique in which various input combinations and their system behavior are represented in a tabular form. A decision table places the causes (input conditions) and effects (output conditions) in a matrix. Each column represents unique combination. As the name describes that, there are logical relationships like : if(Condition = True) { then action 1 ; } else { action 2; } Then a tester will identify two outputs for two conditions so based on the probable scenarios a Decision table is created to design the test cases.
  • 41. For Example: Take an example of XYZ bank that provides interest rate for the Male senior citizen as 10% and for the rest of the people 9%. In this example condition, C1 has two values as true and false, condition C2 also has two values as true and false. The number of total possible combinations would then be four. This way we can derive test cases using a decision table.
  • 42. 5) Error Guessing This is a classic example of Experience-Based Testing. In this technique, the tester can use his/her experience about the application behavior and functionalities to guess the error-prone areas. Many defects can be found using error guessing where most of the developers usually make mistakes. Few common mistakes that developers usually forget to handle: Divide by zero. Handling null values in text fields. Accepting the Submit button without any value. File upload without attachment. File upload with less than or more than the limit size.
  • 43. ● White-box/Structure-based measures and its related design techniques are described in BS7925-2 standard. ● A software testing technique whereby explicit knowledge of the internal workings of the item being tested are used to select the test data. ● White Box testing is based on specific knowledge of the source code to define the test cases and to examine outputs. INTRODUCTION: WHITE BOX TESTING
  • 44. ● Testing based on an analysis of the internal structure of the component or system. ● White Box testing is also known as Clear Box testing, Glass Box testing, Transparent Box testing, and Structure- Based testing. ● It can be applied at all levels of SDLC. ● Most of the defects are found in Unit, Component & Integration levels is through White-box. DEFINITION: