"Test Double is a generic term for any case where you replace a production object for testing purposes". This is how Martin Fowler describes it. They are mainly used in unit tests, when the unit must be tested in isolation. A little background If we are not testing the component in isolation, it's hard to cover… Continue reading Test doubles
Category: Test your code
Fluent assertions in Junit
Yes. Still Junit. We're not done with it yet. This is about how to make assertions using AssertJ. It's a cool library which is really easy to use and helps our tests look fluent and nicer. I'm not gonna go over all assertions that are available, I will just focus on some of them that… Continue reading Fluent assertions in Junit
BDD with Junit
Just recently, on 18th of September 2016 JGiven was released. So I wanted to know how does it look like and what can we do with it. As many of you already know BDD stands for Behavioural Driven Development. That means writing the test in a such a way that non-technical people(eg Business Analysts) would… Continue reading BDD with Junit
Junit Rules
While this can be read in many ways, this is strictly referring to the @Rule annotation and TestRule interface that are available for use in Junit. These are not widely used but they do help us in setting up tests and making the code more elegant and less verbose. What are they good for? Well they are good… Continue reading Junit Rules
Mutation testing
Weak tests. Even with 100% coverage that does not mean the code is completely tested. See weak tests. What is it? Mutation testing is a structural testing technique, which uses the structure of the code to guide the testing process. Each mutated version is called a mutant. They need to be killed. Test suites are measured by… Continue reading Mutation testing