Testing Delegate Methods

Posted on Fri 15 April 2016 in General Software Development, Testing • Tagged with delegate method, J. B. Rainsberger, JUnit, unit testing

We had an interesting discussion the other day: should we write unit tests for delegate methods, that is, methods that only delegate the call to a delegate object? Here's an example of such a method:

public void do(Object o1, Object o2) {
    delegate.do(o1,o2);
}

I said I did …


Continue reading

How to Make Unit Tests more Likeable

Posted on Mon 04 April 2016 in General Software Development, Testing • Tagged with argument captor, dummy, JUnit, mock, Mockito, spy, stub, unit testing

What are these unit tests good for? Are we testing Mockito?

This is what a colleague asked another colleague a couple of days ago. He was referring to some rather complicated and long unit tests that used a lot of mocks and verify statements. I knew what he was talking …


Continue reading