[Tutor] Conventions for code snippets for debugging and testing?

Kent Johnson kent37 at tds.net
Thu Apr 10 23:24:52 CEST 2008


Robert Kirkpatrick wrote:
> Hi All,
> 
> Just wondering if there are any basic conventions for including code
> snippets that are for testing / debugging only?
> 
> For example, you could set a boolean variable called DEBUG,

That is pretty common, with a boolean or an integer (for levels of debug 
info).

> The use case I'm dealing with right now is to query the SVN commits for a
> weekly period and report on each user for that time period.  If I'm testing
> though, I only want to cycle through a few users, not all of them.

I would look at the structure of your code. Maybe there is a function 
that just runs one user that you could use for testing, or perhaps you 
could pass in a number that is a limit on how many users to process.

Kent


More information about the Tutor mailing list