This question already has an answer here:
On Tatooine after the Jawa traders are attacked Luke mentions that it must have been sand people who had done it. Ben Kenobi corrects him by saying that they were only made to think it was sand people and mentions the accuracy of the laser blasts saying, "only Imperial storm troopers are so precise."
Yet, in several scenes after this it appears as though the storm troopers are terrible shots. For example, the scene where Luke and Leia are gearing up to swing to the other side of a chasm in the Death Star, they're being shot at by several storm troopers, all of whom miss Luke and Leia (while Leia manages to take out a couple of them). There's also the scene where Han charges into a large group of troopers, again, all of whom miss him as he runs away. If they're as highly trained as we're led to believe, then episode 4 would have been the last movie in the series due to the storm troopers dusting off all the heroes.
So was the accuracy they showed during the attack on the jawa traders just a fluke or were those small group of troopers just the best shots of all the storm troopers in the whole galaxy?
In summary, are there examples in the non-movie canon that shows how accurate storm troopers really are? It seems like they were made bumbling for the movie to make the heroes look better, as is often the case in films.