How to start unit testing or TDD?

后端 未结 14 1874
离开以前
离开以前 2020-12-04 07:18

I read a lot of posts that convinced me I should start writing unit test, I also started to use dependency injection (Unity) for the sake of easier mocking, but I\'m still n

14条回答
  •  余生分开走
    2020-12-04 07:24

    I prefer KentBeck's approach which is nicely explained in the book, Test Driven Development by Example - Kent Beck.

    from your question i can infer you are not sure with the test frame work - choosing the correct test frame work is very important for TDD or writing unit tests(in general).

    Only practical problem with TDD is "Refactoring"(we need to refactor test code as well) takes lot of time.

提交回复
热议问题