116

"Unit tests are a waste of time, and we should avoid doing that if possible. "

Kill me please.

Comments
  • 2
    😂😂😂 please tell me that came from the boss and not from the pm...
  • 14
    Unit tests are not a waste of time, WRITING unit tests, however, is
  • 2
    Well, do functional programming then, I think. 🤔
  • 5
    Same guy in implementation: "why the hell didn't this get caught? There should have been more testing."
  • 5
    Unit tests are a waste of time on small teams and on most everyday projects.
    Most projects dont have consistent specs, so everytime the pm/boss/client comes up with something new you have to rewrite the app and the unit tests.
  • 1
    The only real use I've gotten out of unit tests is verifying algorithms. I once wrote a search engine which did some analysis on the input first. I wrote tests for over 20 use cases of this analysis and wrote code until they all passed.

    For everything else I write functional tests, or end-to-end tests as some people call it, using selenium or calling an api endpoint with a proper request.
  • 0
    @sharktits how do you get them if not writing?
  • 0
    @sSam yeah exactly, thats the root of the problem. 99% of unit tests could and should be generated, yet we have no such program yet.
  • 0
    @sharktits how would you go about generating them? Could you show an example?
  • 0
    @sSam its not that hard to reflect on methods and try them with, say, "", " asd", null, if they take a string.
  • 0
    @sharktits yeah, but how is the generator supposed to know what should be the output of the method or what is it supposed to do?
  • 0
    @sSam i mean, null checks and exceptions checks, but it shouldnt be too hard to check output either
  • 0
    @sharktits and how it would know what kind of exception when should occur? Maybe nulls are valid arguments for that method, maybe they're not, how would generator know?
  • 2
    Something to think about, if you happen to disregard unit/integration tests

    http://blog.codepipes.com/testing/...
  • 0
    Unit tests are a waste of time (sometimes).

    I’ve seen (and been the perpetrator of) both extremes.

    I like living here in the middle now.

    Enough coverage that I know if I’ve done something silly.

    Not so much that if I decide to fix something silly I don’t have to budget a Millenia to redo the tests.
  • 1
    @Brolls That's the exact reason I don't like BD testing
  • 0
    Yes i don't particularly enjoy writing unit tests either! Instead i started working on building someting that will automatically do sanity check validation on the most common models. Once completed it should just just work for 80% of the backend functionally.
Add Comment