I’m sorry, but writing unit tests these days is a waste of time.

Use AI to generate them so you can focus on system tests

Darren Broemmer
8 min readMay 30, 2023
Image by author

Writing unit tests is a tedious task that developers typically don’t like to do. Conventional wisdom says they are fundamental to ensuring accurate, reliable code. I am here to tell you that they are a waste of time.

How could that be true? Unit tests detect bugs early in the development process. They provide a safety net when making changes or refactoring code.

Yes, that is true. To an extent. I would argue, however, system tests provide the real value during software development. Unit tests still serve a purpose, but now you can let AI do the heavy lifting.

Testing in 2023

When I was an engineer at Amazon Web Services, approximately half of every pull request was test code. This tells you the importance of automated testing. There is no separate QA team. Each team owns its own service and deploys frequently.

However, much of the test code was in the form of system tests. Sure, there were JUnit-style tests at the component level. So what is the difference?

Unit tests exercise individual units of code for correctness. This could be at the object or component level. The problem is…

--

--

Darren Broemmer

I write weekly on puzzles, science, and technology. Technologist, published author, ex-BigTech, indie publisher.