unit testing - Does TDD include integration tests? -


i'm working on code includes database access. test-driven development include integration tests usual unit tests?

thanks!

golden rule of tdd says: never write new functionality without failing test.

if not following rule, doing tdd partially (like writing unit tests several classes in application). that's better nothing (at least know these classes required, cannot sure other parts of application working , these classes can integrated them), not guarantees application works expected. so, need start each feature writing failing acceptance test, guides application design , defines application behavior (outer loop). while test failing, feature not implemented application. should write unit tests separate units involved feature (inner loop). outer loop verifies classes involved feature working expected. inner loop verifies each class works expected on own.

following picture great book growing object-oriented software, guided tests demonstrates these 2 feedback loops in tdd:

tdd

and answer question yes - tdd includes integration tests. that's way not break golden rule of tdd.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -