Term for "changing lots of things to try and fix one thing"

I am looking for a term which succinctly describes the age-old problem when someone is trying to fix a problem, and tweaks and changes many different things to try and fix it. When they finally do see that the problem is fixed, they are no longer sure (or are misled) as to what change or even combination of changes actually fixed the problem.

Does such a term exist? My initial thought was an XY problem, but when I looked up the definition it's not really what I'm looking for.

Here's an example: you are debugging some computer code, and to try and fix it you remove a line of code and re-run the programme. Each time you remove a line, and run. When the programme finally runs properly, it is not necessarily the last line of code that you removed which fixed it. It could be any combination of the removed lines of code, or even something unrelated in the environment.


Sounds like "trial and error". Most of the times, especially after solving the problem after many trials, one is no longer sure which step (or combination of steps) actually fixed the issue.

Wikipedia:

Trial and error

Trial and error is a fundamental method of problem-solving. It is characterized by repeated, varied attempts which are continued until success, or until the practicer stops trying.


One term for this approach is scattershot, which M/W defines as "broadly and often randomly inclusive [as in] scattershot advice / scattershot planning"


slapdash (approach)

The Oxford English Dictionary defines this sense in part as "[w]ith, or as with, a slap and a dash," perhaps suggesting the notion of an action (such as painting) performed with quick, imprecise movements. Over 100 years later, the word acquired the adjectival sense with which we are more familiar today, describing something done in a hasty, careless, or haphazard manner. – MW

If they hadn't taken such a slapdash approach we might know how to solve the problem faster next time.