Jump to content

Programming by permutation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Keno (talk | contribs) at 17:50, 5 August 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Trying to approach a solution to a programming problem by iteratively making small changes (permutations) and testing each change to see if it behaves as expected is called "programming by permutation". This approach sometimes seems attractive when the programmer does not fully understand the code, and believes that one or more small modifications may result in code that is correct.

This tactic is rarely productive because:

  • a series of small modifications can easily introduce bugs into the code, leading to a "solution" that is even less correct than the starting point
  • many changes are usually required to arrive at a satisfactory endpoint
  • it is rarely possible to measure, by empirical testing, whether the solution will work for all cases
  • in the worst case, with poor code management, the original state of the code may be irretrievably lost