lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 05/04/14 19:43, tonyp wrote:
> Someone suggested to create a separate file for testing a module's
> function. In general, I find this a bad idea as the two files will soon
> get out of sync (talking from experience.)  For one thing, you need some
> file naming convention just to keep track of things (which file tests
> which library). Also, renaming the module file, and forgetting to adjust
> (and possibly rename) the related test file is enough to break the
> special bond between the two.  The best place to put module test code
> (in my view, at least) is the module itself.

However, all of this is negated if you follow the test driven
development pattern of red, green and refactor. For which you write the
test before you make any changes which makes it impossible to rename the
file and forget to change the test, I also talk from experience.

-- 
Liam

Attachment: signature.asc
Description: OpenPGP digital signature