|The stupid question is the question not asked|
Testing Template, or should I write a diff for TT templates?by EvdB (Deacon)
|on Nov 14, 2003 at 17:46 UTC||Need Help??|
EvdB has asked for the wisdom of the Perl Monks concerning the following question:
This could possibly go into SoPW, but it is more of a musing so here goes:
The problem I wish to address is content generated by Template from templates. I can envisage a situation where the perl code and the underlying templates are created and tested. Then in the future a web designer comes alnog and makes changes to the templates. Then the designer wants to check that they have not changed the functionality of the template in any way, which is a good thing. However they do not know Template beyond the very basics and know nothing of perl.
For example, how could a designer check that their modifications to the following are OK:
The template above could be easily processed and then tested against expected data (regression testing) to ensure that it works.
My proposed solution to this is that there should be two sets of templates: one is used to generate the content in production, the other is used to test that the production templates behave as expected. These two sets of templates would be identical in terms of their functionality.
During testing the two sets of templates are compared to see if they are functionally the same - hence the diff for templates. However it is not straight forward to write a script which strips out everything but the Template commands.
I have the following thoughts / questions:
I hope that this little musing of mine increases the ways to test, which for Templates currently appears to be quite few.
--tidiness is the memory loss of environmental mnemonics