This tactic is not productive when: Programming by permutation gives little or no assurance about the quality of the code produced—it is the polar opposite of formal verification.
This lack of clarity drives others to copy and paste from reference code which is assumed to be correct, but was itself written as a result of programming by permutation.
For example, the following code sample in C (intended to find and copy a series of digits from a larger string) has several problems: First of all, it doesn't give the right answer.
The former statement is added back, and the line above it is changed to remove the post-increment of variable i: Testing the code now produces the correct answer, "123".
Also known as "Trial and Error", "Generate and Test", "Poke and Hope",[1] "The Birdshot Method" and the "Million Monkeys Programming Style".