your tests should have 100% coverage

  Рет қаралды 5,194

anthonywritescode

anthonywritescode

Күн бұрын

Пікірлер: 17
@shaharepstein
@shaharepstein 2 күн бұрын
It took me a while to realize what this video is about, but then it hit :D Very nice approach to detect dead test code!
@b_0rk
@b_0rk 3 күн бұрын
> codecov is too slow to be useful brother preach, codecov takes like 20 seconds to load a webpage to do the one thing 99% of us actually care about
@Th3K1ngK00p4
@Th3K1ngK00p4 3 күн бұрын
All the solutions I've tried seem to be super slow. coveralls has the same problem in my experience
@TheAulto
@TheAulto 3 күн бұрын
Thanks! Another variation of code not being run is when you loop over an empty result set e.g. you query a test database, and run an assert on each result. But then the test data was updated and now your query returns nothing. So none of the asserts you’d make are run. The test is still technically correct, but is now prone to let the code it tests become incorrect, since it’s not actually checking anything.
@anthonywritescode
@anthonywritescode Күн бұрын
indeed! I was trying to find an example of that in the video but I couldn't find the particular file!
@jtw-r
@jtw-r 3 күн бұрын
0:12 Totally understand but I wonder if a better wording would be “100% branch/statement test coverage” or something like that? Am I conflating that with something different? Great video, my work codebase doesn’t have 100% file coverage (yet) but it seems like a no brainer to at least have 100% coverage on the things it IS testing, so I make sure that bare minimum is met.
@anthonywritescode
@anthonywritescode Күн бұрын
yeah the video is meant to be a tiny bit of wordplay
@daniel-mizsak
@daniel-mizsak Күн бұрын
Nice video! It made me think. Is there an easy way to require a certain percentage of coverage for tests and source code separately? Maybe using tox somehow? And if so would you recommend it?
@anthonywritescode
@anthonywritescode Күн бұрын
yep! you can use `coverage report --include 'tests/**' --fail-under 100`
@NostraDavid2
@NostraDavid2 Күн бұрын
That also means your tox settings can also just have "coverage report", so people can just run that, instead of constantly having to copy settings as well. But that's just my opinion.
@qexat
@qexat 3 күн бұрын
this video covered everything 🥁
@lakshman587
@lakshman587 2 күн бұрын
100% coverage 😅
@Chiny_w_Pigulce
@Chiny_w_Pigulce 3 күн бұрын
Why shouldn't you use ls in shell script?
@mikeebrady
@mikeebrady 3 күн бұрын
Pretty sure it is because the output format of ls is not standardized
@salchowlukas
@salchowlukas 3 күн бұрын
When I use ls in shell scripts pycharm warns me "Use 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow non-alphanumeric filenames."
@anthonywritescode
@anthonywritescode Күн бұрын
the output format is not specified or machine readable (especially with spaces and special characters). `find ... -print0` is typically the way to go
@bozho.dimitrov
@bozho.dimitrov 3 күн бұрын
Amazing video. I was thinking about this the other day -- why would you want to keep around tests that never run :D It is like code dept ** 2
Making Smallest Possible Linux Distro (x64)
27:43
Nir Lichtman
Рет қаралды 19 М.
It's Really Just That Bad
57:49
ThePrimeTime
Рет қаралды 248 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 195 М.
I Hate Nintendo and I’m Buying a Switch 2 IMMEDIATELY
12:05
Linus Tech Tips
Рет қаралды 2,6 МЛН
I made Tetris in C, this is what I learned
15:15
Austin Larsen
Рет қаралды 29 М.
Acceptance Testing Is the FUTURE of Programming
15:58
Continuous Delivery
Рет қаралды 35 М.
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 166 М.
why don't signals work in docker?
12:30
anthonywritescode
Рет қаралды 6 М.
"BEST C++ CODE ever written" // Code Review
27:38
The Cherno
Рет қаралды 96 М.
Have you ever used the "column" command in Linux?
8:24
Veronica Explains
Рет қаралды 134 М.
"Clean" Code, Horrible Performance
22:41
Molly Rocket
Рет қаралды 941 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 792 М.