Don’t chase vanity metrics

Quick note: I’m moving this list to be every weekday rather than weekdays plus Saturday. That’ll keep the content fresher.

Another quick note: I helped supervise a youth camping trip yesterday and thought I had properly queued this to go out. It didn’t. My mistake.

Don’t pursue vanity metrics like 100% test coverage.

If you use TDD, you’ll just get it anyway because you only write code that a test “pulls” into existence. So, it’s not even that impressive.

Second, just because 100% of your code is exercised during your tests, doesn’t mean you have the tests that you need.

For example, you may have a data object that has a couple of methods on it. You’d develop that object by writing tests that exercise those methods and that verify they work correctly.

For the parts of your system that use this data object, you’d write tests that exercise their code that also uses the data object.

You wouldn’t skip the tests for the data object just because they happen to get used by some other test. Those other tests are testing their modules and not your data object. Just because your data object’s code got covered by a test doesn’t mean that your data object’s code is tested.

You only get that by writing tests specifically for it.


Like this message? I send out a short email each day to help software development leaders build organizations the deliver value. Join us!


Get the book!

Ready to learn how to build an autonomous, event-sourced microservices-based system? Practical Microservices is the hands-on guidance you've been looking for.

Roll up your sleeves and get ready to build Video Tutorials, the next-gen web-based learning platform. You'll build it as a collection of loosely-coupled autonomous services, developing a message store interface along the way.

When you're done, you'll be ready to contribute to microservices-based projects.

In ebook or in print.