Comment by skybrian
One way to fix it: pair programming. You're getting feedback in real time as you write the code.
Unfortunately, the conditions where it works well can be difficult to set up. You need people who are into it and have similar schedules. And you don't want two people waiting for tests to run.
Anyone actually done long-term pair programming and lived to tell the tale? Is it real, or just a utopian fantasy?