DEV Community

Cover image for Pros & Cons of Unit Testing
Alex K. for HireTester

Posted on

Pros & Cons of Unit Testing


  • More reusable code and easier debugging.
  • Reduced cost for testing and bug-fixing.
  • Increased efficiency of code improvement and maintenance.
  • Simplified interaction due to separate and complex modules testing.
  • Errors can be detected at the early stages of the SDLC.


  • It's difficult to write quality unit tests and the whole process can be time-consuming.
  • Human factor. A developer can make a mistake that will impact the whole system.
  • Not all errors can be detected, since every module it tested separately and later different integration bugs may appear.

Many specialists believe that unit testing is a must for a quality product release. However, there are those, who hold a different opinion. Considering all the pros and cons, what side will you take?

Top comments (1)

testree profile image
Roberto Romello

Good one - thank you! Besides all the pros, the main disadvantage is the first point that you've listed here is the most difficult one in unit testing. Of course, each one holds a different opinion for a quality product release. That's true. I agree.