0

What would you call a test that is similar to a unit test, except it actually modifies a file, directory, or database data? It is similar to a unit test in that it does test a single method of a single class as opposed to testing an entire feature of a program or a scenario a user would run through. It does not use mocks or stubs like a unit test would.

  • 1
    A problem waiting to reach out and bite you. Tests that change the environment around them tend to be troublesome in the long run, at least in my experience. – Michael Kohne May 11 '16 at 16:12
2

That would be an integration test. N.B. you should be doing very few of these (if you do any at all).

Hint: even if you don't call them integration tests, they're certainly not unit tests.

  • 6
    Unit tests are synthetic. They run in a hermetically sealed, sanitized, clean-room environment. Your system can still fall over even with superb unit tests, because you're only testing components in isolation. Even if you don't call them integration tests, you still need them. While I see his point, the author of that article is spreading FUD with a catchy post title and bad math. – Robert Harvey May 11 '16 at 16:30
  • @RobertHarvey For sure - testing doesn't end with unit tests. However, adding rafts of automated integration tests because of a failure during manual testing is the wrong solution for the wrong problem. Unit tests are cheap - you should be writing as many of them as you can. – Robbie Dee May 11 '16 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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