I've made it a habit to ask myself what I expect the output to be for any programming operation, and why. It forces me to gain clarity into my mental model of what's happening, and it immediately highlights deficiencies in my model when it's proven wrong.
I ask the same of others when I pair program with juniors or interviewees. I find super useful all around.