In defining the scope of the science fiction genre, we speak of the effect of science or technology, or both, upon society or persons; within the context of imaginative fiction there are a few variables.
It is possible to apply the creative imagination to different areas of this idea, for example:
the effect of imagined science
the imagined effect of actual science
imagined technology based upon actual science
imagined technology based upon imagined science
the effect of science and technology, or both, upon imagined societies
the effect of science and technology, or both, upon imagined individuals, etc., etc.
Therefore, a story could describe an extremely unusual society (for example, an extraterrestrial civilization, or a parallel or alternate dimension of spacetime) and their unusual reactions to a scientific discovery, which (to the reader) is straightforward knowledge, for example, the story "Nightfall" by Isaac Asimov.
Alternatively, the society might be ordinary and human, but the individual man or woman might be an unusual person (for example, a mutant or a telepath) who responds exceptionally to otherwise ordinary events. The "individual" might be an artificial intelligence, and the story may partly be concerned with the Turing test. The society and persons in the story may be ordinary, but faced with bizarre circumstances such as the invention of teleportation, or the discovery of a new chemical element with unusual properties (such as "Cavorite" in The First Men In The Moon).
If the society, the person, the technology, and the scientific knowledge base in the story are all standard and realistic (drawn from observed reality), without much extrapolation of any of these literary components, the story would be classed as mainstream, contemporary fiction rather than as science fiction, but if the characters' psychology (thoughts and feelings) about the laws of the universe, time, reality, and human invention are unusual and tend toward existential re-interpretation of life's meaning in relation to the technological world, then it would be classed a modernist work of literature which overlaps with the themes of science fiction.
Some fiction sits fairly and squarely on the borderline, between science fiction and other genres; some writing defies categorisation. In some cases, the term "science fiction" generally refers to any literary fantasy including a scientific factor as an essential, story-orienting component. It is sometimes applied, more generally, to any fantasy at all (generally so in US bookstores), but, in that case, the larger category of speculative fiction is more inclusive. Such literature may consist of a careful and informed extrapolation of scientific facts and principles, or it may range to far-fetched areas flatly contradicting such facts and principles. In the former case, scientifically-based plausibility is requisite, while in the latter, plausibility is the lesser requirement and love of imaginative ideas the greater.
These distinctions attempt to differentiate science fiction from fantasy, using science as the demarcation point. It can also be argued that science fiction is simply a modern form of fantasy, which developed alongside of the rise of science and technology as driving factors in modern society. In this view, the elements that would previously have been presented as fantasy (magic, transformations, divination, mind-reading, fabulous beasts, new civilizations, higher beings, etc.) are rationalized or supported through scientific or quasiscientific rationales (psychic abilities such as telekinesis and precognition, aliens and their civilizations, etc.). This definition also has the benefit of avoiding semantic traps over science fiction which is overtaken by events, such as when the science in the story is disproven or events predicted in the story do not happen or do happen, either in radically different ways or in the ways science fiction has encouraged the public to expect. It also reflects the substantial overlap between the audiences of science fiction and fantasy literature, the fact that many (if not most) science fiction authors have also written works of fantasy, and that many fantasy novels have won Hugo awards and Nebula awards.
Precursors of the genre, such as Mary Shelley's Gothic novel Frankenstein, or the Modern Prometheus (1818) and Robert Louis Stevenson's The Strange Case of Dr. Jekyll and Mr. Hyde (1886) plainly are science fiction, whereas Bram Stoker's Dracula (1897), based on the supernatural, is not. A borderline case is Mark Twain's A Connecticut Yankee in King Arthur's Court, where the time travel is unexplained but subsequent events make realistic use of science. Shelley's novel and Stevenson's novella are early examples of a standard science fiction theme: The obsessed scientist whose discoveries worsen a bad circumstance. Science fiction always has been concerned with the great hopes people place in science, but also with their fears concerning the negative side of technological development.
The broader category of speculative fiction includes both science fiction and alternative histories (which often have no particular scientific or futuristic component). An example is Olaf Stapledon's Darkness and the Light which presents two possible futures for mankind defined by developments in ethics and philosophy. Sometimes, utopic and dystopic literature is regarded as science fiction (accurate insofar as sociology is science); however, dystopic literature sometimes falls under the cyberpunk genre. In this sense, many satirical novels qualify when their speculation distinguishes the "scene" from the present or the past.
A popular idea of science fiction is that it is, in general, attempting to predict the future. Some commentators go so far as to attempt to judge the "success" of a work of science fiction on its accuracy as a prediction. While most science fiction is set in the future, most authors are not attempting to predict; instead, they use the future as an open framework for their themes. A science fiction writer is generally not trying to write a history of the future that they believe will happen, any more than a writer of westerns is trying to create a historically accurate depiction of the old West. There are exceptions, especially in early science fiction. Writers are actually as likely to write of a future that they hope will not happen (for example, in dystopias).