DbC (design by contract) and unit tests

I use contracts with C # 4.0 and before I used a lot of unit tests (not with TDD). I am wondering if DbC removes the need to write external unit tests?

Personally, I find contracts better for creating reliable frameworks, because contracts are closely related to the code itself and offer other benefits.

What do you guys think?

+3
source share
3 answers

, "" .

, , PoC , . ( Eiffel, Bertrand Meyers, PoC, .)

, " ", . , PoC .

0

, DbC , .

Using DbC will be effective for things like checking I / O methods, and this can save you some time.
But for more complex tests (for example, dependency on mocking) this will be easier with external unit tests .

Therefore, I do not think that you can eliminate all the requirements for testing an external block using them.

0
source

Source: https://habr.com/ru/post/1702441/


All Articles