7
kiki
2y

💎🙌

Comments
  • 3
    ... What are unit test apologists?
  • 4
    Ok. I am confused.
  • 4
    ...and everyone else?
  • 10
    @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.
  • 1
    @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.
  • 2
    @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.
  • 0
    @Hazarth Yeah, this is a good example. How would @kiki test this without unit tests? Maybe manual tests after every iteration?
  • 2
    @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?
  • 1
  • 6
    @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.
  • 2
    @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?
  • 1
    @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?
  • 2
    @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.
  • 0
  • 0
    I would note there are many times after learning what they were that I wished I'd written them
  • 1
    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.
Add Comment