Static, Non-Static. Mockable, Non-Mockable… Instead, Let’s Focus on Real Added Value…

The never ending topic of testability... Dogmatic discussions about stuff being static, non-static. Mockable, non-mockable. Testable, non-testable. Here's an article that was recently syndicated on DZone, about the evilness in making things static: http://java.dzone.com/articles/why-static-bad-and-how-avoid While the article itself is still somewhat focused on simple means of making something mockable through dependency injection, the big lot … Continue reading Static, Non-Static. Mockable, Non-Mockable… Instead, Let’s Focus on Real Added Value…

How to Execute Something Multiple Times in Java

When writing unit / integration tests, you often want to execute something multiple times, with different configurations / parameters / arguments every time. For instance, if you want to pass a "limit" or "timeout" or any other argument value of 1, 10, and 100, you could do this: @Test public void test() { runCode(1); runCode(10); … Continue reading How to Execute Something Multiple Times in Java

Easy Mocking of Your Database

Test-driven development is something wonderful! Once you've established it in your organisation, you will start to: Greatly improve your quality (things break less often) Greatly improve your processes (things can be changed more easily) Greatly improve your developer atmosphere (things are more fun to do) The importance of doing the right test-driven development is to … Continue reading Easy Mocking of Your Database