Thread overview
Re: How to check all values in a range are equal to some predicate?
Sep 25, 2011
Andrej Mitrovic
Sep 25, 2011
Jonathan M Davis
Sep 25, 2011
Andrej Mitrovic
Sep 25, 2011
Jonathan M Davis
Sep 25, 2011
Andrej Mitrovic
September 25, 2011
Argh, I've just realized this function would do me no good. I would get an error on the invocation line but I wouldn't know which of the objects have compared unequal. Maybe it's best to keep unittest code really simple.
September 25, 2011
On Sunday, September 25, 2011 04:16:02 Andrej Mitrovic wrote:
> Maybe it's best to keep unittest code really simple.

That has always been my take on it. Sometimes, you're forced to make it more complicated, but if your unit tests are complicated, then there's a higher risk of bugs in them, which makes it more likely that they won't catch bugs in your code. It's bad enough having to debug the real code. I don't want to have to debug my unit tests as well. I definitely think that unit tests should almost always be dead-brain simple.

- Jonathan M Davis
September 25, 2011
On 9/25/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> On Sunday, September 25, 2011 04:16:02 Andrej Mitrovic wrote:
>> Maybe it's best to keep unittest code really simple.
>
> That has always been my take on it. Sometimes, you're forced to make it more
> complicated, but if your unit tests are complicated, then there's a higher
> risk of bugs in them, which makes it more likely that they won't catch bugs
> in
> your code. It's bad enough having to debug the real code. I don't want to
> have
> to debug my unit tests as well. I definitely think that unit tests should
> almost always be dead-brain simple.
>
> - Jonathan M Davis
>

Yeah. I would however like to know how much code-coverage I have in my unittests. I don't know if this is implementable in the compiler, but maybe a tool could figure this out. I think some C++ or Pascal unittest facilities actually had something like that and could give you a rough percentage of how much code is unittested.
September 25, 2011
On Sunday, September 25, 2011 04:48:56 Andrej Mitrovic wrote:
> On 9/25/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> > On Sunday, September 25, 2011 04:16:02 Andrej Mitrovic wrote:
> >> Maybe it's best to keep unittest code really simple.
> > 
> > That has always been my take on it. Sometimes, you're forced to make it
> > more complicated, but if your unit tests are complicated, then there's
> > a higher risk of bugs in them, which makes it more likely that they
> > won't catch bugs in
> > your code. It's bad enough having to debug the real code. I don't want
> > to
> > have
> > to debug my unit tests as well. I definitely think that unit tests
> > should
> > almost always be dead-brain simple.
> > 
> > - Jonathan M Davis
> 
> Yeah. I would however like to know how much code-coverage I have in my unittests. I don't know if this is implementable in the compiler, but maybe a tool could figure this out. I think some C++ or Pascal unittest facilities actually had something like that and could give you a rough percentage of how much code is unittested.

-cov

- Jonathan M Davis
September 25, 2011
On 9/25/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> -cov

Hehe, forgot about that. That should be perfect with a little script to filter things out.