---
title: "Discussion on \"Why should I unit test my code?\" | Hashnode"
description: "Discussion on \"Why should I unit test my code?\". Hi everyone, today we are going to explore the WHY question on unit testing the code.\nA very popular debate which I have observed in the developers’ world is whether or not to write unit test cases for code and how writing those test cases could (no,..."
url: "https://hashnode.com/posts/why-should-i-unit-test-my-code/5f660a3535d6463d2b5f82d0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why should I unit test my code?](https://anu.hashnode.dev/why-should-i-unit-test-my-code?utm_source=hashnode&utm_medium=feed)

Hi everyone, today we are going to explore the WHY question on unit testing the code. A very popular debate which I have observed in the developers’ world is whether or not to write unit test cases for code and how writing those test cases could (no,...

Sep 19, 2020 · 8 min read · anu.hashnode.dev  
Read the article

-   [#unit-testing](https://hashnode.com/tag/unit-testing)
-   [#tdd](https://hashnode.com/tag/tdd)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#jest](https://hashnode.com/tag/jest)

## Written by

[Anuradha Kumari](https://hashnode.com/@anu)

@anu · Pune, India

  
[View profile](https://hashnode.com/@anu)

Frontend Developer | GDE | MVP | MDE | Speaker | Writer | Accessibility advocate

I am a JavaScript developer and accessibility advocate from India. I am working towards contributing to and spreading awareness about best practices to make the web more inclusive and accessible to all.

## Responses 2

Markdown supported · ⌘↵ to post

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Sep 24, 2020](https://hashnode.com/posts/why-should-i-unit-test-my-code/5f660a3535d6463d2b5f82d0/comment/5f6cbf4ed1227c4f65a9353c)

Nice article, very well written 👏👏

[Anuradha Kumari](https://hashnode.com/@anu)

[Sep 25, 2020](https://hashnode.com/posts/why-should-i-unit-test-my-code/5f660a3535d6463d2b5f82d0/comment/5f6cbf4ed1227c4f65a9353c#reply-5f6d867ba654ca5357fd94cb)

Thanks Apoorv 🙏

[Vignesh M](https://hashnode.com/@ShivEnigma)

[Sep 19, 2020](https://hashnode.com/posts/why-should-i-unit-test-my-code/5f660a3535d6463d2b5f82d0/comment/5f6615f96dfc523d0a89349d)

Well written [Anuradha Kumari](https://hashnode.com/@anu). It seems that this is a never-ending discussion in programming. Looking forward to the next posts in the series.

[Anuradha Kumari](https://hashnode.com/@anu)

[Sep 19, 2020](https://hashnode.com/posts/why-should-i-unit-test-my-code/5f660a3535d6463d2b5f82d0/comment/5f6615f96dfc523d0a89349d#reply-5f6617d635d6463d2b5f8366)

Thanks for your kind words. Totally agree, I have seen this discussion continue from forever to forever. 😅 Added my two cents in case it helps even one person
