SlideShare a Scribd company logo
1 of 35
Or at least make them as useful as possible
- Pushes out timeline
- Boring
- When do you stop ?
- I hate it
- We have a QA department
- Broken window theory
- I hate it.
- We have GUI Tests we don’t need unit tests
- Perfectionism
GUI Tests
Integration Tests
Unit Tests
You commit code without tests. You are a cowboy.
Cowboy no test
- Promotes loose coupling between classes
and sub systems
- Adds flexibility to code changes for future
changes
- Can enable better code reuse
- Easier to unit test
Mocks act like a ping-pong paddle by
intercepting the function call and
immediately returning execution to the
calling function.
- Dependencies
- Speed
- Hard cases
- Incompleteness
Plan
ModifyImplement
Assess
hypothesize what
needs to change
predict the
outcome
you make the
changes and
observe the results
Read the Code
http://www.ncrunch.net/
30 Day trial available at
Learning to Enjoy Unit Testing
Learning to Enjoy Unit Testing

More Related Content

What's hot

Java JIT Improvements Research
Java JIT Improvements ResearchJava JIT Improvements Research
Java JIT Improvements ResearchAdam Feldscher
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Tzach Zohar
 
Continuous delivery in practice (public)
Continuous delivery in practice (public)Continuous delivery in practice (public)
Continuous delivery in practice (public)Tzach Zohar
 
Test Driven Development in Python
Test Driven Development in PythonTest Driven Development in Python
Test Driven Development in PythonAnoop Thomas Mathew
 
TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!Kjetil Klaussen
 
Ratpack the story so far
Ratpack the story so farRatpack the story so far
Ratpack the story so farPhill Barber
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testingDuy Tan Geek
 
Testing JavaScript
Testing JavaScriptTesting JavaScript
Testing JavaScriptdhtml
 
Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...Tze Chin Tang
 
TDD python ne-april-2014
TDD python ne-april-2014TDD python ne-april-2014
TDD python ne-april-2014Alex Kavanagh
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
Performance testing for web-scale
Performance testing for web-scalePerformance testing for web-scale
Performance testing for web-scaleIzzet Mustafaiev
 
Civilized Git Process
Civilized Git ProcessCivilized Git Process
Civilized Git ProcessTu Hoang
 
Software testing enhance quality and performance of software
Software testing enhance quality and performance of softwareSoftware testing enhance quality and performance of software
Software testing enhance quality and performance of softwareEmipro Technologies Pvt. Ltd.
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
Елена Панина - Drupal performance testing. Тестирование производительности, м...
Елена Панина - Drupal performance testing. Тестирование производительности, м...Елена Панина - Drupal performance testing. Тестирование производительности, м...
Елена Панина - Drupal performance testing. Тестирование производительности, м...LEDC 2016
 
Test Driven Development
Test Driven Development Test Driven Development
Test Driven Development Poonam Panday
 

What's hot (20)

Java JIT Improvements Research
Java JIT Improvements ResearchJava JIT Improvements Research
Java JIT Improvements Research
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)
 
Continuous delivery in practice (public)
Continuous delivery in practice (public)Continuous delivery in practice (public)
Continuous delivery in practice (public)
 
TDD
TDDTDD
TDD
 
Case study-regression-testinga
Case study-regression-testingaCase study-regression-testinga
Case study-regression-testinga
 
Test Driven Development in Python
Test Driven Development in PythonTest Driven Development in Python
Test Driven Development in Python
 
TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!
 
Ratpack the story so far
Ratpack the story so farRatpack the story so far
Ratpack the story so far
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testing
 
Testing JavaScript
Testing JavaScriptTesting JavaScript
Testing JavaScript
 
Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...
 
TDD python ne-april-2014
TDD python ne-april-2014TDD python ne-april-2014
TDD python ne-april-2014
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Performance testing for web-scale
Performance testing for web-scalePerformance testing for web-scale
Performance testing for web-scale
 
Civilized Git Process
Civilized Git ProcessCivilized Git Process
Civilized Git Process
 
TDD a piccoli passi
TDD a piccoli passiTDD a piccoli passi
TDD a piccoli passi
 
Software testing enhance quality and performance of software
Software testing enhance quality and performance of softwareSoftware testing enhance quality and performance of software
Software testing enhance quality and performance of software
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
Елена Панина - Drupal performance testing. Тестирование производительности, м...
Елена Панина - Drupal performance testing. Тестирование производительности, м...Елена Панина - Drupal performance testing. Тестирование производительности, м...
Елена Панина - Drupal performance testing. Тестирование производительности, м...
 
Test Driven Development
Test Driven Development Test Driven Development
Test Driven Development
 

Viewers also liked

Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - Genova
Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - GenovaQualità Percepita: Biblioteche Civiche - fase 2 - 2006 - Genova
Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - GenovaNicola Camurri
 
Córdoba - Palacio Ferreyra (exterior)
Córdoba - Palacio Ferreyra (exterior)Córdoba - Palacio Ferreyra (exterior)
Córdoba - Palacio Ferreyra (exterior)Susana Provenza
 
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...moratonoise
 
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...GODIVA4000MESSERI
 
Лекция 8. Алгоритмы (продолжение)
Лекция 8. Алгоритмы (продолжение)Лекция 8. Алгоритмы (продолжение)
Лекция 8. Алгоритмы (продолжение)Vladimir Tcherniak
 
Fibrilação atrial - aspectos práticos e atualizações.
Fibrilação atrial - aspectos práticos e atualizações. Fibrilação atrial - aspectos práticos e atualizações.
Fibrilação atrial - aspectos práticos e atualizações. Carlos Volponi Lovatto
 
写真で見る昭和30~40年代の青森市民の暮らし
写真で見る昭和30~40年代の青森市民の暮らし写真で見る昭和30~40年代の青森市民の暮らし
写真で見る昭和30~40年代の青森市民の暮らし青森県立郷土館
 
Actividad. Seres Vivos.
Actividad. Seres Vivos.Actividad. Seres Vivos.
Actividad. Seres Vivos.danielareyessm
 
01 pauta evaluación blog. marzo 2012
01   pauta evaluación blog.   marzo  201201   pauta evaluación blog.   marzo  2012
01 pauta evaluación blog. marzo 2012profesoraudp
 
Swot social media analysis
Swot social media analysisSwot social media analysis
Swot social media analysisJanine Frade
 

Viewers also liked (17)

Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - Genova
Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - GenovaQualità Percepita: Biblioteche Civiche - fase 2 - 2006 - Genova
Qualità Percepita: Biblioteche Civiche - fase 2 - 2006 - Genova
 
Córdoba - Palacio Ferreyra (exterior)
Córdoba - Palacio Ferreyra (exterior)Córdoba - Palacio Ferreyra (exterior)
Córdoba - Palacio Ferreyra (exterior)
 
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...
Consideracoes filosoficas sobre_o_fantasma_divino_sobre_o_mundo_real_e_sobre_...
 
Manish Mishra CV
Manish Mishra CVManish Mishra CV
Manish Mishra CV
 
Dm2016
Dm2016Dm2016
Dm2016
 
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...
2000 revalasibandungardillaworld1999 www.outlook2400bmimcv2e240015001995limit...
 
Лекция 8. Алгоритмы (продолжение)
Лекция 8. Алгоритмы (продолжение)Лекция 8. Алгоритмы (продолжение)
Лекция 8. Алгоритмы (продолжение)
 
Ejc
EjcEjc
Ejc
 
Fibrilação atrial - aspectos práticos e atualizações.
Fibrilação atrial - aspectos práticos e atualizações. Fibrilação atrial - aspectos práticos e atualizações.
Fibrilação atrial - aspectos práticos e atualizações.
 
写真で見る昭和30~40年代の青森市民の暮らし
写真で見る昭和30~40年代の青森市民の暮らし写真で見る昭和30~40年代の青森市民の暮らし
写真で見る昭和30~40年代の青森市民の暮らし
 
Presentacion bogota 23 febrero 2016
Presentacion bogota 23 febrero  2016Presentacion bogota 23 febrero  2016
Presentacion bogota 23 febrero 2016
 
PI presentaciónlarga
PI presentaciónlargaPI presentaciónlarga
PI presentaciónlarga
 
Presentacion eng 5
Presentacion eng 5Presentacion eng 5
Presentacion eng 5
 
Actividad. Seres Vivos.
Actividad. Seres Vivos.Actividad. Seres Vivos.
Actividad. Seres Vivos.
 
01 pauta evaluación blog. marzo 2012
01   pauta evaluación blog.   marzo  201201   pauta evaluación blog.   marzo  2012
01 pauta evaluación blog. marzo 2012
 
Swot social media analysis
Swot social media analysisSwot social media analysis
Swot social media analysis
 
Normas iec publicadas
Normas iec publicadasNormas iec publicadas
Normas iec publicadas
 

Similar to Learning to Enjoy Unit Testing

Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019Grzegorz Miejski
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Applitools
 
Release Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROIRelease Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROITechWell
 
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...Roberto Pérez Alcolea
 
Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Solano Labs
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroPaul Boos
 
Introduction of unit test to management
Introduction of unit test to managementIntroduction of unit test to management
Introduction of unit test to managementweili_at_slideshare
 
Open Source tools in Continuous Integration environment (case study for agil...
Open Source tools in Continuous Integration environment  (case study for agil...Open Source tools in Continuous Integration environment  (case study for agil...
Open Source tools in Continuous Integration environment (case study for agil...suwalki24.pl
 
Continuous Integration testing based on Selenium and Hudson
Continuous Integration testing based on Selenium and HudsonContinuous Integration testing based on Selenium and Hudson
Continuous Integration testing based on Selenium and HudsonZbyszek Mockun
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...Bruno Tanoue
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testingPavlo Hodysh
 
Solano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testingSolano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testingMassTLC
 
Effektives Consulting - Performance Engineering
Effektives Consulting - Performance EngineeringEffektives Consulting - Performance Engineering
Effektives Consulting - Performance Engineeringhitdhits
 
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Alex Fernandez
 

Similar to Learning to Enjoy Unit Testing (20)

Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 
NYC MeetUp 10.9
NYC MeetUp 10.9NYC MeetUp 10.9
NYC MeetUp 10.9
 
Release Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROIRelease Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROI
 
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...
[DPE Summit] How Improving the Testing Experience Goes Beyond Quality: A Deve...
 
Wso2con test-automation
Wso2con test-automationWso2con test-automation
Wso2con test-automation
 
Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Automated testing san francisco oct 2013
Automated testing san francisco oct 2013
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
 
Introduction of unit test to management
Introduction of unit test to managementIntroduction of unit test to management
Introduction of unit test to management
 
Open Source tools in Continuous Integration environment (case study for agil...
Open Source tools in Continuous Integration environment  (case study for agil...Open Source tools in Continuous Integration environment  (case study for agil...
Open Source tools in Continuous Integration environment (case study for agil...
 
Continuous Integration testing based on Selenium and Hudson
Continuous Integration testing based on Selenium and HudsonContinuous Integration testing based on Selenium and Hudson
Continuous Integration testing based on Selenium and Hudson
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testing
 
Presentation delex
Presentation delexPresentation delex
Presentation delex
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Solano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testingSolano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testing
 
Effektives Consulting - Performance Engineering
Effektives Consulting - Performance EngineeringEffektives Consulting - Performance Engineering
Effektives Consulting - Performance Engineering
 
TDD Workshop UTN 2012
TDD Workshop UTN 2012TDD Workshop UTN 2012
TDD Workshop UTN 2012
 
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1
 

Recently uploaded

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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].pdfOverkill Security
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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...Martijn de Jong
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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, ...apidays
 
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 WoodJuan lago vázquez
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 FMESafe Software
 
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 Processorsdebabhi2
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 

Learning to Enjoy Unit Testing

Editor's Notes

  1. Broken window theory Consider a building with a few broken windows. If the windows are not repaired, the tendency is for vandals to break a few more windows. Eventually, they may even break into the building, and if it's unoccupied, perhaps become squatters or light fires inside. Introduced by James Q. Wilson and George L. Kelling
  2. Cost of finding a bug.
  3. Being clear …… Unit tests doesn’t take the place of other testing it just provides a more secure foundation
  4. I hate working in the theoretical so lets pull a example out and work with it Open up Thing.zip The method Find should never return null For some reason it is returning null find out why and fix it And of course it needs to work just as before Now before you get your hands on the code lets talk about some things we might do(Pulls open visual studio or just have them open the code no typing though) What if we had unit Tests in this situation ? (Thing2.zip) Simple Example but I still wouldn’t want to touch it (What if I break it)
  5. Things to note: Attribute above name of method Name of method Arrange – Setup everything Act – Invoke the code to test Assert – see if the code passes the criteria Asserts can be tested serveral ways: - Values returned by a method - Values exposed through fields - Values exposed through other methods or properties - Values that come from outside the object, static state or a shared data structure
  6. Ok that was a easy test ? But No return / Assert Dependency Injection
  7. - have a robot to build a house - Teach it to build a wall Once the wall is complete who builds the door ? - The Robot knows how to build a wall and can grab a manufactured door and these doors can be changed out for different doors
  8. Same Concept but with code There is other types of injection as well but we aren’t going to talk about those right now The differences is how Iadministrator is passed and used by the class
  9. Dependency Injection in some ways allows us to solve for X with Mock Objects
  10. There are events that can be fired if a method is called you can make a mock return a particular value -
  11. Dependencies - Everything depends on everything else Speed – faster the unit tests faster the more enjoyable this is going to be Hard Cases – these are cases that are hard to reproduce say you want to make sure to handle OutofMemoryException Incompleteness – say you are working on a project with a team and you want to test just your part … this is a great way to do this
  12. Creating the Mock Object Mocking the method and saying it must be called Mock.Assert on Administrator Arrange – Setup everything needed for the running the tested code. This includes any initialization of dependencies, mocks and data needed for the test to run. Act – Invoke the code under test Assert – Specify the pass criteria for the test, which fails it if not met
  13. Now we
  14. What is a Test runner ? (Go Show THEM!) JustTest (we own it) MSTest (Free) TestDriven.net(250 per seat) Nunit (free) - Cost might matter - Nunit has more questions/answers on stackoverflow (Community) - They all do the same thing … run Tests personal preference
  15. (What is a mocking framework ?) JustMock in my opinion wins hands down - More documentation - has a profilier (Mock Static Classes) - We own it - We can get support for it
  16. Step 2 Demo
  17. So …. How many of you have ever been to a lecture trying to sell you on 401K ? (raise your hand) It has been said that selling TDD is a lot like selling someone 401K convincing you that sacrificing now is going to be worth it later and asking you to take this, to some degree, on faith. So there needs to be a benefit to convince people that there is in fact a better way Learning how to use unit tests is going to take time … there is no way around it
  18. This is a lot like the Tortoise in the hare The Hare gets done quickly with mistakes (spends a lot more time troubleshooting) The tortoise is slow because he is writing unit tests but when he is done …. It works and he knows why it works
  19. But what if we could speed up the hare ? How would could we do that ? What if I told you I could write / change code and know instantly if it worked or failed ? You don’t have to run the program …. Wait for it to spin up and click through screen after screen to get to what you want to test All you have to do is type and you will be able to see if what you wrote worked or not
  20. In Computer Science there is something that is often overlooked called a Feedback loop At its core you do this when programming - new feature - identify new behaviors - make changes - run the application and test it This is something called continuous testing
  21. Scientific method The question is how long does your feedback look take when developing and doing unit tests ? In the older days of computers punch cards would take along time When a feedback loop takes a lot of time you begin to wonder (lets go surf google anyone ?) When we shorten the feedback loop people feel more productive Which would you drather work on a application with slow feedback (Fadmin … cough) or one with a faster feedback (a new app - So how can we make unit testing faster ? continuous testing
  22. As soon after you write a line you will know if it failed or not
  23. Ever tried to do code coverage and forget what you have tested and what you haven’t with unit tests ? (Not fool proof but better than guessing) (Right click on the dot and it will tell you every tests that tests this line)
  24. Is your unit test slow the yellow green will tell you Hover over the dot and it will tell you how slow
  25. Ever spend time trying to figure out why a unit test is failing and on what line ?
  26. Run the Tests in the test runner …. Takes forever …. Where was I ? Now you don’t run test runner … all your tests run in the background Rarely build the application
  27. Chess Game TDD Ncrunch - https://www.youtube.com/watch?v=1GngsnfKC3o