|
![](/i/fill.gif) |
Am 08.06.2011 22:01, schrieb Darren New:
> Every work on unit testing I've read basically says you should run all
> the unit tests after each change, or certainly at least before each
> check-in.
>
> However, those same texts say that unit testing should only test
> individual units, and everything else should be mocked.
>
> Why would I want to run the unit tests for the XML parser after making
> changes to the color picker dialog box? Or, more generally, why would I
> want to run unit tests that are only executing code that hasn't changed
> since last time the unit tests passed?
(1) You only run the unit tests for those units you actually changed.
But I guess you knew that.
(2a) If you /know/ beyond doubt that your code change in part X of a
unit can't affect part Y of the same unit, then X and Y should probably
be separate units.
(2b) If on the other hand you do /not/ know beyond doubt whether your
code change in part X of a unit might affect part Y of the same unit,
then obviously you should test part Y as well to be sure. But I guess
that's no news to you either.
Post a reply to this message
|
![](/i/fill.gif) |