Beware of letting your unit tests become integration tests

Today's tip comes from Dustin Sparks. As soon as you have a test dependent on something other than the unit of code you're testing, or a mock, you might have an integration test. That's ok, just be aware you're doing it.

Unit tests are designed to execute very quickly, on a single unit of code. Once you introduce dependencies you typically slow them down. That makes people less likely to run them. Also, unit tests should be focused. It's feedback on your test design. If you're trying to write a unit test, and you get an integration test, you might be having an issue framing the problem space.