I have a 3-tiered .NET solution.

  1. Database (SQL SERVER 2008)
  2. Web Service (SOAP Service - *.asmx)
  3. WPF Client

I am comfortably writing Unit Tests within (3) The Client.
I am currently working on writing tests between (1)Database & (2)Service.

My question is, what are some useful ways to run integration tests across all 3 tiers. I would like this to run locally in my Test Runner, as well as part of the integration test.

Primarily, I am stuck on how to have a transient (setup-teardown-able) (2) Web Service & (1) Database that can be tested with (3) Client code as part of a full integration test.


1 Answer 1


Depending on your tooling this can be quite easy, but not very 'textbook'.

We use:

  • VS
  • Microsoft Test Manager
  • SCVMM + Lab Management features of MTM

In our case (I'm an SDET in QA), our application takes roughly 30 minutes to install, and we have a similar architecture (DB, App Tier, Presentation Tier - web and applications). Because a whole install/config would be intractable for testing, we have an installation/configuration test suite which is essentially OrderedUnitTests that will spin up a VM, confirm pre-reqs, install the product and configure everything.

From there we have the test suites. Some are targeted at the app tier (services) where it's a normal "unit test" (VS parlance, actual unit tests are part of the build and doesn't even go to QA unless they pass) that creates does whatever setup is necessay, calls the service(s) and asserts results - cleaning the DB changes in teardown as usual.

For the Presentation Tier we have webtests that will run or codedui tests that will start whatever app or site is under test, perform the actions, assert the results and then close everything back down to the desktop.

It's pretty straight-forward and works well.

  • +1 for using VMs. They are a god-send for integration testing, especially (and super useful for backwards compatibility and regression tests, too) Sep 14, 2011 at 23:20
  • @blueberryfields: Absolutely. It's almost criminal, at this point, to not use VMs for integration, acceptance and functional tests. MTM + SCVMM (once some kinks are worked out) is really a home run because of the automation element that it can have as well. There's almost no test that can't be automated with this configuration. Sep 14, 2011 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.