Mock object

  • 1,053 views
Uploaded on

 

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,053
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
7
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. Mock Object2011 3 5
  • 2. How it works SUT Mock Object SUT2011 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 Object2011 3 5
  • 6. Implementation Notes Mock Object SUT Test Spy2011 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 teardown2011 3 5
  • 9. Construction Four-Phase Test fixture setup phase Mock Object Configuration with Expected Values Test Double Mock Object →Hard-Coded Test Double2011 3 5
  • 10. Installation Test Double SUT SUT Dependency Injection Dependency Lookup2011 3 5
  • 11. Usage SUT Mock Object Assertion ( Mock Object )2011 3 5
  • 12. Mock Object SUT →happy path2011 3 5
  • 13. Final Verification 1 Mock Object toolkits teardown final Verification Method2011 3 5
  • 14. Motivating Example2011 3 5
  • 15. Refactoring Notes Test Double Mock Object SUT Mock Object 1 final verification method2011 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 Assert2011 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