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 ... 11 12 13 14 15 16 17 18 19 ... 51  | » ]
Johannes Brodwall

Posts: 19
Nickname: jhannes
Registered: Jun, 2003

Embedded, in-memory databases Posted: Sep 11, 2005 3:34 PM
Reply to this message Reply
Advertisement
I agree with the rules, with one exception: "1. It talks to the database" is redundant. Using a database is only not a unit test when it also violates one of the other rules.

I unit test Hibernate mapping files using HSQLDB, an embedded, in-memory database. The database doesn't live on another server, it never touches the file system, it requires not configuration, and it gives complete seperation (one db per JVM). It takes a little time to initialize the test, but it is all due to Hibernate setting up.

As far as I am concerned, these tests are unit tests. If the database that they touched wasn't in-memory, they probably wouldn't be.

Other than this point, I am very much in agreement with the post.

Flat View: This topic has 50 replies on 51 pages [ « | 11  12  13  14  15  16  17  18  19 | » ]
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