unit testing - Why we need to test fake code? -
maybe question sound silly someone, anyway: why need test fake code?
i read this book , can not understand why need test units initialize ourself including returning values , e.t.c. if use fake object return want (if use aaa pattern) , if logic of real code change , wrong, unit test mock or stub don`t show that. wrong?
or unit-tests need documenting how need work classes or libraries?
the point in mocking not mock objects going test mock objects object under test depends on, like:
testrunner -> objectundertest -> mockedobject1..n
here test behavior of objectundertest needs other objects work. latter objects not subject current test, , mocked test instance.
Comments
Post a Comment