in reply to How to get started in test first programming without writing modules? package ?

Gulliver:

You don't really need to split it into 3 files. Once I encountered the modulino concept, I've been playing around with modules having their own test fixtures inside them. So if you call the module directly, it will test itself. So you'd need only the module (.pm) for the code and tests, and you can just use a .pl file to use your module for other things.

If you wanted the application, module and tests all in a single file, you can do that, too. For that, I'd put it into test mode with a command-line switch or something, though.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: How to get started in test first programming without writing modules? package ?

Replies are listed 'Best First'.
Re^2: How to get started in test first programming without writing modules? package ?
by Gulliver (Monk) on May 16, 2011 at 17:19 UTC

    Thanks for the link to modulinos in the book 'Mastering Perl'. It looks like a really good book and this was just was I was looking for. After reading about it I realized I need to work through the basics of modules and testing modules as described in the book 'Testing Perl'.

    Using the example in the first chapter of Testing Perl I was able to make a simple module with a few functions and a test file. It turned out to be simpler to set up than Ruby was.