Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the excellent, i saw recommendation to keep logic out of unit tests. Does this hold true for functional/integration tests?

share|improve this question

I don't believe so. Unit tests are supposed to focus on what 1 method does, mocking anything that method needs. Integration tests don't mock anything, everything should be as if in production. In this case, you may need logic in order to test the fully integrated system.

However, it boils down to definition. For instance, I wouldn't say functional/integration, as if they were tied together. Unit tests are also functional.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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