---
title: "Discussion on \"How the lack of internal state makes your classes easier to test and refactor\" | Hashnode"
description: "Discussion on \"How the lack of internal state makes your classes easier to test and refactor\". You likely often hear that test-driven development (TDD) or just writing tests can make your code better. It’s hard to say whether this is true unless you have seen the impact of writing unit tests on code before. Let’s take a look at this effect wit..."
url: "https://hashnode.com/posts/how-the-lack-of-internal-state-makes-your-classes-easier-to-test-and-refactor/626f8721a2d355d4df441c58"
---

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

Discussion

# [How the lack of internal state makes your classes easier to test and refactor](https://how-to.dev/how-the-lack-of-internal-state-makes-your-classes-easier-to-test-and-refactor?utm_source=hashnode&utm_medium=feed)

You likely often hear that test-driven development (TDD) or just writing tests can make your code better. It’s hard to say whether this is true unless you have seen the impact of writing unit tests on code before. Let’s take a look at this effect wit...

May 2, 2022 · 4 min read · how-to.dev  
Read the article

## Written by

[Marcin Wosinek](https://hashnode.com/@marcin-wosinek)

@marcin-wosinek · Valencia, Spain

  
[View profile](https://hashnode.com/@marcin-wosinek)

JavaScript developer

I'm JS developer with 13 years of professional experience. I'm always happy to teach my craft.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
