# Automated Tests Help Developers Sleep Better

DevFeed: [Automated Tests Help Developers Sleep Better](<https://devfeed.tech/articles/automated-tests-help-developers-sleep-better-24959.md>)

Original publisher: [Read original article](<https://codeahoy.com/2016/11/12/automated-tests-help-developers-sleep-better/>)

Author: umer

Published: 2016-11-12T00:00:00Z

Content type: article

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [automated](<https://devfeed.tech/tags/automated.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [developers](<https://devfeed.tech/tags/developers.md>), [integration](<https://devfeed.tech/tags/integration.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

## AI overview

The article argues that automated tests help developers catch bugs before release and reduce the burden of diagnosing production problems. It cautions that arbitrary code-coverage requirements can produce ineffective tests and recommends combining unit, integration, and other testing techniques.

## Source excerpt

In Pragmatic Programmer, Andy and Dave wrote: Most developers hate testing. They tend to test gently, subconsciously knowing where the code will break and avoiding the weak spots. Pragmatic Programmers are different. We are driven to find our bugs now, so we don't have to endure the shame of others finding our bugs later. There hasn't been any shortage of literature on the benefits of automated testing in the last 10-15 years. Yet it comes as a surprise to me that most developers still don't like to write unit tests. Some managers force developers to write tests by making an arbitrary code coverage number mandatory for releases. This is dangerous because the result is often low quality and ineffective tests that do not catch the bugs that they were supposed to. But why do some developers dislike testing? One possible explanation is that they don't buy the idea. Software developers are very smart people and they cannot be coerced into accepting an idea just because management thinks its great. In their defense, the management often fails to coach or convey the idea that automated tests benefit developers the most: they are written by the developers, for the developers themselves. They help developers sleep better at night. Automated tests are very good at catching bugs before the code is released - not all the bugs, but most of them. Software developers, whether on-call or not, are on the hook for any bugs in their code. When there's a bug that affects millions of users, it's the developers who have to get out of their beds at 2am or stay late evenings to provide a fix. Not to mention the embarrassment of introducing a bug that irritated thousands/millions of users or resulted in lost revenue. It takes a long time to find the root cause just because at the time, a developer failed to take a break from implementing the functionality to think about all the ways it could break and write good tests to ensure that the bug was caught before production release. Developers m