Should I Use TDD?

前端 未结 15 1911
孤街浪徒
孤街浪徒 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:49

    Remember this: the only bad test is the one you don't execute.

    Now, do you need to dive directly into TDD? Maybe not. But you should definitely start unit testing whatever you can. You can't unit test GUIs very well, and that's fine -- save those for UAT.

    But any sort of logic you might execute behind the scenes? Yep, you should test it.

    Start by just trying to test individual methods. As you go you'll start running into pain, because most likely your code isn't designed to be tested. This is fine; refactor your code! Keep doing so until you can test your code. Remember what you had to do and do that the first time the next time you write code.

    After a few iterations, you'll learn what you need to learn (really, you can only learn it by doing) and the pain will go away. When that happens, I'd suggest you're probably ready to look into TDD.

提交回复
热议问题