Gil Zilberfeld on test categorization and testability - Which tests we need to write - integration tests, unit tests, system tests, and if we should use TDD.

Creating A Unit Test Strategy – Part II

This is the 2nd part of the series about analyzing what we’re coding, and therefore which unit tests and integration tests to write. Last time, we talked about the problem we want to test (either unit tests, integration tests or… Continue Reading…

Gil Zilberfeld presents a new version of the "Everyday Unit Testing" book is out! New content on refactoring, economics, testability and writing unit tests.

Version 0.06 Of Everyday Unit Testing Published!

It’s been a while, but we’re not done yet. A new version of “Everyday Unit Testing” arrives! Let’s see what we have in this one: First of all, I’ve made “From Legacy To Testable Code” its own chapter. I’m not… Continue Reading…

Gil Zilberfeld explains about analyzing and creating a strategy for unit tests and integration tests. It also covers also the TDD and test after perspective

Creating A Unit Testing Strategy – Part I

This series of posts describes the process I use to decide which unit tests to write, and how to write them – regardless if the code already exists or not. This approach works for both TDD and test-after unit tests,… Continue Reading…

Gil Zilberfeld explains how Unit tests (and integration tests) not only check that the code works, but are also hold useful information when they fail.

Triangulation: The Other Role Of Unit Tests

“Why do we need unit tests?” Seems like a silly question. We want to check if something is working, right? Let’s dig deeper, though. At the time of writing, if we’re using test-first or TDD, we’re designing interfaces, apply usage… Continue Reading…

Gil Zilberefld explains how multiple asserts are usually a sign of scope creep in unit tests. They may also create situations that delay solving the problem when the unit test fails.

The Unit Test Scope Creep

In “Should I use multiple asserts” we described the problem when using them in a single unit test. In the example I gave, while checking the result of a single operation, it still made sense to get information on both… Continue Reading…

Gil Zilberfeld explains why we would want to split unit tests with multiple assertions into single unit tests with single asserts.

Should I Use Or Split Multiple Asserts?

I get this unit testing question often. It makes efficient sense to stuff all kinds of assertions after a single setup and invocation. While there’s no one answer, for me, it usually comes down to: Try to separate rather than join… Continue Reading…

Gil Zilberfeld explains why some unit tests are not important to write, and may even cost you later. We don't need to get to complete code coverage by writing every unit test possible

Should We Write That Test?

As we’ve seen already, we don’t have to write every unit test possible, since not every unit test is going to help us in the future, and may even cause us some problems. Here’s an actual example I encountered. I’ll… Continue Reading…

Gil Zilberfeld explains why not every unit test or integration tests are valuable. We need to ask what bug will the unit test find, to see if want to keep it.

What Bug Will It Find?

“Is this a good unit test?” Usually the question refers to a test that somebody has already written. But are these unit tests effective? Should we have written it in the first place? That’s right, we don’t need to test… Continue Reading…

Gil Zilberfeld explains the actual costs we pay by writing bad unit tests and integration tests

The Actual Cost of Tests – Part II

You think I was finished? I haven’t even started. The first group of associated costs to testing were around the fact that unit tests are, in fact, code and as such are susceptible to all kinds of flaws that come… Continue Reading…

Gil Zilberfeld talks about testing economics and the actual cost of unit tests

Testing Economics: The Actual Cost of Unit Tests – Part I

We talked about what we perceive as the cost of unit tests: slowing us down. That does not mean that unit tests are free. There are actual costs associated with unit tests, although they may not be what you think. I… Continue Reading…

Copyright Gil Zilberfeld, 2025