1 / 10

Mocks and Stubs

Mocks and Stubs. Test Doubles with and without Rhino Mocks. Why do I care. About all this mocking baloney?. The “Unit” in Unit Test. No External Dependencies No Database No Network No Registry No context-dependent information ( config files, etc.) Goal: 100-500/sec

carlo
Télécharger la présentation

Mocks and Stubs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mocks and Stubs Test Doubles with and without Rhino Mocks

  2. Why do I care • About all this mocking baloney?

  3. The “Unit” in Unit Test • No External Dependencies • No Database • No Network • No Registry • No context-dependent information (config files, etc.) • Goal: 100-500/sec • BUT…what about internal dependencies?

  4. Code time!

  5. Real-World Testing Strategies • Inside-Out

  6. Real-World Testing Strategies • Outside-In

  7. Note on tools

  8. A Closer Look – Indirect Inputs • Leave no code behind! • Can we control it? • If not, STUB TIME!!!

  9. A Closer Look – Indirect Outputs • Do I care if you’re called? • Leave no requirement behind! • Favor doubles over the real deal

  10. Links et. al. • Rhino Mocks - http://www.ayende.com/projects/rhino-mocks.aspx • Moq - http://code.google.com/p/moq/ • xUnit Test Patterns - http://xunitpatterns.com/ • Me • http://jimmybogard.lostechies.com • http://feeds.feedburner.com/GrabBagOfT • http://www.lostechies.com • http://feeds.feedburner.com/LosTechies • http://twitter.com/jbogard

More Related