Friedrich Nietzsche offered a comparison between science and art in his 1878 book, Human, All Too Human, where he seems at moments to suggest that science is replacing art as a critical and creative force. It’s a matter of debate if that is the overall message in Human, All Too Human and certainly a matter of debate if that is the message of later texts. For present purposes, the important thing is that in 1878, Nietzsche suggests that science is a matter of creation and innovation. It’s always dangerous to suggest an idea has no precedents, but I can’t think of a precise precedent for the idea that science emerges from a process of creative interpretations rather than a reading of what is in nature through observation and the systematic comparison of observations. The comparison between art and science goes back to the German Idealist and Romantic thought of the 1790s, but in the sense of a revealing of the truth of nature, a worthy topic of discussion itself. Nietzsche looks to me like a very early occasion for the idea that the scientist uses scientific methods, but that these test ideas produced by imagination, and that imagination is necessary in testing those ideas and producing better ones later. Nietzsche does not put his position in those terms, but a picture builds up in which scientific theories appear from the creative mind and the illusions of our metaphysical assumptions. The methods of science are productive so long as they are not used to produce a ‘Positivist’, metaphysics, that is a final set of unchallengeable truths. Nietzsche does not exclude such a situation, but thinks it would be the end of science as science is a progressive inquiry and elimination of bad assumptions, but needs ungrounded assumptions in order to take a new step.
The history of the philosophy is often effectively taken as starting with Karl Popper (1902-1994). I don’t think that anyone has suggested that Popper’s philosophy emerged without predecessors: immediate and historical. However, for many purposes the teaching and discussion of philosophy of science and methodology of natural and social sciences is taken to begin with Popper as the most pragmatic starting point, or at the very least he appears soon, maybe after a discussion of the Logical Positivism with which he had some connections. What is the exciting thing in Popper which makes him a new beginning, and often the definitive starting point for what is meant by philosophy of science, or methodology. The obvious argument in Popper is that of ‘falisficationism’ (or refutability or fallibilism), the idea that science consists of a succession of theories which are open to empirical falsification and which have been continuously falsified in the history of science. Falsifiability includes the idea that science is open to any idea, and that such ideas are generated through imagination rather than observation.
Both Popper and Nietzsche see science as an enterprise of constant invention and constant fallibility. I don’t suggest that Popper took these ideas from Nietzsche, though someone somewhere may find evidence of a direct influence sometime. maybe it has already happened but I haven’t seen any evidence of it. What is the case is that Nietzsche’s comparatively unsystematic looking philosophy does anticipate ideas in Popper’s rational and systematic approach to defining the methods of science.