Not so long ago a question was asked on the discussion forum as to whether anyone had any references regarding the topic of 'slips in programmer practice'.
Below represents a tiny bibliography of papers that are related to this topic. Perhaps it could be useful for anyone who is interested in probing this particularly interesting topic which crosses into the arena of software engineering (and programming in the large) as well as individual programmer performance.
Adelson, B. (1981) Problem solving and the development of abstract categories in programming languages, Memory and Cognition, vol. 9, 422-433.
Adelson, B. (1984) When Novices Surpass Experts: How the difficulty of a task may increase with expertise, Journal of Experimental Psychology: Learning, Memory and Cognition, vol. 10, 483-495
Jadud, M. C. (2005) A First Look at Novice Compilation Behaviour Using BlueJ, Computer Science Education Vol. 15, 25–40
Vanlehn, K. (1990) Mind Bugs: The origins of procedural misconceptions. MIT Press.
Reason, J. (1990) Human Error, Cambridge University Press, Cambridge, UK