Posts in testing

Effective Testing - Reducing Non-determinism to Avoid Flaky Tests

Flaky tests are those that randomly fail for no apparent reason. If you have a flaky test, you might re-run it, over and over, until it succeeds. If you have a couple of them, the chances of all passing at the same time are slim, so maybe you ignore the failures. You know, just this one time… Soon enough, you’re not paying attention to failures on this test suite. Congratulations! Your tests are now worthless.

written in effective-testing-series, flaky, non-determinism, testing, tests Read on →

Using PowerMock + TestNG to Mock a Static Class

 This week I needed to test a class that depended on a method from an static class. I saw we were using [PowerMock][1] and thought to myself: “Well this sounds pretty common, I bet it’s easy to accomplish”. But of course I ran into half a dozen issues before I was able to make it work. Here’s my two cents to make your experience easier than mine.

written in java, mocking, testing Read on →