Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't really see how production-code mocks differ from library-based mocks. If you add but a single constructor parameter to your class, you already need to change your production-mock/stub too.


the benefits I see:

- nullable (test double/mock) updates would be more natural, easier, since it is located right there in prod code. (One level of indirection removed)

- with authoritative location of test double, it reduces the risk of test double proliferation/duplication

(I doubt I will use it in the proposed form though, saving test double code in prod is not for me probably)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: