• GrapheneOSRuinedMyPixel@sh.itjust.worksOP
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 days ago

    serious question: is TDD, like, good? I’m not a professional software engineer or anything (though I recently learned that I’m somehow in the corporate DevSecOps group, ha) but I never got any good results from literally doing the bare minimum to make the thing work and trying to expand it later. I normally spend some time drafting the architecture first, that is how stuff should be structured, how it all connects and what overall total complexity will be. Each time I tried TDD it always bogged down to me and the team refactoring codebase and the tests so new findings can be incorporated up to the point where everyone is like ‘stop. we need to sit down and think about this carefully’. Maybe we did it wrong though.

    • mortalic@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      TDD gives new code and new devs working on the code base a safety net. Yes. You should always use TDD. Imagine writing a test that says, deploy button. Is button gray.

      It returns false. Because the code doesn’t even exist yet.

      You write the code that shows a button. You set the button color to gray. The test now passes.

      Now expand that to every piece of code your team writes, require them all to pass before a PR can merge a branch and you’ve got a massive safety net.