SlideShare a Scribd company logo
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
• 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
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
Production
Code
Unit Of Work
Return
Value/Exception
Noticeable State
Change
3rd Party call
Public
API
Test
Production
Code
Unit Of Work
Return
Value/Exception
Public
API
Assert Test
A second look at Unit Testing with Roy Osherove at Microsoft Swit
Production
Code
Unit Of Work
Noticeable State
Change
Test
Public
API
Assert
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
Production
Code
Unit Of Work
3rd Party call
Test
Public
API
3rd Party
Unit Of Work
Production
Code
Unit Of Work
3rd Party call
Test
Public
API
3rd Party
Unit Of Work
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
 Recursive is not explicit:
 Person.Manager.Manager is
already a fake instance without
asking for it
 Chained Expectations are
explicit
 Mock.Arrange(() =>
Person.Manager.Manager)
.Returns(fakeManager)
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
Old code
Old code FakeNew
code
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
A second look at Unit Testing with Roy Osherove at Microsoft Swit
Extract Scrip
Build Chain Triggers
Triggered by checkin
Triggered by end of previo
Manual
Manual
Build Chaining
• 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
A second look at Unit Testing with Roy Osherove at Microsoft Swit

More Related Content

PPTX
A Second Look at Unit Testing by Roy Osherove
PPTX
Beautiful Builds by Roy Osherove
PPTX
Jasmine
PPTX
Beautiful Builds - Roy Osherove at Microsoft Swit
PPTX
TDD For Mortals
PPTX
Angular Unit Test
PDF
Testing Alfresco extensions
PDF
Trunk-Based Development and Toggling
A Second Look at Unit Testing by Roy Osherove
Beautiful Builds by Roy Osherove
Jasmine
Beautiful Builds - Roy Osherove at Microsoft Swit
TDD For Mortals
Angular Unit Test
Testing Alfresco extensions
Trunk-Based Development and Toggling

What's hot (20)

PDF
Build pipelines with TeamCity
PDF
Build pipelines with TeamCity
PDF
Build pipelines with TeamCity
PDF
Property-Based Testing for Services
PPTX
Никита Манько “Code review”
PPTX
API Test Automation Using Karate (Anil Kumar Moka)
PPTX
Refactoring Design Patterns the Functional Way (in Scala)
PDF
8 bit full adder
PPTX
BDD for APIs
PDF
Striking a Balance With UI Tests - ConnectTech
PDF
Eclipse IDE Tips and Tricks - Lakshmi Priya Shanmugam
PDF
Is your API misbehaving?(Keith-Casey)
PDF
Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...
PDF
Unit Testing for Frontend Code at Blibli.com
PPTX
Automated Integration Testing in Java using Arquillian
PPTX
轉轉轉好運旺來一起來之雲端轉檔大作戰!
PDF
Continuous Integration for iOS Developer
PDF
No Graph Theory Required: Ember and GraphQL in Practice
PDF
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
PPTX
Blazor Stability Testing Tools for Bullet Proof Applications
Build pipelines with TeamCity
Build pipelines with TeamCity
Build pipelines with TeamCity
Property-Based Testing for Services
Никита Манько “Code review”
API Test Automation Using Karate (Anil Kumar Moka)
Refactoring Design Patterns the Functional Way (in Scala)
8 bit full adder
BDD for APIs
Striking a Balance With UI Tests - ConnectTech
Eclipse IDE Tips and Tricks - Lakshmi Priya Shanmugam
Is your API misbehaving?(Keith-Casey)
Continuous Delivery with Jenkins: the Good, the Bad and the Ugly - JAX DevOps...
Unit Testing for Frontend Code at Blibli.com
Automated Integration Testing in Java using Arquillian
轉轉轉好運旺來一起來之雲端轉檔大作戰!
Continuous Integration for iOS Developer
No Graph Theory Required: Ember and GraphQL in Practice
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
Blazor Stability Testing Tools for Bullet Proof Applications
Ad

Viewers also liked (6)

PPTX
Organizational influence-hacks-45min
PPTX
Vim - for newbies, by Roy Osherove
PPTX
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
PPTX
Roy Osherove TDD From Scratch
PPTX
Team leadership in the age of Agile - Roy Osherove
PDF
Test Driven Development (TDD)
Organizational influence-hacks-45min
Vim - for newbies, by Roy Osherove
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove TDD From Scratch
Team leadership in the age of Agile - Roy Osherove
Test Driven Development (TDD)
Ad

Similar to A second look at Unit Testing with Roy Osherove at Microsoft Swit (20)

PPTX
Unit Testing
PPTX
Microsoft Fakes, Unit Testing the (almost) Untestable Code
PPTX
Unit Tests with Microsoft Fakes
PDF
How to Un-Flake Flaky Tests - A New Hire's Toolkit
PPTX
Testing the Untestable
PPTX
JavaScript Unit Testing
PPTX
Reducing Bugs With Static Code Analysis php tek 2025
PPT
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
PDF
A Story of Continuous Integration
PDF
Commonly used design patterns
PDF
Rearchitecturing a 9-year-old legacy Laravel application.pdf
PPTX
Episode 5 - Writing unit tests in Salesforce
PDF
Don't Be Mocked by your Mocks - Best Practices using Mocks
PDF
How to Un-Flake Flaky Tests - A New Hire's Toolkit
PDF
End-end tests as first class citizens - SeleniumConf 2020
PPTX
Unit Testing in Swift
PPTX
Improving the Quality of Existing Software - DevIntersection April 2016
PPTX
Declarative Network Configuration
PPTX
Factory method pattern
PPTX
Factory Pattern
Unit Testing
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Unit Tests with Microsoft Fakes
How to Un-Flake Flaky Tests - A New Hire's Toolkit
Testing the Untestable
JavaScript Unit Testing
Reducing Bugs With Static Code Analysis php tek 2025
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
A Story of Continuous Integration
Commonly used design patterns
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Episode 5 - Writing unit tests in Salesforce
Don't Be Mocked by your Mocks - Best Practices using Mocks
How to Un-Flake Flaky Tests - A New Hire's Toolkit
End-end tests as first class citizens - SeleniumConf 2020
Unit Testing in Swift
Improving the Quality of Existing Software - DevIntersection April 2016
Declarative Network Configuration
Factory method pattern
Factory Pattern

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Machine learning based COVID-19 study performance prediction
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
Tartificialntelligence_presentation.pptx
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
SOPHOS-XG Firewall Administrator PPT.pptx
Advanced methodologies resolving dimensionality complications for autism neur...

A second look at Unit Testing with Roy Osherove at Microsoft Swit