Your SlideShare is downloading. ×
Mock Objects: From Concept to Code
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Mock Objects: From Concept to Code

71
views

Published on

Mock objects are simulated objects that mimic the behavior of real objects in controlled ways. Because many code modules interact with external entities-things like databases, networks, file systems, …

Mock objects are simulated objects that mimic the behavior of real objects in controlled ways. Because many code modules interact with external entities-things like databases, networks, file systems, third-party frameworks, and even the clock-these entities often cause us big-time trouble during unit testing. These entities can slow down our unit tests, produce unpredictable results, and have dangerous side effects. The best unit tests are decoupled from these external entities. Rather than try to control the entities, you can create mock objects to simulate their functionality. With a tangible example in the form of a short play, Rob Myers introduces mock objects and provides a brief history of their "relatives"-stubs and fakes. Then, with an animated, nearly-worst-case example, Rob presents code he developed to "mock out" nasty dependencies and create safe, predictable unit tests. Learn how to mock out dependencies that will help you produce simpler, easier, and faster unit test suites.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
71
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1.           AW3 Concurrent Session  11/7/2012 10:15 AM              "Mock Objects: From Concept to Code”       Presented by: Rob Myers Agile Institute             Brought to you by:        340 Corporate Way, Suite 300, Orange Park, FL 32073  888‐268‐8770 ∙ 904‐278‐0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
  • 2. Rob Myers The Agile Institute Rob Myers is founder of Agile Institute and a founding member of the Agile Cooperative. Rob has twenty-five years of professional experience on software development teams, and has consulted for leading companies in aerospace, government, medical, software, and financial sectors. He has been training and coaching organizations in Scrum and Extreme Programming (XP) management and development practices since 1999. Courses include Essential Testdriven Development and Essential Agile Principles and Practices. Every course is a blend of enjoyable, interactive, hands-on labs—plus practical dialog toward preserving sanity in the workplace. Rob also performs short- and long-term coaching to encourage, solidify, and improve the team's agile practices.
  • 3. Mock Objects: From Concept to Code Rob Myers, Agile Institute Mock objects are simulated objects that mimic the behavior of real objects in controlled ways. Because many code modules interact with external entities—things like databases, networks, file systems, third-party frameworks, and even the clock—these entities often cause us big-time trouble during unit testing. These entities can slow down our unit tests, produce unpredictable results, and have dangerous side effects. The best unit tests are decoupled from these external entities. Rather than try to control the entities, you can create mock objects to simulate their functionality. With a tangible example in the form of a short play, Rob Myers introduces mock objects and provides a brief history of their “relatives”—stubs and fakes. Then, with an animated, nearly-worstcase example, Rob presents code he developed to “mock out” nasty dependencies and create safe, predictable unit tests. Learn how to mock out dependencies that will help you produce simpler, easier, and faster unit test suites. This presentation was not ready at time of CD production. Please check online proceedings after the conference.