---
title: "Discussion on \"7 non-obvious benefits of automated testing\" | Hashnode"
description: "Discussion on \"7 non-obvious benefits of automated testing\". I started exploring the fascinating world of test automation seven years ago. Right from the start, it was clear to me that testing has important benefits. Anywhere I read back then, I found people describing how testing leads to savings in developme..."
url: "https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907"
---

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

Discussion

# [7 non-obvious benefits of automated testing](https://mariocervera.com/non-obvious-benefits-automated-testing?utm_source=hashnode&utm_medium=feed)

I started exploring the fascinating world of test automation seven years ago. Right from the start, it was clear to me that testing has important benefits. Anywhere I read back then, I found people describing how testing leads to savings in developme...

Oct 26, 2020 · 5 min read · mariocervera.com  
Read the article

-   [#software-testing](https://hashnode.com/tag/software-testing)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#design-and-architecture](https://hashnode.com/tag/design-and-architecture)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Mario Cervera](https://hashnode.com/@macerub)

@macerub · Spain

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

Software craftsman. I write about Software Engineering (clean code, design, testing, ...) and also about Algorithms & Data Structures.

## Responses 8

Markdown supported · ⌘↵ to post

[Reza Lavarian](https://hashnode.com/@lavary)

[Mar 1, 2021](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/603d46583478900323500ec0)

> Automated tests play the role of code samples.

I'd like to emphasize this sentence, code samples are super helpful.

It even affects the whole design of a feature. Especially, when developing the API, first, and then the implementation, like how we do in TDD.

Good writing style, by the way. Thanks!

[Mario Cervera](https://hashnode.com/@macerub)

[Mar 1, 2021](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/603d46583478900323500ec0#reply-603d4c7dc3970d02fe0fe0a2)

Thanks Reza! 🙏

Yes, that's an important benefit. When we write tests, we are effectively using our APIs. If the design is bad, our tests will suffer (e.g. they will be less readable). This is one of the ways testing has a strong positive impact on design.

[Darren Finch](https://hashnode.com/@dmf2004)

[Jan 7, 2021](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5ff75564a538d00135152a2c)

This is a terrific article! I like the writing style and the content.

Honestly I need to establish a better unit testing habit. I don't unit test my personal projects often because TDD feels foreign.

Which also leads me to ask, did TDD feel foreign to you at first?

If so, how did you adapt?

[Mario Cervera](https://hashnode.com/@macerub)

[Jan 7, 2021](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5ff75564a538d00135152a2c#reply-5ff79710a538d00135152cb0)

Thanks for your kind words Darren! 🙏

Be careful with TDD. Let me explain. It is a hard practice to master. You need to be good at testing, design, and refactoring, among other things, so it's definitely not the first thing you want to learn when you are inexperienced.

I'd say that you should develop the habit of writing automated tests first, and, eventually, you can try the TDD process, to see if it's a good fit for you.

That's more or less what I did. I didn't try TDD until I was confident with my design and testing skills.

I hope this helps!

[Fortune](https://hashnode.com/@ofuochi)

[Oct 29, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9ac05ba1658252d1a7b762)

I have a few questions?

1.  Is there such a thing as "over testing"?
    
2.  What is the industry benchmark for percentage coverage?
    

[Mario Cervera](https://hashnode.com/@macerub)

[Oct 29, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9ac05ba1658252d1a7b762#reply-5f9ae0cda1658252d1a7b974)

1.  Yes, there's such a thing. Your time is not infinite, so you cannot possibly test everything or automate everything. You want to automate tests that prove different things, so that they are more useful. For example, to test a "multiply" function, it is probably better to use as test inputs (3,0), (7, 16), (-2,8), and (1242362234, 35674563), which prove different things, than using (1, 1), (2,2), (3,3), and (4,4), which leave some corner cases untested.
    
2.  No, there is no benchmark. The ideal is 100%, but it is unattainable, and, at the same time, anything less than 100% can be considered bad (because you want a 100% of your app to work, right?). My opinion is that you have to use code coverage as a "motivation metric". That is, always try to improve it, knowing that you won't reach 100%, but the higher the better.
    

[Fortune](https://hashnode.com/@ofuochi)

[Oct 30, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9ac05ba1658252d1a7b762#reply-5f9bcfb31502575c97127491)

[Mario Cervera](https://hashnode.com/@macerub) Thanks for your reply

[Matt Moll](https://hashnode.com/@MattCodeJourney)

[Oct 27, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f98240c91c85e2865f5f1f1)

Amazing as always Mario! Looking forward to a nice post about clean code and more examples about testing!

Thanks for sharing!

[Mario Cervera](https://hashnode.com/@macerub)

[Oct 27, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f98240c91c85e2865f5f1f1#reply-5f9827d691c85e2865f5f2d2)

Thanks Matt! Those posts that you mention will come, eventually 😉

[Maxi Contieri](https://hashnode.com/@mcsee)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f973d3f2bf23e191c91f366)

Amazing as usual, Mario !

[Mario Cervera](https://hashnode.com/@macerub)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f973d3f2bf23e191c91f366#reply-5f973dc42bf23e191c91f372)

Thanks Maxi! I really appreciate it! Getting such positive feedback, no doubt that I will write more articles soon 😉

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

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f971a6151a0b8178f87459f)

Nice Article [Mario Cervera](https://hashnode.com/@macerub). Enjoyed reading every point you have mentioned

Very Clear & concise points👍

[Mario Cervera](https://hashnode.com/@macerub)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f971a6151a0b8178f87459f#reply-5f9724022bf23e191c91f26a)

Thanks Apoorv! Glad to hear that you liked it! This kind of feedback encourages me to write more posts in the future 😊

[Jov Mit](https://hashnode.com/@jovmit)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9711af40b501154237d74f)

That's an awesome article, I have to admit that I loved it a lot.

Really nice writing style, easy to read and understand. No complex sentences and very good arguments. It would be of a great benefits for the community around you if you keep posting such good content with this writing style.

Little remark about the following:

> through the use of test doubles, also known as mocks

I talk about that in my last weekly video on youtube 👇, and basically there is some history of why the term `Mocks` is used in generic context to refer to all `Test-Doubles`, but the actual `mock` is a kind of test-double just like the `stub`, `dummy`, `spy` and `fake`.

Would be interesting to see your opinions on that especially after watching the video: [youtu.be/YQ9qlcq6Yyg](https://youtu.be/YQ9qlcq6Yyg)

[Mario Cervera](https://hashnode.com/@macerub)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9711af40b501154237d74f#reply-5f97254ab4e415193fa1ce6a)

Thanks Jovche for the feedback!

I am aware of the different types of test doubles. I typically use the terminology that is presented in the "xUnit Test Patterns" book. But, in this article, I used the term "mock" because it's well-known by many people, despite the fact that, as you rightly suggest, it is just yet another type of test double.

You can expect my feedback on your video soon 😉

[Jov Mit](https://hashnode.com/@jovmit)

[Oct 26, 2020](https://hashnode.com/posts/non-obvious-benefits-automated-testing/5f96f5ed9ffb2210b6964907/comment/5f9711af40b501154237d74f#reply-5f9729efb4e415193fa1cec6)

It's lovely to see we are on the same page :) Indeed the term is widely used and know in the community 💯👌
