SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Plus 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
 

Plus 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移行事例~
 
「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまで「すいーとみゅーじっく」のできるまで
「すいーとみゅーじっく」のできるまで
 

Dernier

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Dernier (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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.
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

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