• thenextguy@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    3 days ago

    I’m not a tdd guy, but I would reach for tests first. You don’t know the code yet. Testing is the only way to stay sane. And writing the tests if they don’t exist yet will help you learn the code.

    • kibiz0r@midwest.social
      link
      fedilink
      English
      arrow-up
      7
      ·
      3 days ago

      Yes, but you do need to be careful with what level you test at. Too high level and the tests may be slow, flaky, and difficult to focus onto small details. Too low level and they may just bake-in the existing implementation.

      • thenextguy@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        3 days ago

        That was such a huge problem on my last job. Most of the unit tests just executed the code and didn’t really test anything and any time you changed the implementation everything broke.

        Thankfully it was truly my last job. 😊

    • dandi8@fedia.io
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      I think this is compatible with TDD. It’s just fancy divide-and-conquer.