SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
Unit Testing vs
Integration Testing –
What’s the difference
rockinterview.in
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.
Unit Testing vs Integration Testing
Unit Testing vs Integration Testing

Mais conteúdo relacionado

Mais procurados

Software Inspection And Defect Management
Software Inspection And Defect ManagementSoftware Inspection And Defect Management
Software Inspection And Defect Management
Ajay K
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
Confiz
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
 

Mais procurados (20)

Unit testing
Unit testingUnit testing
Unit testing
 
Integration test
Integration testIntegration test
Integration test
 
Integration testing
Integration testingIntegration testing
Integration testing
 
What Is Functional Testing?
What Is Functional Testing?What Is Functional Testing?
What Is Functional Testing?
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
What is integration testing
What is integration testingWhat is integration testing
What is integration testing
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
Integration testing
Integration testingIntegration testing
Integration testing
 
Test automation
Test automationTest automation
Test automation
 
3.software testing
3.software testing3.software testing
3.software testing
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
INTEGRATION TESTING
INTEGRATION TESTINGINTEGRATION TESTING
INTEGRATION TESTING
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Software Inspection And Defect Management
Software Inspection And Defect ManagementSoftware Inspection And Defect Management
Software Inspection And Defect Management
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
What is Web Testing?
What is Web Testing?   What is Web Testing?
What is Web Testing?
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Test Execution
Test ExecutionTest Execution
Test Execution
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Software testing
Software testing Software testing
Software testing
 

Semelhante a Unit Testing vs Integration Testing

Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
Komal Garg
 
softwaretesting-140721025833-phpapp02.pdf
softwaretesting-140721025833-phpapp02.pdfsoftwaretesting-140721025833-phpapp02.pdf
softwaretesting-140721025833-phpapp02.pdf
SHAMSHADHUSAIN9
 

Semelhante a Unit Testing vs Integration Testing (20)

unittesting-190620114546 (1).pptx document
unittesting-190620114546 (1).pptx documentunittesting-190620114546 (1).pptx document
unittesting-190620114546 (1).pptx document
 
Unit test Android
Unit test AndroidUnit test Android
Unit test Android
 
Testing
Testing Testing
Testing
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
Manuel testing word
Manuel testing wordManuel testing word
Manuel testing word
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
 
Software testing
Software testingSoftware testing
Software testing
 
Software testing
Software testingSoftware testing
Software testing
 
Testing and types of Testing
Testing and types of TestingTesting and types of Testing
Testing and types of Testing
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
softwaretesting-140721025833-phpapp02.pdf
softwaretesting-140721025833-phpapp02.pdfsoftwaretesting-140721025833-phpapp02.pdf
softwaretesting-140721025833-phpapp02.pdf
 
Levels Of Testing.pptx
Levels Of Testing.pptxLevels Of Testing.pptx
Levels Of Testing.pptx
 
Integration testing complete overview
Integration testing complete overviewIntegration testing complete overview
Integration testing complete overview
 
software engineering
software engineeringsoftware engineering
software engineering
 
Software test life cycle
Software test life cycleSoftware test life cycle
Software test life cycle
 

Mais de Rock Interview

Mais de Rock Interview (20)

Rock Interview Has The Best Solution For You Job Needs
Rock Interview Has The Best Solution For You Job Needs Rock Interview Has The Best Solution For You Job Needs
Rock Interview Has The Best Solution For You Job Needs
 
Secure your career with Rock Interview by your side
Secure your career with Rock Interview by your sideSecure your career with Rock Interview by your side
Secure your career with Rock Interview by your side
 
UPSKILL OR RESKILL TO SECURE YOUR CAREER
UPSKILL OR RESKILL TO SECURE YOUR CAREERUPSKILL OR RESKILL TO SECURE YOUR CAREER
UPSKILL OR RESKILL TO SECURE YOUR CAREER
 
Our guide to a successful job hunt during lockdown
Our guide to a successful job hunt during lockdownOur guide to a successful job hunt during lockdown
Our guide to a successful job hunt during lockdown
 
A guide to stay away from fake job alerts
A guide to stay away from fake job alertsA guide to stay away from fake job alerts
A guide to stay away from fake job alerts
 
How to steer clear of the Recession blow
How to steer clear of the Recession blowHow to steer clear of the Recession blow
How to steer clear of the Recession blow
 
A simple guide to get you through isolation
A simple guide to get you through isolationA simple guide to get you through isolation
A simple guide to get you through isolation
 
Cloudy With A Chance For Freelancing For a career in Big Data & Analytics
Cloudy With A Chance For Freelancing For a career in Big Data & AnalyticsCloudy With A Chance For Freelancing For a career in Big Data & Analytics
Cloudy With A Chance For Freelancing For a career in Big Data & Analytics
 
Top Strategic Tech Trend Predictions For 2020
Top Strategic Tech Trend Predictions For 2020Top Strategic Tech Trend Predictions For 2020
Top Strategic Tech Trend Predictions For 2020
 
Unusual Interview Questions
Unusual Interview QuestionsUnusual Interview Questions
Unusual Interview Questions
 
Top Soft Skills Employers Are Looking For
Top Soft Skills Employers Are Looking For Top Soft Skills Employers Are Looking For
Top Soft Skills Employers Are Looking For
 
Full Stack Developer Interview Questions
Full Stack Developer Interview QuestionsFull Stack Developer Interview Questions
Full Stack Developer Interview Questions
 
Machine Learning Interview Questions
Machine Learning Interview QuestionsMachine Learning Interview Questions
Machine Learning Interview Questions
 
Five Mistakes Beginner Devops Professionals Make
Five Mistakes Beginner Devops Professionals MakeFive Mistakes Beginner Devops Professionals Make
Five Mistakes Beginner Devops Professionals Make
 
Top Technology Trends and Related Jobs
Top Technology Trends and Related JobsTop Technology Trends and Related Jobs
Top Technology Trends and Related Jobs
 
The Essentials Of Test Driven Development
The Essentials Of Test Driven Development The Essentials Of Test Driven Development
The Essentials Of Test Driven Development
 
Five Powerful Skills To Boost Programme career
Five Powerful Skills To Boost Programme careerFive Powerful Skills To Boost Programme career
Five Powerful Skills To Boost Programme career
 
Machine Learning Is Saving Major Sectors Time and Money
Machine Learning Is Saving Major Sectors Time and MoneyMachine Learning Is Saving Major Sectors Time and Money
Machine Learning Is Saving Major Sectors Time and Money
 
Secrets Of High Performing Agile Teams
Secrets Of High Performing Agile TeamsSecrets Of High Performing Agile Teams
Secrets Of High Performing Agile Teams
 
How To Tidy Up Your Test Code
How To Tidy Up Your Test CodeHow To Tidy Up Your Test Code
How To Tidy Up Your Test Code
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Unit Testing vs Integration Testing

  • 1. Unit Testing vs Integration Testing – What’s the difference
  • 2. rockinterview.in 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.
  • 3. 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
  • 4. 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).
  • 5. 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.
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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.