how to reduce bugs due to incorrect indentation

Dan Sommers dan at tombstonezero.net
Wed Feb 5 22:08:31 EST 2014


On Wed, 05 Feb 2014 19:02:09 -0800, msustik wrote:

> My changes were elsewhere and I did not notice the above one line
> change when I looked at the diffs before commit. I should have noticed
> it...
> 
> It was rare that a was 1 and therefore the problem did not show up for
> a while. (I know I should have had tests exercising all cases...)
> 
> When the bug showed up, it was kind of difficult to remember what was
> the original intent. Fortunately, looking at old versions allowed me
> to find the problem commit and the bug.
> 
> Any suggestion on how to avoid this type of error in the future?

I think you just mentioned the best suggestions:  (a) have a good
collection of unit tests (where "good" means data and branch coverage),
and (b) look carefully, or have someone else look carefully, at every
commit.

Dan



More information about the Python-list mailing list