SlideShare a Scribd company logo
1 of 22
Unit Testing vs
Integration Testing
– What’s the
difference
Confusion between Unit Testing and Integration Testing
For someone looking to start a career in software testing, you might have came
across terms such as Unit Testing and Integration Testing. You would have wondered
what is the difference between the two.
In Software Development Lifecycle, a software is developed by many developers who
work on individual modules. These modules are then integrated into a full-fledged
software. The testing specific to these modules and the integrated software is what is called
Unit and Integration Testing respectively.
rockinterview.in
What is Unit Testing?
At its core, unit testing is a type of test to check if an individual small piece of code is doing
what it is supposed to do.
A Unit Test is -
Repeatable: You can rerun the same test as many times as you want.
Consistent: Every time you run it, you get the same result.
In Memory: It has no “hard” dependencies on anything not in memory (such as file system,
databases, network)
Fast: It should take less than half a second to run a unit test.
Checking one single concern or “use case” in the system
rockinterview.in
What is Integration Testing?
Integration testing is a type of testing to check if different pieces of the modules work
together as a whole.
An Integration Test might -
Use system dependent values that change dynamically (such as DateTime.Now, or
Environment.MachineName)
Create objects of which it has little control (such as threads, random number
generators)
Reach out to external systems or local machine dependencies (from calling web
services to using local configuration files)
Test multiple things in the course of one test case (from database integrity to
configurations, to protocols, to system logic; all in one go).
rockinterview.in
Two Methods for Integration Testing
Bottom-up integration testing typically
begins with unit testing, followed by
tests of progressively higher-level
combinations of units called modules
or builds.
The top-down integration testing
begins with the highest-level modules
being tested first and progressively
lower-level modules are tested
afterwards.
Bottom-up Method Top-down Method
In a comprehensive software development environment, bottom-up testing is usually done first,
followed by top-down testing.
The process concludes with multiple tests of the complete application, preferably in scenarios
designed to mimic those it will encounter in customers' computers, systems, and networks.
rockinterview.in
Differences between Unit Testing and Integration Testing
The objective of Unit Testing is to test
each part of the program to make sure
that the individual parts are working
correctly.
Checks a single component of an
applications.
The scope of unit testing is narrow and
focuses on a small piece of code.
Unit testing only test the functionality of
individual units and may not catch
integration or system wide errors.
The objective of Integration Testing is
to combine modules in the
application and test if they work
together as a group.
The behavior of integration module is
considered in integration testing.
The scope of integration testing is
broad and puts the whole application
under test.
Integration Testing uncovers errors
that occur when integrating individual
modules into the overall system.
Unit Testing Integration Testing
rockinterview.in
Differences between Unit Testing and Integration Testing
It can be performed any time and
doesn’t have any dependencies.
Unit Tests shouldn’t have any
dependencies on outside systems.
It starts with module specification.
Pays attention to the behavior of single
modules.
Requires detailed visibility of the code.
It is usually carried out after Unit
Testing and before System
Testing
Integration Tests depends on outside
systems like Database, Hardware,
etc.
It starts with interface specification.
Pays attention to integration among
modules.
Requires detailed visibility of the
integration structure.
Unit Testing Integration Testing
rockinterview.in
Differences between Unit Testing and Integration Testing
It is usually executed by developers.
It is easy to find errors.
It is not further sub divided into
different types.
Unit tests are easy to write and
execute.
It is a kind of white box testing.
It is usually executed by a testing
team.
It is relatively difficult to find errors.
It is further sub divided into top-down,
bottom-up integration testing and so
on
Integration tests require much more
effort to write and test effectively.
It comes under both black box and
white box testing.
Unit Testing Integration Testing
rockinterview.in
Conclusion
Testing is a way to ensure that the software developed delivers on the objectives in a
predictable manner.
Unit and Integration Testing are equally important to verify the working on individual
modules as well as the overall system. Therefore, Unit and Integration Testing should
be an integral part of the development process.
rockinterview.in
BLACKBOX AND WHITEBOX TESTING
Prepared By:
Mr. Surya Prakash Pandey
Awadhesh Pratap Singh Uniersity,
Rewa(M.P.)
BLACKBOX TESTING
� In Black Box Testing we just focus on inputs and
output of the software system without bothering
about internal knowledge of the software program.
[Figure of Blackbox Testing]
� The above Black Box executable program can be any
software system you want to test.
BLACKBOX TESTING
� By applying black-box techniques, you derive a set of
test cases that satisfy the following criteria:
� (1) test cases that reduce, by a count that is greater
than one the number of additional test cases that must
be designed to achieve reasonable testing, and
� (2) test cases that tell you something about the
presence or absence of classes of errors, rather than
an error associated only with the specific test at hand.
BLACKBOX TESTING
� Blackbox Techniques/ Methods:
⚫ 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 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.
WHITEBOX TESTING:
� White Box Testing (also known as Clear Box Testing,
Open Box Testing, Glass Box Testing, Transparent Box
Testing, Code-Based Testing or Structural Testing) is
a software testing method in which the internal
structure/ design/ implementation of the item being
tested is known to the tester.
� White Box Testing is like the work of a mechanic who
examines the engine to see why the car is not moving.
� Using white-box testing methods, you can derive test
cases that
� (1) guarantee that all independent paths within a
module have been exercised at least once
� (2) exercise all logical decisions on their true and
false sides
� (3) execute all loops at their boundaries and within
their operational bounds
� (4) exercise internal data structures to ensure their
validity.
WHITEBOX TESTING:
WHITEBOX TESTING:
[Figure of Whitebox Testing Approach]
WHITEBOX TESTING:
Why and When White-Box Testing:
� White box testing is mainly used for detecting logical
errors in the program code.
� It is used for debugging a code, finding random
typographical errors, and uncovering incorrect
programming assumptions.
� White box testing is done at low level design and
implementable code.
� It can be applied at all levels of system development
especially Unit, system and integration testing.
� White box testing can be used for other development
artifacts like requirements analysis, designing and test
cases.
WHITEBOX TESTING:
Whitebox Testing Techniques:
� Following are Whitebox testing techniques:
⚫ Statement coverage: This technique is aimed at
exercising all programming statements with minimal
tests.
⚫ Branch and decision coverage: This technique is
running a series of tests to ensure that all branches are
tested at least once.
� Tools: An example of a tool that handles branch
coverage testing for C, C++ and Java applications
is TCAT-PATH
⚫ Path coverage: This technique corresponds to testing
all possible paths which means that each statement
and branch is covered.
WHITEBOX TESTING:
[Figure of Path coverage Example]
COMPARISON OF BLACKBOX TESTING AND WHITEBOX TESTING:
COMPARISON OF BLACKBOX TESTING AND WHITEBOX
TESTING:
THANK YOU

More Related Content

Similar to unittesting-190620114546 (1).pptx document

Testing in Software Engineering.docx
Testing in Software Engineering.docxTesting in Software Engineering.docx
Testing in Software Engineering.docx
8759000398
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
 

Similar to unittesting-190620114546 (1).pptx document (20)

Testing
TestingTesting
Testing
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 
Software testing
Software testingSoftware testing
Software testing
 
White box & black box testing
White box & black box testingWhite box & black box testing
White box & black box testing
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Software testing
Software testingSoftware testing
Software testing
 
Testing in Software Engineering.docx
Testing in Software Engineering.docxTesting in Software Engineering.docx
Testing in Software Engineering.docx
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Testing
Testing Testing
Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Testing chapter updated (1)
Testing chapter updated (1)Testing chapter updated (1)
Testing chapter updated (1)
 
Unit testing - what is its importance
Unit testing - what is its importanceUnit testing - what is its importance
Unit testing - what is its importance
 
Software testing basic
Software testing basicSoftware testing basic
Software testing basic
 
black and white Box testing.pptx
black and white Box testing.pptxblack and white Box testing.pptx
black and white Box testing.pptx
 
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdfUnderstanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
 
Unit test Android
Unit test AndroidUnit test Android
Unit test Android
 
Testing and types of Testing
Testing and types of TestingTesting and types of Testing
Testing and types of Testing
 
Ch 2 Apraoaches Of Software Testing
Ch 2 Apraoaches Of Software Testing Ch 2 Apraoaches Of Software Testing
Ch 2 Apraoaches Of Software Testing
 
White-box testing.pptx
White-box testing.pptxWhite-box testing.pptx
White-box testing.pptx
 

More from AkshayaM79 (7)

LOYOLA.pptx. .
LOYOLA.pptx.                               .LOYOLA.pptx.                               .
LOYOLA.pptx. .
 
Docker_tech_guild ppt.ppt technical guild
Docker_tech_guild ppt.ppt technical guildDocker_tech_guild ppt.ppt technical guild
Docker_tech_guild ppt.ppt technical guild
 
Dept Presentation - AI&DS.pptx aids department
Dept Presentation - AI&DS.pptx aids departmentDept Presentation - AI&DS.pptx aids department
Dept Presentation - AI&DS.pptx aids department
 
IT dept Presentation (1).pptx it department
IT dept Presentation (1).pptx it departmentIT dept Presentation (1).pptx it department
IT dept Presentation (1).pptx it department
 
LIBRARY MANAGEMENT SYSTEM.pptx for students
LIBRARY MANAGEMENT SYSTEM.pptx for studentsLIBRARY MANAGEMENT SYSTEM.pptx for students
LIBRARY MANAGEMENT SYSTEM.pptx for students
 
Student information system_20240408_110803_0000.pdf
Student information system_20240408_110803_0000.pdfStudent information system_20240408_110803_0000.pdf
Student information system_20240408_110803_0000.pdf
 
Student information system_20240408_110803_0000.pdf
Student information system_20240408_110803_0000.pdfStudent information system_20240408_110803_0000.pdf
Student information system_20240408_110803_0000.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 

unittesting-190620114546 (1).pptx document

  • 1. Unit Testing vs Integration Testing – What’s the difference
  • 2. Confusion between Unit Testing and Integration Testing For someone looking to start a career in software testing, you might have came across terms such as Unit Testing and Integration Testing. You would have wondered what is the difference between the two. In Software Development Lifecycle, a software is developed by many developers who work on individual modules. These modules are then integrated into a full-fledged software. The testing specific to these modules and the integrated software is what is called Unit and Integration Testing respectively. rockinterview.in
  • 3. What is Unit Testing? At its core, unit testing is a type of test to check if an individual small piece of code is doing what it is supposed to do. A Unit Test is - Repeatable: You can rerun the same test as many times as you want. Consistent: Every time you run it, you get the same result. In Memory: It has no “hard” dependencies on anything not in memory (such as file system, databases, network) Fast: It should take less than half a second to run a unit test. Checking one single concern or “use case” in the system rockinterview.in
  • 4. What is Integration Testing? Integration testing is a type of testing to check if different pieces of the modules work together as a whole. An Integration Test might - Use system dependent values that change dynamically (such as DateTime.Now, or Environment.MachineName) Create objects of which it has little control (such as threads, random number generators) Reach out to external systems or local machine dependencies (from calling web services to using local configuration files) Test multiple things in the course of one test case (from database integrity to configurations, to protocols, to system logic; all in one go). rockinterview.in
  • 5. Two Methods for Integration Testing Bottom-up integration testing typically begins with unit testing, followed by tests of progressively higher-level combinations of units called modules or builds. The top-down integration testing begins with the highest-level modules being tested first and progressively lower-level modules are tested afterwards. Bottom-up Method Top-down Method In a comprehensive software development environment, bottom-up testing is usually done first, followed by top-down testing. The process concludes with multiple tests of the complete application, preferably in scenarios designed to mimic those it will encounter in customers' computers, systems, and networks. rockinterview.in
  • 6. Differences between Unit Testing and Integration Testing The objective of Unit Testing is to test each part of the program to make sure that the individual parts are working correctly. Checks a single component of an applications. The scope of unit testing is narrow and focuses on a small piece of code. Unit testing only test the functionality of individual units and may not catch integration or system wide errors. The objective of Integration Testing is to combine modules in the application and test if they work together as a group. The behavior of integration module is considered in integration testing. The scope of integration testing is broad and puts the whole application under test. Integration Testing uncovers errors that occur when integrating individual modules into the overall system. Unit Testing Integration Testing rockinterview.in
  • 7. Differences between Unit Testing and Integration Testing It can be performed any time and doesn’t have any dependencies. Unit Tests shouldn’t have any dependencies on outside systems. It starts with module specification. Pays attention to the behavior of single modules. Requires detailed visibility of the code. It is usually carried out after Unit Testing and before System Testing Integration Tests depends on outside systems like Database, Hardware, etc. It starts with interface specification. Pays attention to integration among modules. Requires detailed visibility of the integration structure. Unit Testing Integration Testing rockinterview.in
  • 8. Differences between Unit Testing and Integration Testing It is usually executed by developers. It is easy to find errors. It is not further sub divided into different types. Unit tests are easy to write and execute. It is a kind of white box testing. It is usually executed by a testing team. It is relatively difficult to find errors. It is further sub divided into top-down, bottom-up integration testing and so on Integration tests require much more effort to write and test effectively. It comes under both black box and white box testing. Unit Testing Integration Testing rockinterview.in
  • 9. Conclusion Testing is a way to ensure that the software developed delivers on the objectives in a predictable manner. Unit and Integration Testing are equally important to verify the working on individual modules as well as the overall system. Therefore, Unit and Integration Testing should be an integral part of the development process. rockinterview.in
  • 10. BLACKBOX AND WHITEBOX TESTING Prepared By: Mr. Surya Prakash Pandey Awadhesh Pratap Singh Uniersity, Rewa(M.P.)
  • 11. BLACKBOX TESTING � In Black Box Testing we just focus on inputs and output of the software system without bothering about internal knowledge of the software program. [Figure of Blackbox Testing] � The above Black Box executable program can be any software system you want to test.
  • 12. BLACKBOX TESTING � By applying black-box techniques, you derive a set of test cases that satisfy the following criteria: � (1) test cases that reduce, by a count that is greater than one the number of additional test cases that must be designed to achieve reasonable testing, and � (2) test cases that tell you something about the presence or absence of classes of errors, rather than an error associated only with the specific test at hand.
  • 13. BLACKBOX TESTING � Blackbox Techniques/ Methods: ⚫ 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 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.
  • 14. WHITEBOX TESTING: � White Box Testing (also known as Clear Box Testing, Open Box Testing, Glass Box Testing, Transparent Box Testing, Code-Based Testing or Structural Testing) is a software testing method in which the internal structure/ design/ implementation of the item being tested is known to the tester. � White Box Testing is like the work of a mechanic who examines the engine to see why the car is not moving. � Using white-box testing methods, you can derive test cases that � (1) guarantee that all independent paths within a module have been exercised at least once
  • 15. � (2) exercise all logical decisions on their true and false sides � (3) execute all loops at their boundaries and within their operational bounds � (4) exercise internal data structures to ensure their validity. WHITEBOX TESTING:
  • 16. WHITEBOX TESTING: [Figure of Whitebox Testing Approach]
  • 17. WHITEBOX TESTING: Why and When White-Box Testing: � White box testing is mainly used for detecting logical errors in the program code. � It is used for debugging a code, finding random typographical errors, and uncovering incorrect programming assumptions. � White box testing is done at low level design and implementable code. � It can be applied at all levels of system development especially Unit, system and integration testing. � White box testing can be used for other development artifacts like requirements analysis, designing and test cases.
  • 18. WHITEBOX TESTING: Whitebox Testing Techniques: � Following are Whitebox testing techniques: ⚫ Statement coverage: This technique is aimed at exercising all programming statements with minimal tests. ⚫ Branch and decision coverage: This technique is running a series of tests to ensure that all branches are tested at least once. � Tools: An example of a tool that handles branch coverage testing for C, C++ and Java applications is TCAT-PATH ⚫ Path coverage: This technique corresponds to testing all possible paths which means that each statement and branch is covered.
  • 19. WHITEBOX TESTING: [Figure of Path coverage Example]
  • 20. COMPARISON OF BLACKBOX TESTING AND WHITEBOX TESTING:
  • 21. COMPARISON OF BLACKBOX TESTING AND WHITEBOX TESTING: