Open nelsonic opened 9 years ago
@nelsonic awesome analogy +1
Some nice click bait :)
U make a good point but It does raise some questions...
What level of coverage would u suggest aiming for?
Should front end code and backend code have the same level of coverage? What might be the difference.
What can I do to improve the correlation between high coverage and good code/tests?
When should I ignore coverage reports and exclude lines of code?
How you can use tools like Istanbul to write better tests and have a more robust application?
I'm Particularly interested in workflows used here.
How does coverage work with TDD?
You've got to love a bit of click bait! :wink: 100% code coverage is a minimum. Anything less and you are guaranteed to have bugs. What's more less than 100% coverage is a clear indication that tests have been written retrospectively instead of before the code... The best book on TDD I've read was: http://www.amazon.co.uk/Growing-Object-Oriented-Software-Addison-Wesley-Signature-ebook/dp/B002TIOYVW which is all about test-first development. Sadly is very heavily JAVA-focussed...
Istanbul & Blanket are the test-driven-developer's best friend! And I will introduce it in chapter 2 fo sho!
yes, this is a click-bait question... :wink: obviously we can write poor code and still test it and get coverage...
But... we like to think of code coverage in a packaged food analogy: Imagine you are at the "health food store" and you see tasty-sounding words on a new product: "Vegan, Raw, All-Natural Delicious, etc..." however, no ingredients are listed. You ask the store assistant: "can you tell me what is in this...?"
she replies: "oh, just avocado, nuts and a dash of formaldehyde" _Formalda ... WHAT?_ you exclaim as you prepare to leave the store!! Yes, formaldehyde is a naturally occurring organic compound, which has been used by bad companies to extend the shelf life of "food" see: http://en.wikipedia.org/wiki/Formaldehyde#Contaminant_in_food
We (used to!) eat packaged foods all the time and trust the manufacturers to have our health and best interest at heart... but unless we know everything that goes into those products, and the precise process by which they are produced, we have no idea what we are consuming!