[TIP] Interface vs Implementation Testing

Titus Brown titus at caltech.edu
Sat Apr 21 15:43:42 PDT 2007

On Tue, Apr 17, 2007 at 01:19:06PM -0500, Kumar McMillan wrote:
-> I'm with Michal in that the interface test ensures that your
-> implementation works (as long as you write the interface test well).
-> Here is a major problem with testing implementation: when the
-> implementation changes your tests will break.  Broken tests should
-> indicate the failure of a component, but in this case it would not.
-> You might even say to someone else on your team: "The tests are broken
-> but it still works, pay not attention."  In fact, you may even hold
-> off on updating your tests until you "get around to it" since you
-> kinda know things still work.  You see where I'm going with that.  I
-> tell developers on my team to **only** test interfaces and **never**
-> test implementation and will slap wrists if I have to :)


Why not delete failing tests when the code they're testing no longer
exists, and replace them with the tests that you wrote for the new code?


More information about the testing-in-python mailing list