How to verify a result of program that is hard to grasp? For example a year ago I had to wrote a B tree as schoolwork and I really struggled with that mainly because I was clueless how to verify proper result. What strategies do you use in such scenarios? Visualization? Robust input-->result sets of testing data? What do you do when is hard to get such data because the only way how to get them is your proper working program? I will really appreciate any edit of my grammar because I suck at English :) Thanks
EDIT: I think that my question was misunderstood. There was not problem with understanding how is B tree working. That is trivial. But writing robust tests for validating its proper functionality is not so trivial! I think that this school problem is similar to many practical REAL word scenarios and test cases. And sometimes understanding the domain is quite different from delivering working and correct program...
EDIT2: And yes, with B tree it is possible to validate proper behavior with pen and paper. But this is really dirty and not funny. This is not working well with problems that requires huge amount of data for their validation...