SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Mock Object




2011   3   5
How it works

               SUT

               Mock Object   SUT




2011   3   5
When to use it

               Untested Requirement
                   (pp.273)




                                 ↑

2011   3   5
Mock Object
                          Test Stub


                                      equals


                                                   Mock Object


                 equals                        →Equality Pollution
               (pp.217)




2011   3   5
Mock Object                  Equality
               Assertions           comparator




               Mock Object




                     Mock Object   Mock Object


                              Mock Object



2011   3   5
Implementation Notes

               Mock Object        SUT




                      Test Spy



2011   3   5
Mock Object                       4
                      fixture
                      3
                          result verification phase
                  (“final verification”
                  )




2011   3   5
Fixture Setup
               MockObject         /


               Exercise SUT
               MocK Object


               Result verification
                        “final verification”


               Fixture teardown




2011   3   5
Construction
               Four-Phase Test   fixture setup phase
                        Mock Object




               Configuration with Expected Values
               Test Double                     Mock
               Object


               →Hard-Coded Test Double


2011   3   5
Installation
               Test Double SUT




               SUT


               Dependency Injection   Dependency Lookup




2011   3   5
Usage
               SUT Mock Object




               Assertion
               (      Mock Object


                                    )


2011   3   5
Mock Object   SUT


                             →happy path




2011   3   5
Final Verification
                          1


                         Mock Object toolkits    teardown


                                       final Verification
               Method




2011   3   5
Motivating Example




2011   3   5
Refactoring Notes
                       Test Double

               Mock Object
                                 SUT



                             Mock Object                 1
                                     final verification method




2011   3   5
2011   3   5
2011   3   5
JUnit3      Mock Object    TestCase
                                    Assertion Method   static




                   xUnit Family      NUnit   static
                         Assert


                  Ruby Test::Unit        mixins
               Assert



2011   3   5
Example: Mock Object
               (Dynamically Generated)




2011   3   5
Further Reading

                  xUnit                Mock Object


                                        Mock Object
               Test Stub Fake Object


                →Appnendix B(pp.741)



2011   3   5

Más contenido relacionado

La actualidad más candente

Unit testing.pptx [repaired]
Unit testing.pptx [repaired]Unit testing.pptx [repaired]
Unit testing.pptx [repaired]Mohammad Asmar
 
What's new in c# 6.0
What's new in c# 6.0What's new in c# 6.0
What's new in c# 6.0LearningTech
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2Leonid Maslov
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareAndrey Karpov
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handlingsanya6900
 
A Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesA Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesBoni García
 
Test final jav_aaa
Test final jav_aaaTest final jav_aaa
Test final jav_aaaBagusBudi11
 
Xp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And MocksXp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And Mocksguillaumecarre
 
Mining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs ViolationsMining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs ViolationsDongsun Kim
 
Covariance, contravariance 觀念分享
Covariance, contravariance 觀念分享Covariance, contravariance 觀念分享
Covariance, contravariance 觀念分享LearningTech
 
Java 8 Functional Programming - I
Java 8 Functional Programming - IJava 8 Functional Programming - I
Java 8 Functional Programming - IUgur Yeter
 
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...Iosif Itkin
 
Beyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureBeyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureJayaram Sankaranarayanan
 
Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7ArraLafuente
 
QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5Akash Tyagi
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)Henry Muccini
 
Functional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersFunctional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersJayaram Sankaranarayanan
 

La actualidad más candente (20)

Unit testing.pptx [repaired]
Unit testing.pptx [repaired]Unit testing.pptx [repaired]
Unit testing.pptx [repaired]
 
What's new in c# 6.0
What's new in c# 6.0What's new in c# 6.0
What's new in c# 6.0
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handling
 
A Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesA Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test Cases
 
Grasping dataset
Grasping datasetGrasping dataset
Grasping dataset
 
Core java day4
Core java day4Core java day4
Core java day4
 
Test final jav_aaa
Test final jav_aaaTest final jav_aaa
Test final jav_aaa
 
Xp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And MocksXp Day 080506 Unit Tests And Mocks
Xp Day 080506 Unit Tests And Mocks
 
Mining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs ViolationsMining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs Violations
 
Covariance, contravariance 觀念分享
Covariance, contravariance 觀念分享Covariance, contravariance 觀念分享
Covariance, contravariance 觀念分享
 
Java 8 Functional Programming - I
Java 8 Functional Programming - IJava 8 Functional Programming - I
Java 8 Functional Programming - I
 
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
 
Beyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureBeyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software Architecture
 
Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7
 
QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5
 
Md04 flow control
Md04 flow controlMd04 flow control
Md04 flow control
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)
 
Functional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersFunctional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 Developers
 

Destacado

Mock Objects Presentation
Mock Objects PresentationMock Objects Presentation
Mock Objects PresentationAndriy Buday
 
Mock objects - Teste de código com dependências
Mock objects - Teste de código com dependênciasMock objects - Teste de código com dependências
Mock objects - Teste de código com dependênciasDenis L Presciliano
 
Testing with Mock Objects
Testing with Mock ObjectsTesting with Mock Objects
Testing with Mock ObjectsBen Carey
 
TDD and mock objects
TDD and mock objectsTDD and mock objects
TDD and mock objectsSteve Zhang
 
Easymock Tutorial
Easymock TutorialEasymock Tutorial
Easymock TutorialSbin m
 
Advanced PHPUnit Testing
Advanced PHPUnit TestingAdvanced PHPUnit Testing
Advanced PHPUnit TestingMike Lively
 

Destacado (8)

Mock Objects Presentation
Mock Objects PresentationMock Objects Presentation
Mock Objects Presentation
 
Beyond TDD
Beyond TDDBeyond TDD
Beyond TDD
 
Mock objects - Teste de código com dependências
Mock objects - Teste de código com dependênciasMock objects - Teste de código com dependências
Mock objects - Teste de código com dependências
 
Testing with Mock Objects
Testing with Mock ObjectsTesting with Mock Objects
Testing with Mock Objects
 
TDD and mock objects
TDD and mock objectsTDD and mock objects
TDD and mock objects
 
Easymock Tutorial
Easymock TutorialEasymock Tutorial
Easymock Tutorial
 
Mock objects in PHPUnit
Mock objects in PHPUnitMock objects in PHPUnit
Mock objects in PHPUnit
 
Advanced PHPUnit Testing
Advanced PHPUnit TestingAdvanced PHPUnit Testing
Advanced PHPUnit Testing
 

Más de Hiroyuki Ohnaka

remote Docker over SSHが熱い
remote Docker over SSHが熱いremote Docker over SSHが熱い
remote Docker over SSHが熱いHiroyuki Ohnaka
 
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験Hiroyuki Ohnaka
 
Remote Development with Visual Studio Code & A clean dev env, working every ...
Remote Development with Visual Studio Code &  A clean dev env, working every ...Remote Development with Visual Studio Code &  A clean dev env, working every ...
Remote Development with Visual Studio Code & A clean dev env, working every ...Hiroyuki Ohnaka
 
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話ChefとItamaeをニコイチしてAnsibleにマイグレーションした話
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話Hiroyuki Ohnaka
 
「WindowsデスクトップでWeb開発 改訂版」サンプル
「WindowsデスクトップでWeb開発 改訂版」サンプル「WindowsデスクトップでWeb開発 改訂版」サンプル
「WindowsデスクトップでWeb開発 改訂版」サンプルHiroyuki Ohnaka
 
Microsoft DocsにContributeした話
Microsoft DocsにContributeした話Microsoft DocsにContributeした話
Microsoft DocsにContributeした話Hiroyuki Ohnaka
 
Azure functions+typescript
Azure functions+typescriptAzure functions+typescript
Azure functions+typescriptHiroyuki Ohnaka
 
技術書典4 く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版
 技術書典4  く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版 技術書典4  く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版
技術書典4 く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版Hiroyuki Ohnaka
 
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版Hiroyuki Ohnaka
 
仮想通貨始めました~GethではじめるEthereum~
仮想通貨始めました~GethではじめるEthereum~仮想通貨始めました~GethではじめるEthereum~
仮想通貨始めました~GethではじめるEthereum~Hiroyuki Ohnaka
 
錬金術MeetUpへのお誘い
錬金術MeetUpへのお誘い錬金術MeetUpへのお誘い
錬金術MeetUpへのお誘いHiroyuki Ohnaka
 
Mackerelではじめる お手軽サーバー監視
Mackerelではじめる お手軽サーバー監視Mackerelではじめる お手軽サーバー監視
Mackerelではじめる お手軽サーバー監視Hiroyuki Ohnaka
 
「GebとSpockではじめるシステムテスト自動化」
「GebとSpockではじめるシステムテスト自動化」「GebとSpockではじめるシステムテスト自動化」
「GebとSpockではじめるシステムテスト自動化」Hiroyuki Ohnaka
 
TDDはじめて物語Second Season(updated)
TDDはじめて物語Second Season(updated)TDDはじめて物語Second Season(updated)
TDDはじめて物語Second Season(updated)Hiroyuki Ohnaka
 
TDDはじめて物語 Second Season #tddbc
TDDはじめて物語 Second Season #tddbcTDDはじめて物語 Second Season #tddbc
TDDはじめて物語 Second Season #tddbcHiroyuki Ohnaka
 
XP祭り2017 LT 「DevOps再考」(改題)
XP祭り2017 LT 「DevOps再考」(改題)XP祭り2017 LT 「DevOps再考」(改題)
XP祭り2017 LT 「DevOps再考」(改題)Hiroyuki Ohnaka
 
JDK9の真の目玉機能はこれだ!
JDK9の真の目玉機能はこれだ!JDK9の真の目玉機能はこれだ!
JDK9の真の目玉機能はこれだ!Hiroyuki Ohnaka
 
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~Hiroyuki Ohnaka
 
「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまで「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまでHiroyuki Ohnaka
 

Más de Hiroyuki Ohnaka (20)

remote Docker over SSHが熱い
remote Docker over SSHが熱いremote Docker over SSHが熱い
remote Docker over SSHが熱い
 
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験
VSCode Remote Container & GitHub Codespacesで拓く次世代のJava開発体験
 
Remote Development with Visual Studio Code & A clean dev env, working every ...
Remote Development with Visual Studio Code &  A clean dev env, working every ...Remote Development with Visual Studio Code &  A clean dev env, working every ...
Remote Development with Visual Studio Code & A clean dev env, working every ...
 
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話ChefとItamaeをニコイチしてAnsibleにマイグレーションした話
ChefとItamaeをニコイチしてAnsibleにマイグレーションした話
 
「WindowsデスクトップでWeb開発 改訂版」サンプル
「WindowsデスクトップでWeb開発 改訂版」サンプル「WindowsデスクトップでWeb開発 改訂版」サンプル
「WindowsデスクトップでWeb開発 改訂版」サンプル
 
Mackerelの薄い本
Mackerelの薄い本Mackerelの薄い本
Mackerelの薄い本
 
Microsoft DocsにContributeした話
Microsoft DocsにContributeした話Microsoft DocsにContributeした話
Microsoft DocsにContributeした話
 
Azure functions+typescript
Azure functions+typescriptAzure functions+typescript
Azure functions+typescript
 
技術書典4 く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版
 技術書典4  く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版 技術書典4  く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版
技術書典4 く-35「錬金術MeetUp」 Alchemist Vol.1 サンプル版
 
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版
4/22 技術書典4 か-16「ふぃーるどのーつ」 新刊「すいーとみゅーじっく vol.5Mackerelではじめるお手軽サーバー監視」サンプル版
 
仮想通貨始めました~GethではじめるEthereum~
仮想通貨始めました~GethではじめるEthereum~仮想通貨始めました~GethではじめるEthereum~
仮想通貨始めました~GethではじめるEthereum~
 
錬金術MeetUpへのお誘い
錬金術MeetUpへのお誘い錬金術MeetUpへのお誘い
錬金術MeetUpへのお誘い
 
Mackerelではじめる お手軽サーバー監視
Mackerelではじめる お手軽サーバー監視Mackerelではじめる お手軽サーバー監視
Mackerelではじめる お手軽サーバー監視
 
「GebとSpockではじめるシステムテスト自動化」
「GebとSpockではじめるシステムテスト自動化」「GebとSpockではじめるシステムテスト自動化」
「GebとSpockではじめるシステムテスト自動化」
 
TDDはじめて物語Second Season(updated)
TDDはじめて物語Second Season(updated)TDDはじめて物語Second Season(updated)
TDDはじめて物語Second Season(updated)
 
TDDはじめて物語 Second Season #tddbc
TDDはじめて物語 Second Season #tddbcTDDはじめて物語 Second Season #tddbc
TDDはじめて物語 Second Season #tddbc
 
XP祭り2017 LT 「DevOps再考」(改題)
XP祭り2017 LT 「DevOps再考」(改題)XP祭り2017 LT 「DevOps再考」(改題)
XP祭り2017 LT 「DevOps再考」(改題)
 
JDK9の真の目玉機能はこれだ!
JDK9の真の目玉機能はこれだ!JDK9の真の目玉機能はこれだ!
JDK9の真の目玉機能はこれだ!
 
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~
Java8移行は怖くない~エンタープライズ案件でのJava8移行事例~
 
「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまで「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまで
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Mock object

  • 2. How it works SUT Mock Object SUT 2011 3 5
  • 3. When to use it Untested Requirement (pp.273) ↑ 2011 3 5
  • 4. Mock Object Test Stub equals Mock Object equals →Equality Pollution (pp.217) 2011 3 5
  • 5. Mock Object Equality Assertions comparator Mock Object Mock Object Mock Object Mock Object 2011 3 5
  • 6. Implementation Notes Mock Object SUT Test Spy 2011 3 5
  • 7. Mock Object 4 fixture 3 result verification phase (“final verification” ) 2011 3 5
  • 8. Fixture Setup MockObject / Exercise SUT MocK Object Result verification “final verification” Fixture teardown 2011 3 5
  • 9. Construction Four-Phase Test fixture setup phase Mock Object Configuration with Expected Values Test Double Mock Object →Hard-Coded Test Double 2011 3 5
  • 10. Installation Test Double SUT SUT Dependency Injection Dependency Lookup 2011 3 5
  • 11. Usage SUT Mock Object Assertion ( Mock Object ) 2011 3 5
  • 12. Mock Object SUT →happy path 2011 3 5
  • 13. Final Verification 1 Mock Object toolkits teardown final Verification Method 2011 3 5
  • 15. Refactoring Notes Test Double Mock Object SUT Mock Object 1 final verification method 2011 3 5
  • 16. 2011 3 5
  • 17. 2011 3 5
  • 18. JUnit3 Mock Object TestCase Assertion Method static xUnit Family NUnit static Assert Ruby Test::Unit mixins Assert 2011 3 5
  • 19. Example: Mock Object (Dynamically Generated) 2011 3 5
  • 20. Further Reading xUnit Mock Object Mock Object Test Stub Fake Object →Appnendix B(pp.741) 2011 3 5