> After the interview, when I asked for feedback, the interviewer told me that I should have been running and testing my code as we went along.
Have they specified that you should be testing your code? If they haven't specified then it is wrong to expect some kind of arbitrary outcome.
People write code in many different ways, some do it very chaotically, some have very organized process.
I try to figure out which of these behaviors are fundamental to writing good code and which are not.
For example, I believe a habit of writing readable code IS fundamental to writing good code. If you don't have a habit of writing readable code, on average your code is going to be worse than if you had.
On the other hand, I believe writing unit tests IS NOT fundamental. Unit tests is one possible way of working with the code, but people were writing reliable code before unit testing became popular. Unit testing takes time and effort that can be allocated differently.
And so I try to look (I can't call it measuring because it is subjective) only at the behaviors that I believe are fundamental and dismiss others.
In the end, if you are smart person that can program well, you will be able to learn those other behaviors. But if you are not smart or you lack certain fundamental abilities, it is going to be much more difficult to fix it.