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 790793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:44:07+00:00 2026-05-14T21:44:07+00:00

I used TDD as a development style on some projects in the past two

  • 0

I used TDD as a development style on some projects in the past two years, but I always get stuck on the same point: how can I test the integration of the various parts of my program?

What I am currently doing is writing a testcase per class (this is my rule of thumb: a “unit” is a class, and each class has one or more testcases). I try to resolve dependencies by using mocks and stubs and this works really well as each class can be tested independently. After some coding, all important classes are tested. I then “wire” them together using an IoC container. And here I am stuck: How to test if the wiring was successfull and the objects interact the way I want?

An example: Think of a web application. There is a controller class which takes an array of ids, uses a repository to fetch the records based on these ids and then iterates over the records and writes them as a string to an outfile.

To make it simple, there would be three classes: Controller, Repository, OutfileWriter. Each of them is tested in isolation.

What I would do in order to test the “real” application: making the http request (either manually or automated) with some ids from the database and then look in the filesystem if the file was written. Of course this process could be automated, but still: doesn´t that duplicate the test-logic? Is this what is called an “integration test”? In a book i recently read about Unit Testing it seemed to me that integration testing was more of an anti-pattern?

  • 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-05-14T21:44:07+00:00Added an answer on May 14, 2026 at 9:44 pm

    What you describe is indeed integration testing (more or less). And no, it is not an antipattern, but a necessary part of the sw development lifecycle.

    Any reasonably complicated program is more than the sum of its parts. So however well you unit test it, you still have not much clue about whether the whole system is going to work as expected.

    There are several aspects of why it is so:

    • unit tests are performed in an isolated environment, so they can’t say anything about how the parts of the program are working together in real life
    • the “unit tester hat” easily limits one’s view, so there are whole classes of factors which the developers simply don’t recognize as something that needs to be tested*
    • even if they do, there are things which can’t be reasonably tested in unit tests – e.g. how do you test whether your app server survives under high load, or if the DB connection goes down in the middle of a request?

    * One example I just read from Luke Hohmann’s book Beyond Software Architecture: in an app which applied strong antipiracy defense by creating and maintaining a “snapshot” of the IDs of HW components in the actual machine, the developers had the code very well covered with unit tests. Then QA managed to crash the app in 10 minutes by trying it out on a machine without a network card. As it turned out, since the developers were working on Macs, they took it for granted that the machine has a network card whose MAC address can be incorporated into the snapshot…

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

Sidebar

Related Questions

Recently, I have worked in a project were TDD (Test Driven Development) was used.
Test Driven Development (TDD) and its benefits are well defined. The same can be
Why doesnt TestDriven.Net work with my gallio/mbunit tests? I've used TDD.Net with MbUnit v2
We used the undocumented xp_fileexist stored procedure for years in SQL Server 2000 and
I used the LINQ to SQL designer in Visual Studio to create an object
Never used a cache like this before. The problem is that I want to
I used to work in a place where a common practice was to use
I used jQuery to set hover callbacks for elements on my page. I'm now
When used like this: import static com.showboy.Myclass; public class Anotherclass{} what's the difference between
We used to use SourceSafe, and one thing I liked about it was that

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.