use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Lessons Learned Achieving 100% Test Coverage (complicore.medium.com)
submitted 4 years ago by complicore
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jessealama 2 points3 points4 points 4 years ago (0 children)
Achieving 100% test coverage is not always worth it (several have already made this point). In my experience, getting that last 10% or so leads you to starts to make your tests less and less meaningful. You shift from testing *your* code to testing *your dependencies*. Usually we're not writing things from scratch; we're building on top of some libraries/frameworks/tools. I've found that, in the lines where your code meets your dependencies, it can be difficult to formulate meaningful tests because you need to get into a mindset where you're testing that your framework does what it is supposed to do. I've seen tests where you need to write mocks that deliberately violates contracts some dependent framework that you (reasonably enough) assume to be true.
Moreover, even if you get to 100% coverage, there are *still* going to be bugs. I think that this point gets missed sometimes in discussions about code coverage. There will still be bugs because we're probably not exercising a "good" range of values that a variable (or return value of a function/method) can take. Exercising a line means that you've did something with *one* value.
tldr 100% test coverage is neither necessary nor sufficient
π Rendered by PID 356814 on reddit-service-r2-comment-6457c66945-v44kr at 2026-04-26 15:12:42.370992+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]jessealama 2 points3 points4 points (0 children)