Value of Unit Testing

When you ask a group of developers what is more important, writing adaptable code or writing tests for the code to pass? I believe that both are equally as important as the other. I came across a blog by Tobias Goeschel, “Writing better tests with JUnit”, where he talks about the importance of writing better tests. In order to keep your code as high quality as possible, you must write tests. Poorly written tests as he describes may lead to bugs bypassing your code and having malfunctions in your program. As he lists in his blog, a set of well written tests will tell you (and more):

  • How to access the API
  • What data is supposed to go in/out
  • What possible variations of an expected behavior exist
  • The exceptions that might occur
  • How parts of the system interact with others

Tobias goes on and talks about how good tests should not be underestimated because it not only helps new team members understand what should be done but also reviewing old code that’s to be tampered with.

Reading through this article it all makes sense why we were always so test driven with the projects that we did in Data Structures. Every project we wrote had to pass a certain amount of pre-written tests. The author stressed the importance of unit testing which changes the way I will write in the future. Not only will I focus on written code but also tests. I believe that Unit Testing is equally important as mentioned.

Author: iharrynguyen

Hello friends, my name is Harry Nguyen. I am a novice programmer and current student at Worcester State university anticipating graduation this upcoming May 2019. Feel free to follow me on my life-long journey as I continue to learn the ins and outs in the field of computer science.

Leave a comment

Design a site like this with WordPress.com
Get started