# Unit Testing Best Practices

DevFeed: [Unit Testing Best Practices](<https://devfeed.tech/articles/unit-testing-best-practices-38633.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_03_19_unit_testing_best_practices/>)

Published: 2020-03-19T00:00:00Z

Content type: opinion

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Development](<https://devfeed.tech/topics/development.md>), [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code review](<https://devfeed.tech/topics/code-review.md>), [ci](<https://devfeed.tech/topics/ci.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [code-review](<https://devfeed.tech/tags/code-review.md>), [development](<https://devfeed.tech/tags/development.md>), [quality](<https://devfeed.tech/tags/quality.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

## AI overview

An opinionated set of best practices for writing unit tests that are trustworthy, readable, maintainable, isolated, and focused on a single use case. The article also explains how tests support requirements validation, defect detection, safer refactoring, architecture, code review, and automated execution on CI.

## Source excerpt

Source Disclaimer: This is a set of things I consider very useful when writing unit tests. I call them best practices because they allow me to write good, quality tests that are easier to read, more maintainable, and better describe business needs. These points might be subjective, you might have other opinions or have more items. That's fine. Do not hesitate to put your opinions in the comments. Tests in the Development Process Tests are very important in the development process. They give you a lot of benefits: