Information Technology Reference
In-Depth Information
Assert.AreEqual(((Word)(list[0])).PartOfSpeech, "adj");
session.Close();
}
}
}
This test does a couple of things that cause the total test time to
increase, and it is also more complex to configure. First, the test seeds
a database via NDbUnit, 3 which is a database seeding framework. In
this case, NDbUnit does an insert of the data found in the XML file
XMLFile2.xml, which also means an XML parsing step. This test case
then configures NHibernate , and then a test is run and a word is
retrieved from the database.
Any wonder why this test takes four seconds to run? Each addi-
tional test case in this class may not add too much time; however, execute
this ten more times and the total time is now approaching a minute.
System Tests
System and functional tests, which require a fully installed system,
take the longest to run. Additionally, the complexity of configuring a
fully functional system occasionally limits the full automation of these
tests. Running system tests with every commit build could be a recipe
for disaster, but sometimes these types of tests are run with secondary
or periodic builds. Otherwise, nightly (off-hour) runs are good for
these tests.
The next time you add a test case to your build, consider the long-
term implications of running all of your tests, and then start optimizing
your build to categorize your tests so you can stage their execution.
Write Tests for Defects
Developer testing and CI may decrease the frequency of software
defects, but the fact of the matter is that defects will still occur . That's
3. NDbUnit is an open source project for .NET, available at www.ndbunit.org/.
 
Search WWH ::




Custom Search