SlideShare une entreprise Scribd logo
1  sur  63
• Unit Of Work
           • Setup Methods
         • Constrained vs.
   Unconstrained Isolation
                Frameworks
      • Principles of Good
      Isolation Frameworks
• Faking Deep Legacy is OK
    • Six Influence Forces
        • Beautiful Builds
Bottleneck Ninja   Test Review Lion   Build Bear
Test


                      Public
                       API



                   Production
                     Code

                  Unit Of Work




    Return        Noticeable State
                                     3rd Party call
Value/Exception       Change
Assert            Test


                     Public
                      API



                  Production
                    Code

                  Unit Of Work




    Return
Value/Exception
Test


    Public




                   Assert
     API



 Production
   Code

Unit Of Work




Noticeable State
    Change
Test


   Public
    API



Production
  Code                            3rd Party

Unit Of Work                    Unit Of Work




               3rd Party call
Test


   Public
    API



Production
  Code
                                  3rd Party
Unit Of Work
                                Unit Of Work




               3rd Party call
Old code
Old code   New    Fake
           code
Extract Scrip
Build Chain Triggers

          Build Chaining
             Triggered by checkin


             Triggered by end of previo


             Manual

             Manual
Slow Builds



              Do X


              Do X + Y


              Do X + Y + Z

              Do X + y + Z + N
Cumulative, Fast Builds


        Do X


        Do Y


        Do Z

        Do N
How Fast?
 Extract Script
 Shipping Skeleton
 Fill in the blanks
 Cumulative Builds
 Build Waves
 Location Agnostic

BeautifulBuilds.com
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove
A Second Look at Unit Testing by Roy Osherove

Contenu connexe

Tendances

Никита Манько “Code review”
Никита Манько “Code review”Никита Манько “Code review”
Никита Манько “Code review”
EPAM Systems
 
Continuous Integration for iOS Developer
Continuous Integration for iOS DeveloperContinuous Integration for iOS Developer
Continuous Integration for iOS Developer
Sven Günther
 

Tendances (20)

Testing Alfresco extensions
Testing Alfresco extensionsTesting Alfresco extensions
Testing Alfresco extensions
 
Wax on, wax off
Wax on, wax offWax on, wax off
Wax on, wax off
 
TDD For Mortals
TDD For MortalsTDD For Mortals
TDD For Mortals
 
Angular Unit Test
Angular Unit TestAngular Unit Test
Angular Unit Test
 
轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!
 
Unit Testing for Frontend Code at Blibli.com
Unit Testing for Frontend Code at Blibli.comUnit Testing for Frontend Code at Blibli.com
Unit Testing for Frontend Code at Blibli.com
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
Никита Манько “Code review”
Никита Манько “Code review”Никита Манько “Code review”
Никита Манько “Code review”
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
DevOps - Its just Agile done right
DevOps - Its just Agile done rightDevOps - Its just Agile done right
DevOps - Its just Agile done right
 
Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...
Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...
Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
Is your API misbehaving?(Keith-Casey)
Is your API misbehaving?(Keith-Casey)Is your API misbehaving?(Keith-Casey)
Is your API misbehaving?(Keith-Casey)
 
Continuous Integration for iOS Developer
Continuous Integration for iOS DeveloperContinuous Integration for iOS Developer
Continuous Integration for iOS Developer
 
Blazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof ApplicationsBlazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof Applications
 
Integration Testing with Docker Containers with DockerCompose
Integration Testing with Docker Containers  with DockerComposeIntegration Testing with Docker Containers  with DockerCompose
Integration Testing with Docker Containers with DockerCompose
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium Framework
 
Delivery With Chef - ChefConf 2015
Delivery With Chef - ChefConf 2015 Delivery With Chef - ChefConf 2015
Delivery With Chef - ChefConf 2015
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 

En vedette

Organizational influence-hacks-45min
Organizational influence-hacks-45minOrganizational influence-hacks-45min
Organizational influence-hacks-45min
Roy Osherove
 
Unit Testing Guidelines
Unit Testing GuidelinesUnit Testing Guidelines
Unit Testing Guidelines
Joel Hooks
 
xUnit Test Patterns Chapter 20
xUnit Test Patterns Chapter 20xUnit Test Patterns Chapter 20
xUnit Test Patterns Chapter 20
Hiroyuki Ohnaka
 
Garbage collected teardown
Garbage collected teardownGarbage collected teardown
Garbage collected teardown
Hiroyuki Ohnaka
 
Roy Osherove TDD From Scratch
Roy Osherove TDD From ScratchRoy Osherove TDD From Scratch
Roy Osherove TDD From Scratch
Roy Osherove
 

En vedette (20)

Organizational influence-hacks-45min
Organizational influence-hacks-45minOrganizational influence-hacks-45min
Organizational influence-hacks-45min
 
Unit Testing Guidelines
Unit Testing GuidelinesUnit Testing Guidelines
Unit Testing Guidelines
 
Introduction to Angular for .NET Developers
Introduction to Angular for .NET DevelopersIntroduction to Angular for .NET Developers
Introduction to Angular for .NET Developers
 
Future of UI Automation testing and JDI
Future of UI Automation testing and JDIFuture of UI Automation testing and JDI
Future of UI Automation testing and JDI
 
xUnit Test Patterns Chapter 20
xUnit Test Patterns Chapter 20xUnit Test Patterns Chapter 20
xUnit Test Patterns Chapter 20
 
Little productivity tools every developer should use
Little productivity tools every developer should useLittle productivity tools every developer should use
Little productivity tools every developer should use
 
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
 
Garbage collected teardown
Garbage collected teardownGarbage collected teardown
Garbage collected teardown
 
Negative Testing
Negative TestingNegative Testing
Negative Testing
 
Roy Osherove TDD From Scratch
Roy Osherove TDD From ScratchRoy Osherove TDD From Scratch
Roy Osherove TDD From Scratch
 
Neurodiversity: The Next Frontier (Agile People Sweden)
Neurodiversity: The Next Frontier (Agile People Sweden)Neurodiversity: The Next Frontier (Agile People Sweden)
Neurodiversity: The Next Frontier (Agile People Sweden)
 
Unit Testing, TDD and ATDD
Unit Testing, TDD and ATDDUnit Testing, TDD and ATDD
Unit Testing, TDD and ATDD
 
Property based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rulesProperty based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rules
 
Creating Space to Be Awesome -- Offentlig Chef
Creating Space to Be Awesome -- Offentlig ChefCreating Space to Be Awesome -- Offentlig Chef
Creating Space to Be Awesome -- Offentlig Chef
 
Practical Diversity at Thinking Digital Women
Practical Diversity at Thinking Digital Women Practical Diversity at Thinking Digital Women
Practical Diversity at Thinking Digital Women
 
Awesome People Management with Agile at Agile North East
Awesome People Management with Agile at Agile North EastAwesome People Management with Agile at Agile North East
Awesome People Management with Agile at Agile North East
 
NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features Presentation
 
Brilliant People Management in an Agile Setting
Brilliant People Management in an Agile SettingBrilliant People Management in an Agile Setting
Brilliant People Management in an Agile Setting
 
Team leadership in the age of Agile - Roy Osherove
Team leadership in the age of Agile  - Roy OsheroveTeam leadership in the age of Agile  - Roy Osherove
Team leadership in the age of Agile - Roy Osherove
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 

Similaire à A Second Look at Unit Testing by Roy Osherove

Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
Pantheon
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBay
Dominik Dary
 
01 traditional analytics
01 traditional analytics01 traditional analytics
01 traditional analytics
MeasureWorks
 
Testing untestable code - phpconpl11
Testing untestable code - phpconpl11Testing untestable code - phpconpl11
Testing untestable code - phpconpl11
Stephan Hochdörfer
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile Projects
Michael Palotas
 
API Readiness: Visualizing and Virtualizing
API Readiness: Visualizing and VirtualizingAPI Readiness: Visualizing and Virtualizing
API Readiness: Visualizing and Virtualizing
Lorinda Brandon
 

Similaire à A Second Look at Unit Testing by Roy Osherove (20)

Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFTechniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
 
Don't Be Mocked by your Mocks - Best Practices using Mocks
Don't Be Mocked by your Mocks - Best Practices using MocksDon't Be Mocked by your Mocks - Best Practices using Mocks
Don't Be Mocked by your Mocks - Best Practices using Mocks
 
Process Matters (Cloud2Days / Java2Days conference))
Process Matters (Cloud2Days / Java2Days conference))Process Matters (Cloud2Days / Java2Days conference))
Process Matters (Cloud2Days / Java2Days conference))
 
How to Profit from Static Analysis
How to Profit from Static AnalysisHow to Profit from Static Analysis
How to Profit from Static Analysis
 
Test Automation and Innovation with Open Source Tools
Test Automation and Innovation with Open Source ToolsTest Automation and Innovation with Open Source Tools
Test Automation and Innovation with Open Source Tools
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
 
How to Introduce Continuous Delivery
How to Introduce Continuous DeliveryHow to Introduce Continuous Delivery
How to Introduce Continuous Delivery
 
Continuous delivery in Qbon
Continuous delivery  in QbonContinuous delivery  in Qbon
Continuous delivery in Qbon
 
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT OpsAgile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBay
 
Neil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandNeil Tompson - SoftTest Ireland
Neil Tompson - SoftTest Ireland
 
01 traditional analytics
01 traditional analytics01 traditional analytics
01 traditional analytics
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile App
 
Testing untestable code - phpconpl11
Testing untestable code - phpconpl11Testing untestable code - phpconpl11
Testing untestable code - phpconpl11
 
Clearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad DecisionsClearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad Decisions
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile Projects
 
Software reengineering for Developers
Software reengineering for DevelopersSoftware reengineering for Developers
Software reengineering for Developers
 
API Readiness: Visualizing and Virtualizing
API Readiness: Visualizing and VirtualizingAPI Readiness: Visualizing and Virtualizing
API Readiness: Visualizing and Virtualizing
 
Quality on Submit
Quality on SubmitQuality on Submit
Quality on Submit
 

Dernier

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
Victor Rentea
 
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
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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, ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

A Second Look at Unit Testing by Roy Osherove

  • 1.
  • 2. • Unit Of Work • Setup Methods • Constrained vs. Unconstrained Isolation Frameworks • Principles of Good Isolation Frameworks • Faking Deep Legacy is OK • Six Influence Forces • Beautiful Builds
  • 3.
  • 4. Bottleneck Ninja Test Review Lion Build Bear
  • 5. Test Public API Production Code Unit Of Work Return Noticeable State 3rd Party call Value/Exception Change
  • 6. Assert Test Public API Production Code Unit Of Work Return Value/Exception
  • 7. Test Public Assert API Production Code Unit Of Work Noticeable State Change
  • 8. Test Public API Production Code 3rd Party Unit Of Work Unit Of Work 3rd Party call
  • 9. Test Public API Production Code 3rd Party Unit Of Work Unit Of Work 3rd Party call
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 25. Old code New Fake code
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 37. Build Chain Triggers Build Chaining Triggered by checkin Triggered by end of previo Manual Manual
  • 38. Slow Builds Do X Do X + Y Do X + Y + Z Do X + y + Z + N
  • 39. Cumulative, Fast Builds Do X Do Y Do Z Do N
  • 41.  Extract Script  Shipping Skeleton  Fill in the blanks  Cumulative Builds  Build Waves  Location Agnostic BeautifulBuilds.com