Detective fiction is the fictional genre in which the author presents a mystery to the readers, usually in the form of the investigation of a murder. Great ingenuity is usually exercised in revealing the basic method of the murder in such a manner as to simultaneously conceal it from the readers, until the end of the book, when the method and culprit are revealed.
A common feature is that the investigator is usually unmarried, with some source of income other than a regular job, and frequently has an assistant, who is asked to make all kinds of apparently irrelevant inquiries, and acts as an audience for the explanation of the mystery at the end of the story.
An early archetype of these types of story were the three Auguste Dupin stories of Edgar Allen Poe: The Murders in the Rue Morgue, The Purloined Letter, and The Mystery of Marie Roget. This last is particularly interesting, as it is a scarcely fictionalized analysis of the circumstances around the real-life discovery of the body of a young woman named Mary Rogers, in which Poe expounds his theory of what actually happened. The style of the analysis, with its attention to forensic detail, makes it a precursor of that most famous of all fictional detectives, Arthur Conan Doyle's Sherlock Holmes, who set the style for many, many others in later years, including pastiches such as August Derleth's Solar Pons.
Detectives generally fall within one of three domains: the private investigator, the police detective, and the amateur or dilettante detective.
The full list of fictional detectives would be immense; the format is well suited to dramatic presentation, and so there are also a large number of television and film detectives, besides adaptation of novels in this genre.
A few examples of fictional detectives, and their creators:
- Sherlock Holmes -- Sir Arthur Conan Doyle
- Hercule Poirot -- Agatha Christie
- Miss Marple -- Agatha Christie
- Lord Peter Wimsey -- Dorothy L. Sayers
- Nero Wolfe -- Rex Stout
- Inspector Morse -- Colin Dexter
- Brother Cadfael -- Ellis Peters (unusual in being set in the 11th century, but otherwise following the detective format)
- Judge Dee
- Philip Marlowe -- Raymond Chandler
- Sam Spade -- Dashiell Hammett
- Kinky Friedman -- Kinky Friedman
- Perry Mason -- Erle Stanley Gardner
Then there are all those private eye stories, and police procedural stories that need to go here too...
Perhaps some mention is needed of Wilkie Collins' The Moonstone as an early detective novel?