Why is design-by-contract not so popular compared to test-driven development?

前端 未结 9 1157
傲寒
傲寒 2020-12-12 21:00

You may think this question is like this question asked on StackOverflow earlier. But I am trying to look at things differently.

In TDD, we write tests that include

9条回答
  •  离开以前
    2020-12-12 21:18

    I've used both in the past and found DBC-style less "intrusive". The driver for DBC may be regular application running. For Unit Tests you have to take care of setup because you expect (validate) some responses. For DBC you don't have to. Rules are written in data-independent manner, so no need to setup and mocking around.

    More on my experiences with DBC/Python: http://blog.aplikacja.info/2012/04/classic-testing-vs-design-by-contract/

提交回复
热议问题