---
title: "Discussion on \"What Is Dependency Injection? The Trick That Makes Code Easy to Test\" | Hashnode"
description: "Discussion on \"What Is Dependency Injection? The Trick That Makes Code Easy to Test\". To put it simply, dependency injection means a piece of code never builds the things it needs — it receives them, handed in from outside, usually through its constructor.\nThe question I hear whenever"
url: "https://hashnode.com/posts/what-is-dependency-injection-the-trick-that-makes-code-easy-to-test/6b08d9f2f94974f16c40f868"
---

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

Discussion

# [What Is Dependency Injection? The Trick That Makes Code Easy to Test](https://itsmeminsithu.hashnode.dev/what-is-dependency-injection-the-trick-that-makes-code-easy-to-test?utm_source=hashnode&utm_medium=feed)

To put it simply, dependency injection means a piece of code never builds the things it needs — it receives them, handed in from outside, usually through its constructor. The question I hear whenever

3h ago · 6 min read · itsmeminsithu.hashnode.dev  
Read the article

-   [#dependency-injection](https://hashnode.com/tag/dependency-injection)
-   [#software-design](https://hashnode.com/tag/software-design)
-   [#testing](https://hashnode.com/tag/testing)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Min SiThu](https://hashnode.com/@itsmeminsithu)

@itsmeminsithu · Singapore

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

Software Engineer

Nubbad Developer. | Now I accidentally create problems.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
