I've been delving a lot into the the crime investigation genre, and at first I thought "Simple, just start of with Who, What, Where, When, Why and How and you've got yourself a story!" but I quickly realized it's much more complicated than that.
A crime solving story has Leads, it has Witnesses, it has Clues, it has Unexpected Discoveries... and I'm just lost in a sea of possibilities...
So I've tried to reduce the basic structure of a story to this:
So my question is... am I leaving anything out? Is there some fundamental aspect to an investigation I'm forgetting? Bear in mind I consider Plot Twists to simply be a form of Misdirection.
Motive. Why did the person do it?
Helpers and Hinderers. People who assist in or impede the investigation. They can range from the detective's partner to evil minions to muckety-mucks on either side. This is apart from witnesses; these are people who can either bring information (clues, evidence) or hide it, who can provide witnesses or remove them, who can create misdirection or clear it up.
Scanning the boldfaced terms on this page, I have to laugh aloud because it makes me imagine a novel about a crime investigation without a crime! That would be a most intriguing book indeed – and I think I will write it, right after my book without an antagonist.
But to answer your question, the most important thing for me in a crime investigation story are the investigator protagonist and his or her investigation.
Crime investigation fiction is a story of a process and the character and the mind of the person who drives, or is driven, by it. Crime fiction, if done well, is psychological fiction. The crime investigation is a situation into which the protagonist is cast and which serves as some sort of psychological test that will uncover his character.
That is maybe not the traditional way these novels are written. Hercule Poirot or Miss Marple do not actually have much of a character. But it is the way crime investigation fiction is done in tv and movies today. They are no longer about riddles being solved, but about inspectors facing their own inner demons as personified by a crime, or being broken or healed by their lives, of which the police work is merely a part.
Evidence comes in mind. It is somewhere in the realm of Clues/Leads, but more solid and obvious. Makes a perfect setup for unexpected plot twist, if misinterpreted in good faith from the very beginning. And the Antagonist, naturally, the one whodunit.
Another aspect is Conspiracy. A lot of crime novels have an onion layer structure to the bad guys, so the protagonist has to work their way through expanding levels of the crime, such that what at first appears to be a simple homicide is actually a state-wide ring of satanic cultists who run a shadow government.
There is also the Traitor which may be too strong a word. But he's the lovable ex-partner who helps the protagonist but in reality has been trying to guide the investigation astray because the traitor is actually working for (or is at least aware of) the bad guy and, at the very least, doesn't want the protagonist to get hurt. Heck, the TV show "24" had a mole in the CTU EVERY DAMNED SEASON, sometimes TWO! To the point where the most effective way to stop the bad guys would have been to immediately fire all the CTU employees at once (or at least send them all home for the day :)
A final aspect is a Past Connection. I've read many crime novels where the current crime echoes or mirrors some past event in the protagonists life. May just bring up some repressed memories that have to be dealt with or be a old foe back for more. I guess this is more of a character development tool than an essential element of crime fiction, but it is pretty common.
In my mind a crime stroy starts with the case. The first thing you have to know is
Jane killed John with a knife, because John has slept with her best friend
You need to know WHO is the culprit? WHO was murdered/assaulted/attacked/robbed/... and for WHAT reason? In the series "Castle" the flow of a crime is perfectly described in the first episode? "Every crime has a story". If you have the story about the crime? You can try to think like the culprit? Why has he done it? For what purpose? Was he alone? Is he intelligent enough to remove traces to him? Think about your detective and the culprit as Holmes and Moriarty. Two highly intelligent characters, that always try to be one step ahead of each other.
Crime is a genre, that needs to follow the flow backwards in the creating. Fantasy can start with just characters, their traits and a slightly build world. The story follows in the most cases alone. But crime is something more complex. There can be traps, baits, conspiracies and so on. You need to know the end, before you start to write. Your characters have to react to a strict plan. But the important part in crime is: You need to know the end and the reasons, why the incident happened. Then you can follow it all backwards and create a story around it.
There is a detective. This person may or may not be the protagonist. The competence and alignment of the detective will set the tone for a good portion of the story. The detective can be anywhere from stiff and professional to quirky and bumbling.