SlideShare a Scribd company logo
Unit testing
Integration testing
 There are several types of testing. Likely, you
focus on one or more types depending on your
specific needs, such as specific contexts or
products.
 From the point of view of a Mule applications
developer, it’s fair to say that there are two main
types of testing that you should focus on when
validating the behavior of your Mule application:
 Unit testing
 Integration testing
 Unit Testing
 The concept of the unit test may vary according
to the programming paradigm that you are
working on, but it always revolves around the
same core concept: to validate the correctness of
an individual unit of source code.
 In the context of unit testing, we consider a unit
of code to be the smallest testable part of an
application. What exactly constitutes the smallest
testable part of an application depends on the
application. In the case of Mule applications, we
consider that the smallest testable part is a Mule
flow (sub-flow); thus this is our unit of code.
 Units of code collaborate between them to create an
actual application. You test individual units of code
with unit tests, and you test how units of code
collaborate between them with integration tests.
 The goal of an Integration test is to validate that
different units of code and modules work together as
intended.
 Ideally, integration tests should aggregate units of
code modules that have already been successfully
unit-tested. For this reason, you should run your
integration tests after your unit tests.
 Depending on the nature of your application,
integration tests may require sandboxes, that
is, environments for your application to
connect to. When working with sandboxes,
take care to ensure that the state of the data
in the sandbox is correct for the test to
produce the intended result. Perform this
before and after running the integration test.
 Modularize your code: Breaking down your code in
different files helps with readability. The usual way to do
this is to group flows that help to achieve a common goal,
or group code according to specific functional criteria.
 Modularizing your code allows you to load only that
portion of code that you actually wish to test, avoiding the
need to load unnecessary configurations during your test.
 Write short flows: Long flows are hard to follow and
sometimes even harder to code; certainly they are harder
to maintain. From the perspective of unit testing, long
flows offer too many scenarios that can be triggered by a
single point. Long flows can force you to perform very
complex evaluations to validate a single scenario and are
best avoided.
 Define execution environments: Parameterize your
code using placeholders. Normal use cases for this
include addresses of outbound endpoints, such as
DB or HTTP. Using placeholders allows you to
modify the actual address when running tests
(either unit or integration), and make it easier to
promote your code between environments
(DEV/QA/UAT/PROD).
 Mule applications running in Mule Runtime v3.8
and newer can only be tested using MUnit v1.2.0 or
higher.

More Related Content

PDF
Dependency injection for beginners
PPT
Less09 2 e_testermodule_8
PPT
Keyword Driven Testing using TestComplete
PPT
Testing_with_TestComplete
PPSX
Test Complete
PPTX
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
PPT
QQ And Advance Query
PPT
Script Driven Testing using TestComplete
Dependency injection for beginners
Less09 2 e_testermodule_8
Keyword Driven Testing using TestComplete
Testing_with_TestComplete
Test Complete
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
QQ And Advance Query
Script Driven Testing using TestComplete

What's hot (20)

PPTX
Fundamentals of unit testing
PPTX
Automation Testing with Test Complete
PPTX
Test complete, work done so far
PPT
Introducing fx cop
PPTX
Testing tools in visual studio
PPTX
UFT Automation Framework Introduction
PPT
Less04 2 e_testermodule_3
PDF
Ivan Pashko - Simplifying test automation with design patterns
PPTX
Uft Basics
PPT
Less02 2 e_testermodule_1
ODP
Rpt ppt
PDF
The Ultimate Guide to Ad0 e407 adobe target architect master
PDF
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
PPTX
Data driven testing
PPT
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
ODP
Why Katalon Studio?
PPTX
RIA 05 - Unit Testing by Ajinkya Prabhune
PPT
Automation framework
PDF
Getting started with_testcomplete
ODP
Workflow in Salesforce
Fundamentals of unit testing
Automation Testing with Test Complete
Test complete, work done so far
Introducing fx cop
Testing tools in visual studio
UFT Automation Framework Introduction
Less04 2 e_testermodule_3
Ivan Pashko - Simplifying test automation with design patterns
Uft Basics
Less02 2 e_testermodule_1
Rpt ppt
The Ultimate Guide to Ad0 e407 adobe target architect master
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
Data driven testing
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
Why Katalon Studio?
RIA 05 - Unit Testing by Ajinkya Prabhune
Automation framework
Getting started with_testcomplete
Workflow in Salesforce
Ad

Viewers also liked (16)

PDF
Medicaid rules and non emergency medical transport
PPTX
приемы управления потоками покупателей в тд «на
PDF
Deloitte Social Media Analytics Event: Social Media legal considerations
PDF
Ciberbullying
PDF
One hook email example
DOCX
Antonio Pedro 2016 CV
PPTX
How To Maximize Dropbox For Your Business
PPTX
5.05 analyzing 20th century poetry
PPT
1.27 Crimp Contacts Training
PDF
Medicaid Planning: Protecting Your Assets and Your Eligibility
PPTX
распредлог
PDF
Tune up your data science process
PDF
Webinar: Accountable Health Communities Model - State Medicaid Agency Roles
PDF
10 años de google en méxico tca
PPTX
Community IT June 2016 Webinar - Dropbox and Other Alternatives
PPTX
Community IT Webinar - Planning for an Office Move
Medicaid rules and non emergency medical transport
приемы управления потоками покупателей в тд «на
Deloitte Social Media Analytics Event: Social Media legal considerations
Ciberbullying
One hook email example
Antonio Pedro 2016 CV
How To Maximize Dropbox For Your Business
5.05 analyzing 20th century poetry
1.27 Crimp Contacts Training
Medicaid Planning: Protecting Your Assets and Your Eligibility
распредлог
Tune up your data science process
Webinar: Accountable Health Communities Model - State Medicaid Agency Roles
10 años de google en méxico tca
Community IT June 2016 Webinar - Dropbox and Other Alternatives
Community IT Webinar - Planning for an Office Move
Ad

Similar to Introduction to testing mule (20)

PPTX
Mule testing
PDF
What Is Unit Testing_ A Complete Guide With Examples.pdf
PDF
What Is Unit Testing A Complete Guide With Examples.pdf
PDF
How Unit Testing Strengthens Software Reliability
PDF
Code Coverage vs Test Coverage_ A Complete Guide.pdf
PDF
Code Coverage vs Test Coverage_ A Complete Guide.pdf
PDF
A Comprehensive Guide to Essential Workflows for Improving Flutter Unit Testi...
PDF
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
PDF
Unit Testing Guide. Helps to understand the basics of unit testing .
PPTX
unittesting-190620114546 (1).pptx document
PDF
Unit Testing to Support Reusable for Component-Based Software Engineering
PDF
Increasing Quality with DevOps
PPTX
Coldbox developer training – session 4
PDF
How to Make the Most of Regression and Unit Testing_ A Comprehensive Guide.pdf
PPTX
SOFTWARE TESTING.pptx
PDF
Testing Strategies in .NET: From Unit Testing to Integration Testing
PDF
Test Automation Frameworks- The Complete Guide.pdf
PDF
Unit Testing vs End-To-End Testing_ Understanding Key Differences.pdf
Mule testing
What Is Unit Testing_ A Complete Guide With Examples.pdf
What Is Unit Testing A Complete Guide With Examples.pdf
How Unit Testing Strengthens Software Reliability
Code Coverage vs Test Coverage_ A Complete Guide.pdf
Code Coverage vs Test Coverage_ A Complete Guide.pdf
A Comprehensive Guide to Essential Workflows for Improving Flutter Unit Testi...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Unit Testing Guide. Helps to understand the basics of unit testing .
unittesting-190620114546 (1).pptx document
Unit Testing to Support Reusable for Component-Based Software Engineering
Increasing Quality with DevOps
Coldbox developer training – session 4
How to Make the Most of Regression and Unit Testing_ A Comprehensive Guide.pdf
SOFTWARE TESTING.pptx
Testing Strategies in .NET: From Unit Testing to Integration Testing
Test Automation Frameworks- The Complete Guide.pdf
Unit Testing vs End-To-End Testing_ Understanding Key Differences.pdf

More from Ramakrishna kapa (20)

PPTX
Load balancer in mule
PPTX
Anypoint connectors
PPTX
Batch processing
PPTX
Msmq connectivity
PPTX
Scopes in mule
PPTX
Data weave more operations
PPTX
Basic math operations using dataweave
PPTX
Dataweave types operators
PPTX
Operators in mule dataweave
PPTX
Data weave in mule
PPTX
Servicenow connector
PPTX
Choice flow control
PPTX
Message enricher example
PPTX
Mule exception strategies
PPTX
Anypoint connector basics
PPTX
Mule global elements
PPTX
Mule message structure and varibles scopes
PPTX
How to create an api in mule
PPTX
Log4j is a reliable, fast and flexible
PPTX
Load balancer in mule
Anypoint connectors
Batch processing
Msmq connectivity
Scopes in mule
Data weave more operations
Basic math operations using dataweave
Dataweave types operators
Operators in mule dataweave
Data weave in mule
Servicenow connector
Choice flow control
Message enricher example
Mule exception strategies
Anypoint connector basics
Mule global elements
Mule message structure and varibles scopes
How to create an api in mule
Log4j is a reliable, fast and flexible

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Advanced IT Governance
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
MYSQL Presentation for SQL database connectivity
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
GamePlan Trading System Review: Professional Trader's Honest Take
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Monthly Chronicles - July 2025
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Advanced IT Governance
Spectral efficient network and resource selection model in 5G networks
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Introduction to testing mule

  • 2.  There are several types of testing. Likely, you focus on one or more types depending on your specific needs, such as specific contexts or products.  From the point of view of a Mule applications developer, it’s fair to say that there are two main types of testing that you should focus on when validating the behavior of your Mule application:  Unit testing  Integration testing
  • 3.  Unit Testing  The concept of the unit test may vary according to the programming paradigm that you are working on, but it always revolves around the same core concept: to validate the correctness of an individual unit of source code.  In the context of unit testing, we consider a unit of code to be the smallest testable part of an application. What exactly constitutes the smallest testable part of an application depends on the application. In the case of Mule applications, we consider that the smallest testable part is a Mule flow (sub-flow); thus this is our unit of code.
  • 4.  Units of code collaborate between them to create an actual application. You test individual units of code with unit tests, and you test how units of code collaborate between them with integration tests.  The goal of an Integration test is to validate that different units of code and modules work together as intended.  Ideally, integration tests should aggregate units of code modules that have already been successfully unit-tested. For this reason, you should run your integration tests after your unit tests.
  • 5.  Depending on the nature of your application, integration tests may require sandboxes, that is, environments for your application to connect to. When working with sandboxes, take care to ensure that the state of the data in the sandbox is correct for the test to produce the intended result. Perform this before and after running the integration test.
  • 6.  Modularize your code: Breaking down your code in different files helps with readability. The usual way to do this is to group flows that help to achieve a common goal, or group code according to specific functional criteria.  Modularizing your code allows you to load only that portion of code that you actually wish to test, avoiding the need to load unnecessary configurations during your test.  Write short flows: Long flows are hard to follow and sometimes even harder to code; certainly they are harder to maintain. From the perspective of unit testing, long flows offer too many scenarios that can be triggered by a single point. Long flows can force you to perform very complex evaluations to validate a single scenario and are best avoided.
  • 7.  Define execution environments: Parameterize your code using placeholders. Normal use cases for this include addresses of outbound endpoints, such as DB or HTTP. Using placeholders allows you to modify the actual address when running tests (either unit or integration), and make it easier to promote your code between environments (DEV/QA/UAT/PROD).  Mule applications running in Mule Runtime v3.8 and newer can only be tested using MUnit v1.2.0 or higher.