Find a way to implement all the possible paths through the code you want to reorganize. You could
- write block tests manually
- use Daikon http://plse.cs.washington.edu/daikon/ , which automatically and systematically enters code to output invariants (I did not use it myself, but I tried a commercial Java-oriented descendant)
In any case, use the code coverage tool to make sure you have a complete application and coverage solution. Use a coverage tool that reports the number of times each statement is executed during a coverage run. You might even be able to get trucov , which actually creates code path diagrams to work.
Do refactoring.
. - , . , , , , . , trucov, ; .