Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Feature or Bug ?by ady (Deacon) |
on Sep 17, 2005 at 08:16 UTC ( [id://492820]=note: print w/replies, xml ) | Need Help?? |
Question: Suppose also that my faulty implementation of my faulty algorithm will give the proper output on all input. -- Does my program have a bug ? The input/output function (the mapping from one set of values to another) is the mathematical definition of behavioural correctness of a program transformation. If your implementation (as stated) performs the transformation as specified, it is correct from a black box perspective. Example: A program with following i/O behaviour (i=>o mapping) performs a doubling finction on the integer range 1..4: The following program performs the i/o transformation as specified; It is "black box correct". Opening the box we can observe that the doubling algorithm (a lookup table) is flawed and the Perl code is unnecessarily complex and shaky. From a white box perspective the implementation is of poor quality : the bugs cancel out each other (from the black box perspective), but the code should definitely be cleaned up for better maintainability, robustness and efficiency. That in a way brings us back to your Larry Wall quote: ...redundancy was absolutely necessary to achieve the goal of putting someone on the moon. Use pair programming, technical walkthroughs, reviews... any and all human redundancy to assure "white box quality" of the implementation (ie. to catch - among other things - bugs cancelling out each other as seen from a pure interface/black box view. And for certain systems (as rocket science): use hardware redundancy as well, because only relatively small applications can be mathematically proven to be even black box (I/O transformation) correct, much less white box so. Allan If a tree falls in a forest with no one to hear it, then does it make a sound?
In Section
Meditations
|
|