Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:14:56+00:00 2026-06-16T04:14:56+00:00

How to apply TDD over enterprise application that has layered architecture? I want to

  • 0

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

  1. WPF application (6-7 screens)
  2. 3-4 Modules (Prism modules)
  3. Some application services (Logging, Exception Handling, Security, Authorization, Core Business services library)
  4. Data Access Layer (using Entity Framework)
  5. 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

  1. Identify all use cases
  2. Identify all test cases
  3. 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
  4. Follow Red-Green-Refactor until all the test cases (corresponding to all scenario) are passed
  5. In the refactoring, dont forget DRY, YAGNI, Mocking, DI, etc,etc.
  6. 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

  1. Is there some basics that I am missing? Please point me to appropriate resources if yes.
  2. How to apply TDD over layered architecture?
  3. How to do parallel development of multiple components
  4. Best practices for TDD with WPF UI (PRISM)
  5. Best practices for TDD with Database (using Entity Framework)
  6. How to decide WCF service contract, when using TDD?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:14:58+00:00Added an answer on June 16, 2026 at 4:14 am

    I think you have the order wrong. You’re choosing the architecture, then trying to get there with TDD. The idea behind TDD is to start w/ nothing, and arrive at an layered architecture if it’s needed.

    Of course, that probably doesn’t help when you’re looking at a very large project, because there has to be some organization to it all. My usual approach is to try to divide the work into something that makes sense to real people (not programmers). And no, I’m not really talking full Domain Driven Design. I’m referring to just thinking of the different pieces as an outsider would.

    For example, if I want to make a program that represents a cash register (something that can hold money and figure totals).

    What’s the first thing I want it to do? Hold and dispense money. So, I need a drawer (first component, give it to a team). I need a button to open it (second component, second team), etc… The key is to focus on what it should do, not how it should do it.

    Yes, there’s a lot of contract/protocol talks that have to happen. Those are things the teams involved will have to work out as they hit the problem. The key is to focus on what you want it to do. Solve the now problem. Don’t pre-optimize. You’ll probably find that not all of the components require all of the layers.

    The short answer to the best practices questions is “it depends.” (The cheesy, common, and overused IT answer.) The general rules are you want to focus on behavior, not implementation. Ensure you can trust the tests (they produces the correct results all the time). Make sure you test as much as is possible… Or, numbered…

    1. Start with tests, not design. Roy Osherove and others have a tons of writings on the subject. His book, along w/ Micheal Feathers are the best place to start.
    2. If you start w/ tests, and the layers evolve as you fulfill more tests, you wind up with TDD over a layered architecture.
    3. Divide them in a way that makes sense. My rule is to stick to what makes sense in the real world. Engine team gets the engine, tire team gets the tire. Make sure people communicate.
    4. I don’t use PRISM.
    5. I don’t use EF, but can say that database testing is a whole can of worms. Integration testing involves a lot of environmental configuration and such. Ayende has quite a few blog posts on this.
    6. Danger Will Robinson. What makes you so sure you need a WCF service contract?

    Sorry if this was really vague. Google the names I dropped, they’re good places to start. If you want a leg up on TDD, hire a couple experienced coders and use pair programming. If you can’t afford that, hire someone to come in and do some training, then do pair programming. Can’t do that? Get some books and use pair programming.

    Then, beat the pairs to ensure they’re writing tests first.

    At the end of the day, it’s about deciding what you want something to do, then letting the tests evolve the architecture. Not the other way around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The apply documentation mentions that Where 'X' has named dimnames, it can be a
if apply Async Targeting Pack for Microsoft Visual Studio 2012, want to know if
I want to apply texture to the transparent png(bitmap), but I don't want to
i'm trying to apply the MVVM pattern in my application with MVVM Light. I've
I want to apply scaling animation to UIButton.When user drag button upside of the
I am trying to apply TDD for the first time with a Form for
I apply a filter to Dataview and after that I need to get the
Attempting to apply .hover to a class that shows a div based on a
I'm relatively new to TDD, and still trying to learn to apply some of
To apply left to right scale toa button i have used the following code.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.