Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hazarth95032y@RemusWasTaken Kiki is a strong believer that unit tests are useless and shouldn't be written *at all* ever.
So I guess a "unit test appologist" is a normal developer that doesn't hate unit tests and sees their value. -
@Hazarth Interesting take.
I think unit tests are pretty vital when you work on huge products with many components and micro-services.
Maybe with smaller stuff you can test a random component's properties by spinning up every other component (or a mock) as well. -
Hazarth95032y@RemusWasTaken that's what I think! Hell, I think even the extreme of Tests, TDD, works great in some projects, even smaller personal ones.
I have a great example from my recent project. I was trying to write a tiny expression parser/interpreter in python. Having a set of tests of math and boolean expressions written ahead of time saved me the headache of breaking several things, several times down the line. I was super happy I can rely on my tests throughout the entire project. -
Hazarth95032y@RemusWasTaken good question, might write some code to tests it automatically. Maybe Integration tests or e2e tests on some large examples. That would somewhat lose the granularity that unit tests have but it *might* work?
@Kiki how would you test an expression parser/interpreter without unit tests? Or you just wouldn't? -
@Hazarth Not entirely true.
Strong disbelieve in writing *pointless* unit tests.
... I dunno which rant it was, but I think Kiki and I had agreed on: Testing the obnoxious rather than the obvious.
This goes especially against the percentage cult where people add retarded tests to achieve a percentage of LOC / ... of tests, thus the focus lies not on quality of tests, rather quantity of tests.
Which is a big big big problem.
E.g. technical debt, which accumulates when you add meaningless code to fulfill e.g. a percentage, where the percentage itself is useless and meaningless. -
Hazarth95032y@IntrusionCM how do you explain the term "unit test apologist" then? does that sound like a term made by someone who has anything good to say about unit tests at all, even the good ones?
-
@Hazarth Well.
When you take the term pretty literal,
an apologist is an zealous defender.
Zealotry can be good or bad.
Focus less on the word itself, rather the possible interpretations.
For someone to have faith in sth, so to speak a true believer in unit testing, I won't expect them to take any insult serious... After all, what's your faith worth when a single joke can turn your faith into disbelieve? -
Hazarth95032y@IntrusionCM hey, if that's the case then cool beans. I don't think I've ever seen OP comment or say anything good about unit tests myself but if you say such a comment exist I guess I'll take it into consideration.
-
I would note there are many times after learning what they were that I wished I'd written them
-
One thing to think about with unit tests is: am I protecting the functionality that is core to the concept of this code or am I just protecting what this code does now? If it's the latter you're basically writing the same code twice and (if you enforce unit tests passing, as most do) any legitimate changes with break your app.
💎🙌
joke/meme