> But in software, we have a wrinkle to contend with: > What, exactly, is "one part"? Some say it's a single > method, however, I've seen methods that were pages long. > This brings us to the concept of Test Driven Design; > refactor that big method into many small methods that > each do only one thing, and they become easier to test.
First, you'd probably like to write some unit tests (well, I guess that would be impossible, since any test of this function would not be a "unit test" by the definition proposed here), to make sure you don't break the existing behavior.
Refactoring to a lot of little functions is not an option here -- that would break thousands and thousands of applications.