Re: establishing logical test order?

"Pigneri, Rocco" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <D04B62A56C65EA4B860036108BD0A66C0258EA6E@boston-ex.lavastorm.local.com>
Dear David,

 

As you mentioned, that is not a natural feature of unit tests: unit
tests are by definition unrelated to each other and can be run in any
order without introducing failures.  However, if you wanted to group
tests-which seems like your goal-you have two options.  You can use
namespaces to hierarchically organize your tests into collapsible,
related groups.  Alternatively, you can join your four tests together
(here, T00-T03) into one test.  In this second option, you will see  a
failure in T00 without running T01 because T00's code will be run before
T01 and therefore cancel out execution of T01.

 

Granted, there are a lot of philosophical reasons not to use the second
option-and  a few for the first as well-but you seem to be aware of that
already.

 

Rocco

 

From: [email protected]
[mailto:[email protected]] On Behalf Of David
Jeske
Sent: Monday, June 23, 2008 12:50 PM
To: [email protected]
Subject: [Nunit-users] establishing logical test order?

 

How do you all go about establishing a logical test order?

So far, I'm using naming conventions in my TestFixture classes and Test
methods. They all start with "A##_", where ## is the level number of the
tests.

A00_BasicLowLevelStuff
   T00_SimplestConcept
   T01_MoreComplicated
   T02_StillMoreComplicated
   T03_MostComplicated
A01_NextLevelStuff
A02_HighLevelStuff
A03_MyApplication

Is this similar to what others do?

Note that this isn't about execution order of the tests. It's merely
about organizing the failures so I start looking at the earliest
failure. I've read that JUnit intentionally randomizes the execution
order, to help you assure that the tests are not dependent on the output
of other tests. That seems like a neat feature, and one NUnit might
consider in the future.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.