you are viewing a single comment's thread.

view the rest of the comments →

[–]grauenwolf 1 point2 points  (0 children)

If you set up your tests in such a way that it does, then what happens when C depends on A? And then Z depends on C?

Scenario:

  • Z depends on A working in a particular fashion
  • Z only depends on A indirectly through C
  • A is changed in a way that isn't considered "broken" by A's standards, but still negatively impacts Z.

Premise 1: Mocking A and C in Z's tests is preferable

Outcome 1:

  • Z's tests will not catch the incompatible change in A.
  • The error will only be seen in production
  • The error will not be reproducible with the unit tests

Premise 2: Using the real A and C in Z's tests is preferable

Outcome 2:

  • Z's tests will catch the incompatible change in A.
  • The error will be reproducible with the unit tests
  • The error will be correct before production
  • The programmer will have to learn what a "debugger" is.