2010/06/07 23:18 Developer

mock vs stub

개념만 이해를 하고 있고, 설명을 하려니 그림/표가 부족해서 정리 잘 된 문서 몇개 정리를 해봤다.



mock

mock object http://www.c2.com/cgi/wiki?MockObject

mock aren't stubs http://martinfowler.com/articles/mocksArentStubs.html

mock roles, not object http://www.jmock.org/oopsla2004.pdf

mock vs stub

http://weblogs.asp.net/rosherove/archive/2007/09/16/mocks-and-stubs-the-difference-is-in-the-flow-of-information.aspx
  • Stubs provide input for the application under test so that the test can be performed on something else.
  • Mocks provide input to the test to decide on pass\fail. the opposite direction.

image 

A stub can never fail a test.


xunit patterns http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html

Terminology Cross-Reference

I'm listing some sources of conflicting definitions just to make it clear what the mapping is to my pattern names:



Sources and Names Used in them
PatternAstelsBeckFeathersFowlerjMockUTWJOMGPragmaticRecipes
Test Double






Double or stand-in
Dummy ObjectStub


Dummy


Stub
Test StubFake
FakeStubStubDummy
MockFake
Test Spy




Dummy

Spy
Mock ObjectMock
MockMockMockMock
MockMock
Fake Object




Dummy


Temporary Test Stub




Stub


OMG's CORBA Stub





Stub

Posted by ologist
 TAG
이전버튼 1 ... 13 14 15 16 17 18 19 20 21 ... 666 이전버튼

블로그 이미지
ologist

공지사항

Yesterday221
Today25
Total34,406

달력

 « |  » 2012.02
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

최근에 받은 트랙백

글 보관함