~/devreads

#unit testing

6 posts

26 Mar

George Lund 4 min read

As software developers, we’ve all been there: a simple requirement change requires adding a tenantId field to your User model. It’s a five-minute code change, but suddenly, 458 tests are failing. It’s happening not because the logic is broken, but because the User model is used everywhere, and now the test data is invalid. I’ve […] The post Test Builders:…

unit testingtesting

28 Dec 2020

Henrik Warne 3 min read

Choosing test values when writing unit tests is mostly guided by the need to cover all cases of the program logic. However, some values are better than others. Here are a few tips on how to pick values that make … Continue reading →

testingunit testingunit-test

1 May 2018

4 Sept 2014

19 Feb 2014

Henrik Warne 2 min read

When I first heard about unit testing using a framework like JUnit, I thought it was such a simple and powerful concept. Instead of ad hoc testing, you save your tests, and they can be run as often as you … Continue reading →

testingunit testing

9 Feb 2014

Henrik Warne 8 min read

How can you unit test private methods? If you google this question, you find several different suggestions: test them indirectly, extract them into their own class and make them public there, or use reflection to test them. All these solutions … Continue reading →

testingprivate methodunit testing