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.
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?
I have a few questions?
Is there such a thing as "over testing"?
What is the industry benchmark for percentage coverage?
Amazing as always Mario! Looking forward to a nice post about clean code and more examples about testing!
Thanks for sharing!
Nice Article Mario Cervera. Enjoyed reading every point you have mentioned
Very Clear & concise pointsπ
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
Jov Mit
Programmer | XP | Software Craftsmanship
Reza Lavarian
Software Developer
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!