Lesson plan

Programming by permutation

Programming by permutation, sometimes called "programming by accident" or "shotgunning", is an approach to software development wherein a programming problem is solved by iteratively making small changes (permutations) and testing each change to see if it behaves as desired. 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 not productive when: * There is lack of easily executed automated regression tests with significant coverage of the codebase: ** a series of small modifications can easily introduce new undetected bugs into the code, leading to a "solution" that is even less correct than the starting point * Without test-driven development it is rarely possible to measure, by empirical testing, whether the solution will work for all or significant part of the relevant cases * No version control system is used (for example Git, Mercurial or Subversion) or it is not used during iterations to reset the situation when a change has no visible effect ** many false starts and corrections usually occur before a satisfactory endpoint is reached ** in the worst case, the original state of the code may be irretrievably lost Programming by permutation gives little or no assurance about the quality of the code produced—it is the polar opposite…

Back to article

Article summary

Programming by permutation, sometimes called "programming by accident" or "shotgunning", is an approach to software development wherein a programming problem is solved by iteratively making small changes (permutations) and testing each change to see if it behaves as desired. 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 not productive when: * There is lack of easily executed automated regression tests with significant coverage of the codebase: ** a series of small modifications can easily introduce new undetected bugs into the code, leading to a "solution" that is even less correct than the starting point * Without test-driven development it is rarely possible to measure, by empirical testing, whether the solution will work for all or significant part of the relevant cases * No version control system is used (for example Git, Mercurial or Subversion) or it is not used during iterations to reset the situation when a change has no visible effect ** many false starts and corrections usually occur before a satisfactory endpoint is reached ** in the worst case, the original state of the code may be irretrievably lost Programming by permutation gives little or no assurance about the quality of the code produced—it is the polar opposite…

Key claims

No claims recorded.

Discussion questions

  1. Summarise the article in your own words. Which single claim would you verify first, and why?
  2. Which claim in this article is most likely to be revised as the sources update? How would you check its current status?
  3. If two sources disagreed about one of these facts, what would you need in order to trust one over the other?

Bibliography

No sources recorded.

Key claims and bibliography are generated from the same tracked claims and sources as the article page.