Re: NUnit 2.5: What's In It Now

Gary Evans <[email protected]> Thu, 10 Apr 2008 22:25:04 +0100
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
> > > return from the middle of a function other than an exception> > > (that I can think of) so I don't know how else you would> > > implement something like assume in the middle of the code.> >> > I'm researching that - it's part of figuring out how to> > communicate results without exceptions.> > I suppose you could call a function that somehow didn't return to the> caller... not sure how though.> 
 
I've been reading up a little bit on continuations (read this post: http://blogs.msdn.com/wesdyer/archive/2007/12/22/continuation-passing-style.aspx)
 
I'm still trying to make sense of this, I don't know whether F# would let us do more funky stuff like this?
 
As an aside - with theories, do we want our assumptions to return us immediately from the function (i.e. filtering), or flag that the theory code is expected to fail and then actually execute the code to check that it fails (i.e. validate the assumption).
 
> I have given up on that request completely. I see your point now that> I understand the framework and context better. You are right. I don't> necessarily want Assume to work for Test anymore, or even> IterativeTest. I would like it for Theory still, and will work with> Gary to see that it gets into his extension.> 
 
I like the Assume.That() syntax, but implementing it using exceptions will reduce the functionality currently in my extension. Maybe I could use a ThreadStatic flag?
> > > The proximity of the Assumes to the Asserts seems fundamental> > > to me in terms of expressiveness. Does that make sense to you> > > in the context of Theory?> >> > I like that aspect of David's implementation and it was my> > first choice of how to go. But I won't jump from that to> > the notion that no other way of doing it is possible, or> > maybe even better. Gary has implemented a different approach,> > for example. I want to write a non-trivial program using his> > implementation. Then I want to write my own. Then I feel like> > I'll be qualified to have a preference.> > Ok, that works for me.> 
 
I think one of the weaknesses of my approach is that the Assumes aren't inline with the code, but if we want to also think of theory explorers, we may want to "advertise" our assumptions in a different way, so that the tools can build up the datasets more intelligently?
> > Probably. But it's not the main point IMO. As a user, I> > don't throw an exception. I just Assume something. You're> > saying "As a user, I want to be able to make an assumption> > and have it verified. If it succeeds, the test continues.> > If it fails, the test terminates and succeeds." This> > doesn't make a lot of sense.> > Why not? That's what Assume means in all the literature. The only> variant is that if the test terminates in ALL cases of testing the> Theory, then it is not a success.> 
 
On my blog posts, I was saying that we would want to verify assumes (see my paragraph/reply a bit above to see what I mean). This isn't mentioned in the literature (that I can remember), and I'm not sure how useful this is in real life, but the idea of my extension was to keep all options open (well, put more functionality like this in, which could be removed later if it doesn't prove to be useful, rather than limit the functionality too soon - that's why I called it a prototype theory implementation).
Cheers,
Gary
_________________________________________________________________
Welcome to the next generation of Windows Live
http://www.windowslive.co.uk/get-live

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
nunit-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-developer