In the original version of the movie Jack Nicholson’s character Melvin did not have obsessive compulsive disorder. He was just a curmudgeonly old man. Unfortunately the test audiences hated the picture. OCD was added to Melvin's character to help us pallet how much of a prick he was.

In my opinion it turned out well. I loved the movie, but it wouldn't have worked otherwise. Melvins redemption was core to the plot and we wouldn't have wanted to see him redeemed otherwise. We would have just wanted to see him punished. So, this movie's treatment of OCD isn't exactly a clinical reality, but an effective, if very Hollywood, choice.