Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 4
    Don't forget about regression tests to cover discovered and fixed bugs to prevent their reintroduction into a system during future maintenance. Commented Apr 6, 2011 at 7:15
  • 6
    I would not insist on the definition even if I agree with it. Some code might have acceptable dependencies like a StringFormatter and it still considered by most a unit test. Commented Sep 25, 2013 at 7:06
  • 6
    danip: clear definitions are important, and I would insist on them. But it's also important to realize that those definitions are a target. They're worth aiming for, but you don't always need a bullseye. Unit tests will often have dependencies on lower-level libraries. Commented Dec 3, 2013 at 13:54
  • 2
    Also it is important to understand the concept of facade tests, that don't test how components fit together (like integration tests) but test a single component in isolation. (ie. an object graph) Commented Sep 24, 2014 at 16:10
  • 2
    its not only about being faster but rather about being extremely tedious or unmanageable, imagine, if you don't do, your execution tree of mocking might be exponentially growing. Imagine you mock 10 dependencies in your unit if you push mocking further let's say 1 of that 10 dependencies is used at many places and it has 20 of its own dependencies, so you have to mock + 20 other dependencies, potentially duplicately at many places. at the final- api point you have to mock - eg database, so that you don't have to reset it and it's faster as you told Commented Oct 6, 2019 at 22:49