There are so many competing definitions of "science fiction" that we could be here all day arguing about which one is correct. But back in 1909, a writer named Maurice Renard wrote an essay explaining the nature of the "scientific marvelous," a genre that he traced to H.G. Wells, and before him Edgar Allan Poe.
Renard was the author of a 1908 novel called Le Docteur Lerne - Le Sous-Dieu, which was similar to Wells' Island of Dr. Moreau (and which he dedicated to Wells). Later, he wrote other works of early science fiction, including the famous Hands of Orlac, which was adapted to three movies. But in 1909, he wrote an essay about the mechanisms of the "scientific marvelous" novel, and the whole thing is online.
Here's the part where he tries to explain what makes something a "scientific marvelous" novel, and what goes into writing such a book:
How does one generate a scientific-marvelous novel? Where do its subjects come from and how are they treated? What is the technique of this new art-form? It is fascinating to analyze, work by work, the entire literary production of the authors heretofore cited—to scrutinize the particular scientific disciplines which molded their fantasies, from the initial principles used to the subsequent elaborations—and to distill the laws of a general methodology. It's hard work, and most novelistic genres would be resistant to it. Ours, however, comes out of this inquiry triumphantly. Such a dissection shows us that the scientific-marvelous novel is built on a powerful skeletal frame that is reason itself; it shows us that the organism is constructed from a fabric made of knowledge and ingenuity. In fact, it is the contemporary literary genre which is most akin to philosophy—it is philosophy put into fiction, it is logic dramatized. ....
The fewer the falsehoods, the more the logic—something which imparts to the work its strong texture of truth. Therefore, most scientific-marvelous novels restrict themselves to falsifying no more than one natural law, and to showing us the effects of this single modification where all the other laws remain unchanged.
This general procedure used to construct the framework of a scientific-marvelous story can assume an infinite variety of forms. Examples: we can accept as viable certain scientific hypotheses and then deduce the direct consequences of them (e.g., life on Mars accepted as obvious, combined with what long study of this planet has taught or suggested to us, and we have Wells' War of the Worlds). We can substitute one idea for another, give to one the properties of the other, a trick which will permit us to apply to it a system of investigation which would be in reality quite impractical, but which might help us to find the solution to a problem by supposing it already solved (e.g., give the qualities of space to time, and we have The Time Machine). We can apply methods of scientific exploration to imaginary objects, beings, or phenomena through rational analogy and logical assumptions (e.g., suppose an empirical study of extraterrestrials, and we have [Derennes'] The People of the Pole). It's all about extending science fully into the unknown, and not simply imagining that science has finally accomplished such and such a feat currently in the process of coming to be. It's all about, for example, having the idea of a time machine to explore time, and not about a fictional protagonist who has managed to construct a submarine at a time when real engineers are hot on the trail of such an invention. And I strongly assert that this, in essence, is what differentiates Wells from Jules Verne—two writers so frequently lumped together. Jules Verne never wrote a single sentence of scientific-marvelous. In his time, science was pregnant with many impending discoveries; Verne simply supposed them already born before they actually were.
Read the rest over at Science Fiction Studies.