SlideShare a Scribd company logo
1 of 37
Download to read offline
Bootify your Test Pyramid
Benedikt Ritter
1
WHO IS THIS GUY?
Software Crafter
Java & Scala Guy
Open Source Enthusiast
IT Consultant
Podcaster: http://autoweird.fm
Social Media:
2
@BenediktRitter
github.com/britter
AGENDA
3
Test Types in Web Apps	
My View of State of the Art Testing
Test Pyramid	
Short Recap of Test Pyramid
Demo	
Let’s look at some Code!
Conclusion	
What have we learned today?
Discussion / Q&A	
Anything else you want to know?
Bootify Your Test Pyramid
4
The test pyramid is a concept developed by Mike Cohn, described
in his book Succeeding with Agile. Its essential point is that you
should have many more low-level unit tests than high level end-to-
end tests running through a GUI.
Source: https://martinfowler.com/bliki/TestPyramid.html
Short recap of the Test Pyramid
INTRODUCTION
Test Kinds
5
System Test
Unit Test
Integration Test
Smoke Test
Penetration Test
Performance Test
Acceptance Test
Feature TestUI Test
Component Test
Module Test
Test Pyramid
6
System Test
Unit Test
Integration Test
Test Pyramid
6
System Test
Unit Test
Integration Test
€€€
€
7
TEST TYPES IN WEB APPS
My View of State of the Art Testing
This model of different test types and was inspired by the „Crafting Code“ Workshop by Sandro
Mancuso. Sandro has a very pure and reduced approach for creating application which doesn’t
require a lot of frameworks. I adopted his technique of testing different parts of application to
leverage Spring Boot testing support. A video of Sandro doing Outside-In TDD can be found here:
https://www.youtube.com/watch?v=XHnuMjah6ps
Test Types in Context of Web Applications
8
Test Types in Context of Web Applications
8
Domain
Test Types in Context of Web Applications
8
Domain
B
B
B
B
Test Types in Context of Web Applications
8
R
R
Domain
B
B
B
B
Test Types in Context of Web Applications
8
C
C
C
R
R
Domain
B
B
B
B
Test Types in Context of Web Applications
8
C
C
C
R
R
I
I
Domain
B
B
B
B
Test Types in Context of Web Applications
9
C
C
C
R
R
I
I
Domain
B
B
B
B
Test Types in Context of Web Applications
9
C
C
C
R
R
I
I
Domain
B
B
B
B
Test Types in Context of Web Applications
9
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
Test Types in Context of Web Applications
9
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
UNIT TEST
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
INTEGRATIONS TEST
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
INTEGRATIONS TEST
M
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
INTEGRATIONS TEST
M
M
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
INTEGRATIONS TEST
M
M
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
Test Types in Context of Web Applications
10
C
C
C
R
R
I
I
Data StorageDomain
B
B
B
B
SYSTEM TEST
Bootified Test Pyramid
11
System Test
Unit Test
Integration Test
Bootified Test Pyramid
11
System Test
Unit Test
Integration Test
Bootified Test Pyramid
11
System Test
Unit Test
Integration Test
JUnit 5, assertJ
Builders & Templates
Bootified Test Pyramid
11
System Test
Unit Test
Integration Test
JUnit 5, assertJ
Builders & Templates
@DataJpaTest & TestEntityManager
@WebMvcTest & MockMvc
Bootified Test Pyramid
11
System Test
Unit Test
Integration Test
JUnit 5, assertJ
Builders & Templates
@DataJpaTest & TestEntityManager
@WebMvcTest & MockMvc
@SpringBootTest
12
DEMO
Let’s work with Orders
Web application managing orders. It provides an HTTP interface for
creating and retrieving orders. When creating an order, a delivery price
is calculated based on the total weight of that order. The delivery price
is persisted along side the order data inside a RDMS for reporting.
Code: https://github.com/britter/bootify-testpyramid
13
CONCLUSION
What have we learned today?
There are different types of tests for each layer of an application. A well
defined domain model together with templates can help tremendously
setting up tests on each layer. Spring Boot provides the necessary
infrastructure to easily write Integration and System Tests.
Working with security, e.g. @MockUser
1
Integration tests against middlewares like
message queues
System tests using Test Containers
Custom assertJ assertions
Other test types, for example acceptance
tests using Cucumber
2
3
4
5
NOT COVERED TODAY
14
There is more!
15
Our mission – to promote agile development, innovation 	
and technology – extends through everything we do.
codecentric AG	
Hochstraße 11	
42697 Solingen
E-Mail: info@codecentric.de
www.codecentric.de
Telefon: +49 (0) 212. 23 36 28 0

Telefax: +49 (0) 212.23 36 28 79

Address
Contact Info
Telephone
Stay connected
16

More Related Content

What's hot

Continuous delivery @CD Summit Stockholm
Continuous delivery @CD Summit StockholmContinuous delivery @CD Summit Stockholm
Continuous delivery @CD Summit StockholmMichael Medin
 
Ie9 и ie10. алекс могилевский. зал 2
Ie9 и ie10. алекс могилевский. зал 2Ie9 и ie10. алекс могилевский. зал 2
Ie9 и ie10. алекс могилевский. зал 2rit2011
 
Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Timo Stollenwerk
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghEngineor
 
Continuous delivery from the trenches Redhat Forum Edition
Continuous delivery from the trenches Redhat Forum EditionContinuous delivery from the trenches Redhat Forum Edition
Continuous delivery from the trenches Redhat Forum EditionMichael Medin
 
Auditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub RepositoriesAuditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub RepositoriesEvgeny Poberezkin
 

What's hot (6)

Continuous delivery @CD Summit Stockholm
Continuous delivery @CD Summit StockholmContinuous delivery @CD Summit Stockholm
Continuous delivery @CD Summit Stockholm
 
Ie9 и ie10. алекс могилевский. зал 2
Ie9 и ie10. алекс могилевский. зал 2Ie9 и ie10. алекс могилевский. зал 2
Ie9 и ie10. алекс могилевский. зал 2
 
Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
 
Continuous delivery from the trenches Redhat Forum Edition
Continuous delivery from the trenches Redhat Forum EditionContinuous delivery from the trenches Redhat Forum Edition
Continuous delivery from the trenches Redhat Forum Edition
 
Auditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub RepositoriesAuditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub Repositories
 

Similar to Bootify your Test Pyramid

Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdf
Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdfFront-End Test Fest Keynote: The State of the Union for Front End Testing.pdf
Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdfApplitools
 
Drone Continuous Integration
Drone Continuous IntegrationDrone Continuous Integration
Drone Continuous IntegrationDaniel Cerecedo
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glanceRajesh Kumar
 
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...Brad Stoner
 
Clean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & WatirClean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & WatirDanny Smith
 
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Applitools
 
Smoke Tests @ DevOps-Hamburg 06.02.2017
Smoke Tests @ DevOps-Hamburg 06.02.2017Smoke Tests @ DevOps-Hamburg 06.02.2017
Smoke Tests @ DevOps-Hamburg 06.02.2017tech.kartenmacherei
 
Test Automation On Android Platform Using Robotium
Test Automation On Android Platform Using RobotiumTest Automation On Android Platform Using Robotium
Test Automation On Android Platform Using RobotiumIndicThreads
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 QA Systems
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"GoIT
 
Selenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzSelenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzTraining Institute
 
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...Amazon Web Services
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScriptSimon Guest
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...KMS Technology
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Automated Integration Testing in Java using Arquillian
Automated Integration Testing in Java using ArquillianAutomated Integration Testing in Java using Arquillian
Automated Integration Testing in Java using ArquillianTommy Tynjä
 
Growing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI FrameworksGrowing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI FrameworksSmartBear
 
Advanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWSAdvanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWSAmazon Web Services
 

Similar to Bootify your Test Pyramid (20)

Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdf
Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdfFront-End Test Fest Keynote: The State of the Union for Front End Testing.pdf
Front-End Test Fest Keynote: The State of the Union for Front End Testing.pdf
 
Drone Continuous Integration
Drone Continuous IntegrationDrone Continuous Integration
Drone Continuous Integration
 
Cucumber outline
Cucumber outlineCucumber outline
Cucumber outline
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glance
 
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
 
Clean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & WatirClean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & Watir
 
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
 
Smoke Tests @ DevOps-Hamburg 06.02.2017
Smoke Tests @ DevOps-Hamburg 06.02.2017Smoke Tests @ DevOps-Hamburg 06.02.2017
Smoke Tests @ DevOps-Hamburg 06.02.2017
 
Test Automation On Android Platform Using Robotium
Test Automation On Android Platform Using RobotiumTest Automation On Android Platform Using Robotium
Test Automation On Android Platform Using Robotium
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"
 
Selenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemzSelenium training-course-content-syllabus-credo systemz
Selenium training-course-content-syllabus-credo systemz
 
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Automated Integration Testing in Java using Arquillian
Automated Integration Testing in Java using ArquillianAutomated Integration Testing in Java using Arquillian
Automated Integration Testing in Java using Arquillian
 
Growing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI FrameworksGrowing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI Frameworks
 
Advanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWSAdvanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWS
 

Recently uploaded

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Bootify your Test Pyramid

  • 1. Bootify your Test Pyramid Benedikt Ritter 1
  • 2. WHO IS THIS GUY? Software Crafter Java & Scala Guy Open Source Enthusiast IT Consultant Podcaster: http://autoweird.fm Social Media: 2 @BenediktRitter github.com/britter
  • 3. AGENDA 3 Test Types in Web Apps My View of State of the Art Testing Test Pyramid Short Recap of Test Pyramid Demo Let’s look at some Code! Conclusion What have we learned today? Discussion / Q&A Anything else you want to know? Bootify Your Test Pyramid
  • 4. 4 The test pyramid is a concept developed by Mike Cohn, described in his book Succeeding with Agile. Its essential point is that you should have many more low-level unit tests than high level end-to- end tests running through a GUI. Source: https://martinfowler.com/bliki/TestPyramid.html Short recap of the Test Pyramid INTRODUCTION
  • 5. Test Kinds 5 System Test Unit Test Integration Test Smoke Test Penetration Test Performance Test Acceptance Test Feature TestUI Test Component Test Module Test
  • 6. Test Pyramid 6 System Test Unit Test Integration Test
  • 7. Test Pyramid 6 System Test Unit Test Integration Test €€€ €
  • 8. 7 TEST TYPES IN WEB APPS My View of State of the Art Testing This model of different test types and was inspired by the „Crafting Code“ Workshop by Sandro Mancuso. Sandro has a very pure and reduced approach for creating application which doesn’t require a lot of frameworks. I adopted his technique of testing different parts of application to leverage Spring Boot testing support. A video of Sandro doing Outside-In TDD can be found here: https://www.youtube.com/watch?v=XHnuMjah6ps
  • 9. Test Types in Context of Web Applications 8
  • 10. Test Types in Context of Web Applications 8 Domain
  • 11. Test Types in Context of Web Applications 8 Domain B B B B
  • 12. Test Types in Context of Web Applications 8 R R Domain B B B B
  • 13. Test Types in Context of Web Applications 8 C C C R R Domain B B B B
  • 14. Test Types in Context of Web Applications 8 C C C R R I I Domain B B B B
  • 15. Test Types in Context of Web Applications 9 C C C R R I I Domain B B B B
  • 16. Test Types in Context of Web Applications 9 C C C R R I I Domain B B B B
  • 17. Test Types in Context of Web Applications 9 C C C R R I I Data StorageDomain B B B B
  • 18. Test Types in Context of Web Applications 9 C C C R R I I Data StorageDomain B B B B
  • 19. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B
  • 20. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B UNIT TEST
  • 21. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B
  • 22. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B INTEGRATIONS TEST
  • 23. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B INTEGRATIONS TEST M
  • 24. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B INTEGRATIONS TEST M M
  • 25. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B INTEGRATIONS TEST M M
  • 26. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B
  • 27. Test Types in Context of Web Applications 10 C C C R R I I Data StorageDomain B B B B SYSTEM TEST
  • 28. Bootified Test Pyramid 11 System Test Unit Test Integration Test
  • 29. Bootified Test Pyramid 11 System Test Unit Test Integration Test
  • 30. Bootified Test Pyramid 11 System Test Unit Test Integration Test JUnit 5, assertJ Builders & Templates
  • 31. Bootified Test Pyramid 11 System Test Unit Test Integration Test JUnit 5, assertJ Builders & Templates @DataJpaTest & TestEntityManager @WebMvcTest & MockMvc
  • 32. Bootified Test Pyramid 11 System Test Unit Test Integration Test JUnit 5, assertJ Builders & Templates @DataJpaTest & TestEntityManager @WebMvcTest & MockMvc @SpringBootTest
  • 33. 12 DEMO Let’s work with Orders Web application managing orders. It provides an HTTP interface for creating and retrieving orders. When creating an order, a delivery price is calculated based on the total weight of that order. The delivery price is persisted along side the order data inside a RDMS for reporting. Code: https://github.com/britter/bootify-testpyramid
  • 34. 13 CONCLUSION What have we learned today? There are different types of tests for each layer of an application. A well defined domain model together with templates can help tremendously setting up tests on each layer. Spring Boot provides the necessary infrastructure to easily write Integration and System Tests.
  • 35. Working with security, e.g. @MockUser 1 Integration tests against middlewares like message queues System tests using Test Containers Custom assertJ assertions Other test types, for example acceptance tests using Cucumber 2 3 4 5 NOT COVERED TODAY 14 There is more!
  • 36. 15
  • 37. Our mission – to promote agile development, innovation and technology – extends through everything we do. codecentric AG Hochstraße 11 42697 Solingen E-Mail: info@codecentric.de www.codecentric.de Telefon: +49 (0) 212. 23 36 28 0
 Telefax: +49 (0) 212.23 36 28 79
 Address Contact Info Telephone Stay connected 16