How to apply TDD over enterprise application that has layered architecture?
I want to know how to apply TDD to an application that has following
- WPF application (6-7 screens)
- 3-4 Modules (Prism modules)
- Some application services (Logging, Exception Handling, Security, Authorization, Core Business services library)
- Data Access Layer (using Entity Framework)
- A bunch of WCF services
As I understand, first thing is to get the architecture right. As a result, Components are identified. Next is to develop the components independently, where I stuck.
With TDD, design (of a component) evolves with time. For a component following is the way (I perceive) to go with TDD
- Identify all use cases
- Identify all test cases
- For each test case, write all scenario, and for each scenario, write a failing test case. Make little code, so that test case is passed. Add to list, if new scenario is found
- Follow Red-Green-Refactor until all the test cases (corresponding to all scenario) are passed
- In the refactoring, dont forget DRY, YAGNI, Mocking, DI, etc,etc.
- End result is well designed Component (how much well designed depends on experience and skills of developer).
Problem i face is, For a component, until i reach to Step 6 of TDD process, i donot know the interfaces. Since there are multiple components, multiple teams, No body is sure what they will come up with.
Now the summary Questions based on above scenario
- Is there some basics that I am missing? Please point me to appropriate resources if yes.
- How to apply TDD over layered architecture?
- How to do parallel development of multiple components
- Best practices for TDD with WPF UI (PRISM)
- Best practices for TDD with Database (using Entity Framework)
- How to decide WCF service contract, when using TDD?