# from Michael Peters
# on Thursday 22 January 2009 09:55:

>> I suppose "if($whatever) { some_test() } else { alternate_test()}"
>> would complicate automatic counting.  But, you have to go down one
>> branch.
>
>But there's no protection that one branch doesn't have a different
> number of tests than the other.

If you can see all of the function calls at compile-time, you can count 
them.  If one branch has a different count than the other, that's an 
error unless the shorter branch contains a skip statement?

>> The only impossible spot is when tests are inside e.g. a
>> runtime dispatched method, no?  (And, given the procedural paradigm,
>> that seems to be an odd case.)
>
>No, that's not odd at all. Any data driven testing system will be that
> way. Tests are run based on some config file (I know Ovid uses YAML
> for something like this), etc.

That still doesn't imply that we can't somehow count the number of tests 
with a computer instead of relying on humans to screw it up.  If some 
combination of static analysis and early runtime can come up with a 
count, then it becomes possible to automatically plan without counting.

So, whatever constructs make that impossible might be worth pondering.

--Eric
-- 
"...the bourgeoisie were hated from both ends: by the proles, because
they had all the money, and by the intelligentsia, because of their
tendency to spend it on lawn ornaments."
--Neal Stephenson
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to