Agile Zone is brought to you in partnership with:

Ted Neward is the Principal at Neward & Associates, a developer services company. He consults, mentors, writes and speaks worldwide on a variety of subjects, including Java, .NET, XML services, programming languages, and virtual machine/execution engine environments. He resides in the Pacific Northwest. Ted is a DZone MVB and is not an employee of DZone and has posted 50 posts at DZone. You can read more from them at their website. View Full User Profile

Integration testing and unit testing

09.16.2010
| 3429 views |
  • submit to reddit

Also known as, “An exercise in Twitter opinionating”:

Sitting in a meeting, I heard one of the other meeting participants say, “You should do your integration testing before your unit testing in your code.”

Now, I wasn’t (and I’m still not) sure I agree with this or not, and when in doubt, I like to get data points. Twitter to the rescue!

The responses that came back were fascinating, and all over the map:


Mark Freedman MarkFreedman

Why? Disagree, unless I'm missing something => RT @tedneward: OH: "You should do your integration testing before your unit testing."

Kiran Hatti kiranhatti

@tedneward disagree! How could an unstable code (not unit tested)be ready for integration testing

Brad Wilson bradwilson

@tedneward Write acceptance tests, so we're all on the same page, then use TDD to get components in place until acceptance tests pass.

Brad Wilson bradwilson

@tedneward There is value on an agile team for starting with automated acceptance tests, as a stopping function for development effort.

Maxim Zaks iceX33

@tedneward mostly agree integration first helps to focus on feature, not losing in details

Jason Barile JasonBarile

@tedneward Depends on the intent of the integration testing. If it's to find gaps in the feature set, maybe. Otherwise, disagree.

Justin Chase justncase80

@tedneward disagree. The order depends on what you're creating.

Rockford Lhotka RockyLhotka

@tedneward I continually intermix them; can't say I care a lot about the distinction either in most cases

Matt Secoske secos

@tedneward in the sense that you may want to have some of the integration work done before you write the internals, yes.

My next thought was “how do I capture this for further discussion”, so here we go.

Couple of thoughts that occur to me as I read through the responses:

  • Are acceptance tests the same as integration tests?
  • Are either of these at the same level of scope as unit tests?
  • Does it make a difference which order you approach them?

Love to hear your thoughts.

References
Published at DZone with permission of Ted Neward, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Krystian Kaczor replied on Thu, 2010/09/16 - 8:18am

In order to be able to do integration testing you need to have at least two modules/units. So I would say: you build module and do unit testing and when have two modules ready to the point, where can be integrated, you can start with integration testing.
Acceptance test are tests to accept/reject delivery and rather from business point of view or in relation with vendor. Starting from lowest level usually you have: Unit, Integration, System, Acceptance, Alpha, Beta Testing.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.