Talk:Test a function

From Rosetta Code
Revision as of 23:36, 15 June 2009 by rosettacode>Dkf (I think test frameworks are a good idea.)

How about just write a test for the palindrome task, if your language doesn't have large testing frameworks?
Shouldn't tasks lead toward implementation rather than omitting? --Tinku99 22:52, 15 June 2009 (UTC)

I'm tempted to disagree with such a change. Having a testing framework makes it easier to test the language implementation itself; they're often among the biggest consumers of such frameworks. So, implementing a framework (which doesn't actually need to be that complex) that lets you satisfy this task means that you can have a higher-quality language implementation. View it as a hint for how to make the jump to the next level of software engineering quality. (For example, Tcl's test suite exercises virtually the entire language implementation, including a very large fraction of the failure paths, and it makes it much easier to know early that maintenance hasn't screwed things up.)
On the other hand, a test framework really doesn't need to be more than a few functions; one to run tests, one to compare results for equality, one to print a summary at the end. —23:36, 15 June 2009 (UTC)