The Artima Developer Community
Sponsored Link

Weblogs Forum
A Set of Unit Testing Rules

50 replies on 51 pages. Most recent reply: Jan 21, 2011 2:19 AM by Steve Merrick

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 50 replies on 51 pages [ « | 1 ... 10 11 12 13 14 15 16 17 18 ... 51  | » ]
Rik Hemsley

Posts: 1
Nickname: rikkus
Registered: Aug, 2005

Re: A Set of Unit Testing Rules Posted: Sep 11, 2005 2:17 PM
Reply to this message Reply
Advertisement
It's difficult to write tests for an application which uses a database as its persistent store if you have a rule that you can't access the database.

One application I'm working on currently has about two hundred tests. Each test which accesses the database takes around a tenth of a second. Running the suite takes twenty five seconds.

Each of the database tests' SetUp methods contacts SQL Server, creates a new database with an unique name, builds the structure of the database using a script, then populates the database with enough data for the test to run. TearDown simply drops the test database.

Many of the tests access the filesystem.

I run my suite of tests approximately once every ten minutes. I can let the tests run while I carry on working (I use TestDriven.NET) or, as I do more usually, sit back and decide what to do next.

I think it's fine for a test run to take a minute or even two, so long as it can be done in the background. Any longer and it might feel like you weren't getting the quick feedback you want. If you've broken something, you don't want to have made five minutes' worth of edits before you discover it.

Flat View: This topic has 50 replies on 51 pages [ « | 10  11  12  13  14  15  16  17  18 | » ]
Topic: Computer About to Play Jeopardy Previous Topic   Next Topic Topic: The Search for Requirements

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use