DEV Community

Discussion on: You don't know TDD

Collapse
 
stormingorman profile image
Brian Gorman

Tight coupling results from not using pure interfaces for everything... All parameters and return values should be pure interface types .. that way, all dependencies can be passed in as Fakes or Stubs .. resist the temptation to call constructors in methods.

  1. All parameter and return types are pure interfaces
  2. Try to only call constructors inside of other constructors. Only call contractors in member methods if there is no other way ..
Collapse
 
anortef profile image
Adrián Norte

That prevents coupling on an implementation level but not at a logical level. With TDD you can prevent both.