Should I Use TDD?

前端 未结 15 1856
孤街浪徒
孤街浪徒 2020-12-12 19:34

I\'m the only developer in my (very small) company and I\'m about to start on a medium sized ASP.NET web application for said company.

I\'m trying to figure out if

15条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 19:52

    If done pragmatically it can be a huge benefit. The argument against it always seems to be that it takes too much time but as we all know if many cases knowingly sacrificing quality can be even more detrimental.

    It's been 3 years since I learned TDD and I can honestly say that I've seen it bring huge value and I've also seen it be a complete waste of time.

    Here is an example of each...

    Beneficial: Working on a solution that was fairly complex, had many dependencies and variations and was constantly evolving. Designing with testing in mind and have a regression suite of unit tests allowed us to adapt to change quickly and be able to refactor code for increased maintainability. We used the 80/20 rule when creating unit tests and left out low value test cases.

    Not Beneficial: It was (dogmatically) decided we must have an automated test for every test case QA could think of, even UI cases. Many cases were so rudimentary and involved very little, very simple code. Getting many of these to work required vast amounts of setup and increased the amount of tests to maintain so much it was slowing us down significantly.

提交回复
热议问题