|There's more than one way to do things|
Re: TDD of non-module codeby sundialsvc4 (Abbot)
|on Jan 26, 2012 at 14:48 UTC||Need Help??|
AFAIK, Perl doesn’t have an #ifdef capability, which is unfortunate. I think that you probably are going to have to put the code into modules, unless you merely intend to be doing “black box” regression-testing, because you do need to be able to isolate the functionality that is under test. But there are real advantages to modularity that have more value than simply to facilitate unit-testing: modular code is inherently less coupled because there are only a few well-defined “ways in” and “ways out” for each “thing.” It is the way that I would design such code anyway.