• nibblebit@programming.dev
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    3
    ·
    edit-2
    1 year ago

    All you folks are crazy not to unit test personal projects. Unit tests don’t need to be fancy and exhaustive. A sanity check and having a simple way to execute isolated code is well worth the 15 minutes of setting it up. Heck, just use them as scratch files to try out libraries and APIs. I can’t imagine having the kind of time to raw-dog that f12 button and sifting through print() nonsense all night.

    • relevants@feddit.de
      link
      fedilink
      English
      arrow-up
      10
      ·
      1 year ago

      I think it also very much depends on your tooling & how easy it feels to start writing unit tests.

      When I work in a Java project for example I always write unit tests even for personal stuff, because the IDE integration is great and it’s really quick to create a test class, run it and see granular results. I don’t feel the same way about testing JavaScript because the tooling at least for me hasn’t worked quite as well (though that could very well be my own fault, it’s been a while since I looked into it). The more cumbersome setting up and running the tests is, the more tempting it becomes to just use the console or manually test parts instead.

    • deaf_fish@lemm.ee
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      If I ever want to take a break from my personal project and come back to it. Unit tests are necessary. If I try to continue working on a project that doesn’t have unit tests. I feel like every bit of code I touch is introducing countless hours of debugging. It really demoralizes me.