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.

3
  • But this is impossible to do as an unit test. Unit test tests small units, one particular test subject. The only thing you should mock there are direct dependencies to isolate the unit under test from other stuff. As I mentioned before - X is somewhere deep in the project, and the server (framework stuff) is somewhere at the entry-level. You'd certainly not want to mock the whole way down to X. This is why I use integration tests - which mostly use the real code on it's path to test if the system integrates well. I'm not sure if you got my point :) Commented Aug 26, 2018 at 12:19
  • @sarneeh: In a larger system, you may want to test larger portions of the system in isolation from the rest, which is why I mentioned component tests alongside unit tests. A component would be the result of integrating several units (but not all of them). Note that a component test (that verifies that a component by itself works correctly) is different from an integration test (which verifies that different units or components work correctly together). Commented Aug 26, 2018 at 17:37
  • I guess I'd have to see some examples because it's hard to me to understand the differences and how does it look like in practice. Do you know any resources on this topic that could help me a little bit to pick it up more easily? Commented Aug 26, 2018 at 23:07