avinap77 | 1 Oct 2005 10:43
Picon
Favicon

Re: Testing (A) AND (B) AND (C)...

> It costs a lot to prevent future mistakes. It's a lot cheaper to 
just 
> trust that the developers who change the code in the future 
(including 
> you) will do smart things. I realize that this is not always 
perfect, 
> but the costs of a bug appearing in the future are far less than 
the 
> costs of preventing it from happening. Not to mention the fact that 
> attempting to prevent it is somewhat an excercise of DUF. You're 
making 
> assumptions about how the code might change and, in all likelihood, 
YAGNI.

but isn't this supposed to be one of the basic principles of TDD?
We write something driven by tests, to assure that we have enough 
test-coverage to later (sometimes immediately later) refactor with 
the confidence that our refactorings won't break the existing 
functionality.
If the tests we initialy wrote arn't enough to assure this, what is 
the benefit of writing them in the first place?

 - Avi

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/NhFolB/TM
--------------------------------------------------------------------~-> 

 
(Continue reading)

avinap77 | 1 Oct 2005 10:47
Picon
Favicon

Re: Testing (A) AND (B) AND (C)...

> First, the above function does not pass the test f(false, true, 
true) = 
> false, as the function above would return true.

My point exactly - I was replying to an answer that said we wouldn't 
need the test f(fale, true, true) = false.
The question was do I really need to code all 2^n tests..

> If, however, you are uncertain it is tested enough, you can add 
more tests. 
> One way to handle a large number of data-driven tests is to switch 
to the 
> Parameterized Test Case pattern and have the computer generate the 
examples 
> for you.

That sounds interesting. Can anybody point me to some material on 
this pattern?

 - Avi

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/NhFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
(Continue reading)

sagyrozman | 1 Oct 2005 11:26
Picon
Favicon

Re: Increased coupling with "Parameterise Constructor"

Hi,
you can lookup anything to do with dependency injection,
or ioc containers. In the java world there are these two frameworks
that I know of:
http://www.picocontainer.org/
http://www.springframework.org/
I'm not sure if there is something similar in .net.
Also look up articles about interaction vs. state based testing.
Two that I know of:
www.jmock.org/oopsla2004.pdf
www.martinfowler.com/articles/mocksArentStubs.html

good luck.

--- In testdrivendevelopment <at> yahoogroups.com, Ben Arnold
<ben.arnold <at> i...> wrote:
> Sven Gorts wrote:
>  > --- Ben Arnold wrote:
> >> So I'm looking for some advice.  Is the "Parameterise Constructor" 
> >> pattern only suitable for shallow hierarchies or is there something
> >> I'm overlooking? 
> > 
> >   Consider treating this wiring of instances as a
> > separate responsibility implemented by a configuration
> > class. I've used such an approach in the past and it
> > turned out great. I would love to hear about
> > alternative approaches though.
> 
> Hi Sven,
> 
(Continue reading)

Ron Jeffries | 1 Oct 2005 12:46
Favicon

Re: Testing (A) AND (B) AND (C)...

On Saturday, October 1, 2005, at 4:43:10 AM, avinap77 wrote:

>> It costs a lot to prevent future mistakes. It's a lot cheaper to
>> just trust that the developers who change the code in the future
>> (including you) will do smart things. I realize that this is not
>> always perfect, but the costs of a bug appearing in the future
>> are far less than the costs of preventing it from happening. Not
>> to mention the fact that attempting to prevent it is somewhat an
>> excercise of DUF. You're making assumptions about how the code
>> might change and, in all likelihood, YAGNI.

Just one guy's thoughts:

I agree with some of the above, but not all. I believe that software
defects are generally less costly to prevent than they are to fix,
but as with all things, it requires judgment and skill to decide
what to prevent and how to prevent it.

In the case in hand, converting A & B & B to (A | B) & C seems very
unlikely, as it does to the quoted poster above, and I might very
likely not do anything to prevent it. In general, though, if I look
at my tests and code and see things whose future safety seems in
danger, I would likely surround that area with a few more tests.

I feel no religious or other compulsion either to write every test I
could think of, or to write every test first. If I think of a test I
need, I write it; if I think of one I don't need, I don't write it.
I write them when it seems timely, even after the code seems to me
to be finished.

(Continue reading)

Donaldson, John (GEO | 1 Oct 2005 18:28
Picon
Favicon

RE: Nunit with VS 2005 and .NET 2

I've tried this and I'm seeing a BadImageFormatException. 

Here's what I have done:

	- installed 2.2.2 (no problem)
	- modified the nunit-gui.exe.config to have the first supported
runtime as "v2.0.50215"
	- created a very small test using vs 2005 and .NET v2
	- open the nunit gui (this runs), and try to add my snall test -
result is 'bad format exception'

Some black version magic I guess. Any ideas?

(If I run the Nunit tests, then nearly all of the tests pass, but about
15 fail
in both the NUnitDevTests.nunit and NUnitBinTests.nunit).

John D.

-----Original Message-----
From: testdrivendevelopment <at> yahoogroups.com
[mailto:testdrivendevelopment <at> yahoogroups.com] On Behalf Of Kevin Dente
Sent: Friday, September 30, 2005 8:04 PM
To: testdrivendevelopment <at> yahoogroups.com
Subject: Re: [TDD] Nunit with VS 2005 and .NET 2

All you need to do is update the <supportedRuntime> element in the
nunit-gui.exe.config or nunit-console.exe.config with the correct
version of the .NET 2.0 framework (and move it to the top of the list if
have multiple runtime versions installed). And be sure that you're
(Continue reading)

Kevin Dente | 1 Oct 2005 18:38
Picon

Re: Nunit with VS 2005 and .NET 2

Something that may not be obvious is that the <startup> section in the
default nunit-gui.exe.config is actually commented out. Did you noticed
that? You need to remove the comments before it will work.

On 10/1/05, Donaldson, John (GEO) <john.m.donaldson <at> hp.com> wrote:
>
> I've tried this and I'm seeing a BadImageFormatException.
>
> Here's what I have done:
>
> - installed 2.2.2 (no problem)
> - modified the nunit-gui.exe.config to have the first supported
> runtime as "v2.0.50215"
> - created a very small test using vs 2005 and .NET v2
> - open the nunit gui (this runs), and try to add my snall test -
> result is 'bad format exception'
>
> Some black version magic I guess. Any ideas?
>
> (If I run the Nunit tests, then nearly all of the tests pass, but about
> 15 fail
> in both the NUnitDevTests.nunit and NUnitBinTests.nunit).
>
> John D.
>

[Non-text portions of this message have been removed]

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
(Continue reading)

Donaldson, John (GEO | 1 Oct 2005 19:31
Picon
Favicon

RE: Nunit with VS 2005 and .NET 2

Kevin,

well! I feel suitably stupid. :-(
That will teach me to use Notepad.
When I uncommented that section of the config file things start to work.

Thanks for the great support.

John D. 

-----Original Message-----
From: testdrivendevelopment <at> yahoogroups.com
[mailto:testdrivendevelopment <at> yahoogroups.com] On Behalf Of Kevin Dente
Sent: Saturday, October 01, 2005 6:38 PM
To: testdrivendevelopment <at> yahoogroups.com
Subject: Re: [TDD] Nunit with VS 2005 and .NET 2

Something that may not be obvious is that the <startup> section in the
default nunit-gui.exe.config is actually commented out. Did you noticed
that? You need to remove the comments before it will work.

On 10/1/05, Donaldson, John (GEO) <john.m.donaldson <at> hp.com> wrote:
>
> I've tried this and I'm seeing a BadImageFormatException.
>
> Here's what I have done:
>
> - installed 2.2.2 (no problem)
> - modified the nunit-gui.exe.config to have the first supported 
> runtime as "v2.0.50215"
(Continue reading)

Kevin Dente | 1 Oct 2005 19:38
Picon

Re: Nunit with VS 2005 and .NET 2

Believe me, I've made that same mistake. :)

On 10/1/05, Donaldson, John (GEO) <john.m.donaldson <at> hp.com> wrote:
>
> Kevin,
>
> well! I feel suitably stupid. :-(
> That will teach me to use Notepad.
> When I uncommented that section of the config file things start to work.
>
> Thanks for the great support.
>
> John D.
>
> -----Original Message-----
> From: testdrivendevelopment <at> yahoogroups.com
> [mailto:testdrivendevelopment <at> yahoogroups.com] On Behalf Of Kevin Dente
> Sent: Saturday, October 01, 2005 6:38 PM
> To: testdrivendevelopment <at> yahoogroups.com
> Subject: Re: [TDD] Nunit with VS 2005 and .NET 2
>
> Something that may not be obvious is that the <startup> section in the
> default nunit-gui.exe.config is actually commented out. Did you noticed
> that? You need to remove the comments before it will work.
>
> On 10/1/05, Donaldson, John (GEO) <john.m.donaldson <at> hp.com> wrote:
> >
> > I've tried this and I'm seeing a BadImageFormatException.
> >
> > Here's what I have done:
(Continue reading)

avinap77 | 1 Oct 2005 20:17
Picon
Favicon

Mocking an object's own methods (branched from "Testing (A) and (B) and (C)")

Continuing the "a AND b AND c" thread, my actual case is that (a), 
(b) and c) are in fact other methods of the same object as f() is of.
So this is what I have:

Object O:
- Method a(): boolean testable method of O
- Method b(): another boolean testable method of O
- Method c(): yet another boolean testable method of O
- Method f(): A new method of O, which is supposed to rely on results 
of a(), b() and c(), something like this:

function f()
 if me.a() and me.b() and me.c() then...
end function

In a recent reply, Ron Jeffries wrote:
>> What is the benefit of writing tests in the first place?
>They shape the design.

So apropos shaping the design, how would I go about mocking the 
results of a(), b() and c() in order to test f()?
I can think of at least one way that seems rather ackward..
Has anyone out there already invented this wheel?

Thanks,

 - Avi

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
(Continue reading)

David Chelimsky | 1 Oct 2005 20:33

Re: Mocking an object's own methods (branched from "Testing (A) and (B) and (C)")

avinap77 wrote:

>Continuing the "a AND b AND c" thread, my actual case is that (a), 
>(b) and c) are in fact other methods of the same object as f() is of.
>So this is what I have:
>
>Object O:
>- Method a(): boolean testable method of O
>- Method b(): another boolean testable method of O
>- Method c(): yet another boolean testable method of O
>- Method f(): A new method of O, which is supposed to rely on results 
>of a(), b() and c(), something like this:
>
>function f()
> if me.a() and me.b() and me.c() then...
>end function
>
>In a recent reply, Ron Jeffries wrote:
>  
>
>>>What is the benefit of writing tests in the first place?
>>>      
>>>
>>They shape the design.
>>    
>>
>
>So apropos shaping the design, how would I go about mocking the 
>results of a(), b() and c() in order to test f()?
>I can think of at least one way that seems rather ackward..
(Continue reading)


Gmane