Ted Zhang

关于Sharepoint及.NET的种种...
Test Driven Development

Recently, I start realize the benefits of TDD, it really could give me a chance to think about how others people gonna use my API, how should I design it.

So normally, Create a falling test case first(Simulate how user will use the API), then start implement the method to make the test case pass(keep things as simple as possible), after that, refactor the method, improve the internal implementation without changing the external behavior.

Principle:

  • One logical assertion per test.
  • Keep test code maintainable and Don’t repeat yourself.
  • Test could be independent, could run in any order.
Assembly Unit Test Assembly
Namespace Namespace_Test Folder
Class Class_Test Folder
Behavior… Test Class…

posted on 2013-06-04 15:30  Ted Zhang  阅读(149)  评论(0编辑  收藏  举报