SlideShare a Scribd company logo
1 of 9
Integration Testing
-Yasub Hashmi
Introduction
Agile Testing Pyramid
Why? & What?
What gets tested?
How? An example of Integration Test
Integration Testing Principles
Agenda
Agile Testing Pyramid
3
Image courtesy: https://martinfowler.com/bliki/TestPyramid.html
Why Integration Testing
4
Image courtesy: http://www.forgottenfiberglass.com
Web API
User Data
from External
Source
Services
Logic
Events
External
Workflow
Repositories
DTO Command Queries
What gets tested?
How? An example of Integration Test
6
var response = restClient.Execute(request);
Assert.IsNotNull(response, "No response");
Assert.AreEqual(System.Net.HttpStatusCode.OK, response.StatusCode, "Invalid status code");
var responseResult = JsonConvert.DeserializeObject<List<LeaveStatusTypeDto>>(response.Content);
Assert.IsNotNull(responseResult, "Invalid StatusType object");
Assert.IsTrue(responseResult.Exists(t => t.Type == "In Process"), "Missing In Process status");
Assert.IsTrue(responseResult.Exists(t => t.Type == "Rejected"), "Missing Rejected status");
Assert.IsTrue(responseResult.Exists(t => t.Type == "Approved"), "Missing Approved status");
}
[TestMethod]
public void ShouldGetAllStatusTypes()
{
var restClient = new RestClient();
restClient.BaseUrl = new Uri("http://dev.SomeSite.com/");
var request = new RestRequest("api/updateRequest/status/type", Method.GET);
Setup (Create Request)
Assert (Assert all
Responses)
Trigger (Execute
Request(s))
Configuration should be minimal
Test cases should be independent
Tests should be efficient
The test suite should clean up after itself
Principles
7
Thank you
Yasub Hashmi
Technical Coach
y.hashmi@agilecockpit.com

More Related Content

What's hot

Code review for secure web applications
Code review for secure web applicationsCode review for secure web applications
Code review for secure web applications
silviad74
 
Unit Testing Best Practices
Unit Testing Best PracticesUnit Testing Best Practices
Unit Testing Best Practices
Tomaš Maconko
 
Automation test
Automation testAutomation test
Automation test
yuyijq
 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
Ortus Solutions, Corp
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
nickokiss
 

What's hot (20)

Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Presentation
PresentationPresentation
Presentation
 
Intro To Unit and integration Testing
Intro To Unit and integration TestingIntro To Unit and integration Testing
Intro To Unit and integration Testing
 
Unit test
Unit testUnit test
Unit test
 
Code review for secure web applications
Code review for secure web applicationsCode review for secure web applications
Code review for secure web applications
 
Unit Testing Best Practices
Unit Testing Best PracticesUnit Testing Best Practices
Unit Testing Best Practices
 
Automation test
Automation testAutomation test
Automation test
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
JMockit
JMockitJMockit
JMockit
 
Introduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylightIntroduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylight
 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
 
Integration Group - Lithium test strategy
Integration Group - Lithium test strategyIntegration Group - Lithium test strategy
Integration Group - Lithium test strategy
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
Unit Testing Done Right
Unit Testing Done RightUnit Testing Done Right
Unit Testing Done Right
 
Effective Unit Testing
Effective Unit TestingEffective Unit Testing
Effective Unit Testing
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
TestNG with selenium
TestNG with seleniumTestNG with selenium
TestNG with selenium
 

Similar to Integration testing - Yasub Hashmi

33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests
Tomek Kaczanowski
 

Similar to Integration testing - Yasub Hashmi (20)

1 aleksandr gritsevski - attd example using
1   aleksandr gritsevski - attd example using1   aleksandr gritsevski - attd example using
1 aleksandr gritsevski - attd example using
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
 
Clean Code - A&BP CC
Clean Code - A&BP CCClean Code - A&BP CC
Clean Code - A&BP CC
 
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
 
Pragmatic unittestingwithj unit
Pragmatic unittestingwithj unitPragmatic unittestingwithj unit
Pragmatic unittestingwithj unit
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
 
Understanding JavaScript Testing
Understanding JavaScript TestingUnderstanding JavaScript Testing
Understanding JavaScript Testing
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best Practices
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?GTAC 2014: What lurks in test suites?
GTAC 2014: What lurks in test suites?
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
Data-Driven Unit Testing for Java
Data-Driven Unit Testing for JavaData-Driven Unit Testing for Java
Data-Driven Unit Testing for Java
 
Unit testing 101
Unit testing 101Unit testing 101
Unit testing 101
 
servlets
servletsservlets
servlets
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Java and SPARQL
Java and SPARQLJava and SPARQL
Java and SPARQL
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests
 
Good Tests Bad Tests
Good Tests Bad TestsGood Tests Bad Tests
Good Tests Bad Tests
 

More from Piyush Rahate

More from Piyush Rahate (11)

The dysfunctions of a scrum team
The dysfunctions of a scrum teamThe dysfunctions of a scrum team
The dysfunctions of a scrum team
 
Spice up your retrospectives
Spice up your retrospectivesSpice up your retrospectives
Spice up your retrospectives
 
Security At The Speed of Innovation - Marudhamaran Gunasekaran
Security At The Speed of Innovation - Marudhamaran GunasekaranSecurity At The Speed of Innovation - Marudhamaran Gunasekaran
Security At The Speed of Innovation - Marudhamaran Gunasekaran
 
Agile testing - Madhu Krishnappa
Agile testing - Madhu KrishnappaAgile testing - Madhu Krishnappa
Agile testing - Madhu Krishnappa
 
Product owner and anti patterns
Product owner and anti patternsProduct owner and anti patterns
Product owner and anti patterns
 
Death of a coder
Death of a coderDeath of a coder
Death of a coder
 
Belief
BeliefBelief
Belief
 
Agile Biology
Agile Biology Agile Biology
Agile Biology
 
Birth of a developer
Birth of a developerBirth of a developer
Birth of a developer
 
Roadblocks on performance highway
Roadblocks on performance highwayRoadblocks on performance highway
Roadblocks on performance highway
 
Agile doing being
Agile doing beingAgile doing being
Agile doing being
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 

Integration testing - Yasub Hashmi

  • 2. Introduction Agile Testing Pyramid Why? & What? What gets tested? How? An example of Integration Test Integration Testing Principles Agenda
  • 3. Agile Testing Pyramid 3 Image courtesy: https://martinfowler.com/bliki/TestPyramid.html
  • 4. Why Integration Testing 4 Image courtesy: http://www.forgottenfiberglass.com
  • 5. Web API User Data from External Source Services Logic Events External Workflow Repositories DTO Command Queries What gets tested?
  • 6. How? An example of Integration Test 6 var response = restClient.Execute(request); Assert.IsNotNull(response, "No response"); Assert.AreEqual(System.Net.HttpStatusCode.OK, response.StatusCode, "Invalid status code"); var responseResult = JsonConvert.DeserializeObject<List<LeaveStatusTypeDto>>(response.Content); Assert.IsNotNull(responseResult, "Invalid StatusType object"); Assert.IsTrue(responseResult.Exists(t => t.Type == "In Process"), "Missing In Process status"); Assert.IsTrue(responseResult.Exists(t => t.Type == "Rejected"), "Missing Rejected status"); Assert.IsTrue(responseResult.Exists(t => t.Type == "Approved"), "Missing Approved status"); } [TestMethod] public void ShouldGetAllStatusTypes() { var restClient = new RestClient(); restClient.BaseUrl = new Uri("http://dev.SomeSite.com/"); var request = new RestRequest("api/updateRequest/status/type", Method.GET); Setup (Create Request) Assert (Assert all Responses) Trigger (Execute Request(s))
  • 7. Configuration should be minimal Test cases should be independent Tests should be efficient The test suite should clean up after itself Principles 7
  • 8.
  • 9. Thank you Yasub Hashmi Technical Coach y.hashmi@agilecockpit.com

Editor's Notes

  1. Bij Introduction natuurlijk ook kennismaken via Agile game