Testing with Mock Objects

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Testing with Mock Objects - Presentation Transcript

    1. testing with mock objects
    2. when i say testing…
      • == developer / unit tests
      • == integration tests (sometimes)
      • != functional / acceptance tests
    3. when i say mock…
      • test stub
      • mock object
      • dummy object
      • fake object
    4. mock vs. stub interaction vs. state
      • the difference between mocks and stubs
      • usually the same library provides both
      • interaction = mock
      • state = stub
    5. why?
    6. testing is easy in isolation
    7. testing is harder with dependencies …
    8. … so remove the dependencies (for developer testing)
    9. for me…
      • lots of time in the airport
      • lots of time in the airplane
      • lots of time on the train
      • not enough family time
      • not enough snowboarding
    10. scenarios to think about
      • fee per transaction
      • distributed development
      • parallel development
      • plug-ins / providers
      • automated test duration
    11. scenarios to think about
      • third-party tools or services
      • non-deterministic outcomes
      • external systems
      • the mainframe crew
      • defer infrastructure choices
    12. demo
    13. thoughts
    14. … on architecture and design
      • similar to the benefits of tdd
      • writing to interfaces = code empathy
      • easier to test = good design
      • highly cohesive / loosely coupled
    15. … on implementation
      • good libraries exist
      • roll your own only for extreme cases
      • for .Net…
      • NMock, NMock2, Rhino Mocks, DotNetMock
    16. … on automated builds
      • developer tests: use mocks (if necessary)
      • acceptance tests: don’t use mocks
    17. … on a few useful patterns
      • code to interfaces
      • thin proxies
      • self-shunt
      • dependency injection
      • providers
    18. learn more
    19. http:// www.martinfowler.com/articles/mocksArentStubs.html
    20. http:// xunitpatterns.com /
    21. http:// www.nmock.org
    22. http:// www.mockobjects.com
    23. http:// www.codeproject.com/dotnet/tdd_in_dotnet.asp

    + Ben CareyBen Carey, 3 years ago

    custom

    1038 views, 1 favs, 0 embeds more stats

    A presentation on the value of mock objects when us more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1038
      • 1038 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 41
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories