The answer to that question varies with the author. Some crime writers spend a very long time at the planning stage, up to a year, maybe more, others have only a rough outline before beginning the creative writing, and some will have an in depth synopsis written.
When I begin a new crime novel or thriller I don't have a clue who did it or why? I start with an idea, and a body and then Andy Horton, accompanied by Sergeant Cantelli and often in conflict with his boss DCI Lorraine Bliss and the head of the Major Crime Team, Detective Superintendent Uckfield, set out to discover who killed her/him and why.
The first draft creates the characters, their motivations and personalities. It explores the relationships and determines the setting. At this stage I'm not sure where the story is going or how many twists and turns it will take and that's what excites me. The structure will change, new ideas will spring up, research will sometimes take me in a completely different direction to the one I thought I was heading. Sub plots will begin to develop, which could tie in with the main plot or go their own way, and sometimes I might remove them completely because they are worthy of developing into a novel of their own.
It's unchartered waters and I'm off with Andy Horton to explore what gruesome crime we'll find within them.