Exhaustive Unit Testing

Roy Smith roy at panix.com
Fri Nov 28 14:44:31 CET 2008


In article <mailman.4622.1227875510.3487.python-list at python.org>,
 Nigel Rantor <wiggly at wiggly.org> wrote:

> Roy Smith wrote:
> > 
> > There's a well known theory in studies of the human brain which says people 
> > are capable of processing about 7 +/- 2 pieces of information at once.  
> 
> It's not about processing multiple taks, it's about the amount of things 
> that can be held in working memory.

Yes, and that's what I'm talking about here.  If there's N possible code 
paths, can you think about all of them at the same time while you look at 
your code and simultaneously understand them all?  If I write:

if foo:
   do_this()
else:
   do_that()

it's easy to get a good mental picture of all the consequences of foo being 
true or false.  As the number of paths go up, it becomes harder to think of 
them all as a coherent piece of code and you have to resort to examining 
the paths sequentially.



More information about the Python-list mailing list