Testing

test often, and as thoroughly as feasible

fixing an error in a component you thought is working correctly when you're working on a different component is most likely to be more tedious and timeconsuming than fixing it while you're working on that particular component

after a component is completed, try it out in combination with the ones it is supposed to interact with

when you're stuck, take a break