Blog
navigate_next
Technology
Controversial: Yes, unit tests are more important than you think!
Shardul Lavekar
January 9, 2023

Testing the code is a controversial topic.

Developers are often found on 2 sides of this philosophical debate. One side advocates that end-to-end test cases suffice and the other is obsessed with writing in-detail unit tests.

One of famous analogy used to show end to end test cases are better:

Return on investment of unit test cases
Return on investment of unit test cases

It’s true that effort vs reward makes no sense when it comes to writing unit tests. 

Yet, here are 4 reasons unit tests are equally important:

  1. As your business grows, backtracking a bug from a mesh of microservices becomes hard and time consuming. Unit tests help detect and fix the bugs earliest in the development cycle.
  2. As your code grows in size and complexity, readability goes down. Unit tests serve as a documentation to your code. With unit tests, you can make changes to your code more confidently.
  3. Code that isn’t unit tested becomes tech debt and involves rework by future teams.
  4. Writing unit tests can help you think about how your code should be structured and what components it should consist of. This leads to more modular and maintainable code.

Use Unlogged to record and replay methods

In my 12 years of professional career, I realized that developers avoid writing unit tests for one reason: it takes time to write them! This slows down the pace of development, and the time to launch the product in the market. But not writing unit tests, has long term consequences.

With 6 months coding marathon, we are happy to finally launch Unlogged. 

It’s an IntelliJ plugin that adds our java agent to your existing run config. You can run the code with the unlogged’s agent, hit your APIs, and start generating unit tests in minutes. 

We aim to help developers save time in writing unit tests. 

Shardul Lavekar
January 9, 2023
Use Unlogged to
mock instantly
record and replay methods
mock instantly
Install Plugin