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

Java testing at google:

    * Don't mock if you have access to the remote server code, create fakes using calls to class methods being tested or use an in memory version of the entire thing if possible.
I know it's not easy and it takes time, but it's worth it in the long run. If something changes you'll detect errors quickly.

    * When using guice injections, override explicitly what you need directly in the test setup. Don't create huge test modules with everything and the kitchen sink, eventually these will become unmaintainable and become difficult for future maintainters to understand where overrides and injections are coming from.
Integration testing is whole another subject but I would highly recommend it for mission critical production code.


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

Search: