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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -