Do you ever make a code change and just test rather than trying to fully understand the change you'v
- by Clay Nichols
I'm working in a 12 year old code base which I have been the only developer on.
There are times that I'll make a a very small change based on an intuition (or quantum leap in logic ;-).
Usually I try to deconstruct that change and make sure I read thoroughly the code.
However sometimes, (more and more these days) I just test and make sure it had the effect I wanted. (I'm a pretty thorough tester and would test even if I read the code).
This works for me and we have surprisingly (compared to most software I see) few bugs escape into the wild.
But what I'm wondering is whether this is just the "art" side of coding. Yes, in an ideal world you would exhaustively read every bit of code that your change modified, but I in practice, if you're confident that it only affects a small section of code, is this a common practice?
I can obviously see where this would be a disastrous approach in the hands of a poor programmer. But then, I've seen programmers who ostensibly are reading the code and break stuff left and right (in their own code based which only they have been working on).