you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 3 years ago (4 children)

Unit tests are only worthwhile if you refractor code or write the unit tests before writing the code. We started adding unit test for most everything where I work and I think it's far more effort than it's worth. It's not that it catches nothing but it catches so little I don't think it's worth the time spent writing them.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 3 years ago (3 children)

    Code changes that could affect tests happen all the time. It doesn't need to be a specific refactoring of that unit.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 3 years ago (2 children)

    I don't think you understood my point. That's exactly why I think unit tests aren't all that useful. Most code changes require updating the unit tests so unless you change the unit tests first all that's being done is saying, yep this works how I programmed it to work.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 years ago* (last edited 3 years ago) (1 child)

    But if unit tests that other people wrote unexpectedly break, you know that you changed things that you maybe didn't mean to change.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 3 years ago

    Ideally. It's just that more often than not it means you need to update the unit tests. I can still use my fingers to count how many times a unit test has caught a mistake I made, and I've been at my job for 10 years.

    I'm curious if others have a different experience.

  • source
  • parent