I'm trying to adopt TDD in my daily programming practice. I use it at work very effectively, but I'm having trouble with my personal projects where I'm using some complex algorithms.
The particular algorithm that makes me ask this question is the Extended Kalman Filter. It's complex enough that I'm not confident in the code I've written, but it's simple enough that it's hard to break up.
I could write a test for the algorithm with an input and the expected output, but I'll do a lot of thrashing and shotgun coding in the middle because I don't have confidence in those intermediate steps.
If you've worked with reasonable complex algorithms and use TDD, what is your approach?