Why you should write unit tests as a Web developer.

Harvinder Singh
1 min readJul 9, 2021

So I was given a task to do unit tests for a website, I had been helping on. I had no experience with unit tests but as its name suggested it was about testing the code in units or pieces.

Testing something with zero experience was like throwing yourself in jungle and survive. So first you have to actually understand how the code works. In a production ready code, the code uses too many “tools and plugins” that you would need to understand. It is not like just learning JAVA and calling yourself a devloper. The code has logic and data goes in from somehwere and gets processed somewhere and gets stored and then again fetched and then displayed. Understanding the code logic and how things work is probably the most useful thing about unit testing.

Now what about writing unit testings, writing unit tests would probably the easiest thing you would do if you get your way around the main code.

Writing unit tests require a lot of patience but reward are quite high. To become a competent developer, in this tech world where code is churned out, one should definitely try unit testing atleast for on of their projects

--

--