Re: unit testing on big'ish systems

From: Shane Mingins (shanemingins_at_yahoo.com.clothes)
Date: 01/10/05


Date: Tue, 11 Jan 2005 08:23:29 +1300


> Books on its way. Reading the contents page seems to suggest it'll be
> more for c++
> legacy code though.

I am a bit further thru and I would have to say that it is quite language
agnostic. There are some specific techniques/tips/tricks/mentions for some
languages brought to the readers attention, but overall the book would apply
to most languages. Where you would have issues is if you were applying it
to a language that did not have nUnit available to you.

I have not seen any techniques in the book for code in stored procedures.

>
> So ta for the book link, if you know anything more about databases
> and unit testing then please
> let me know.
>

So most of the behaviour you wish to test is in stored procedures, correct?

I would be thinking that the testing approach I may take would depend on
whether I am keeping the behavior in the stored procedure or whether I am
moving it out and into my domain model.

Have a look at the test-driven development group at Yahoo.
http://groups.yahoo.com/group/testdrivendevelopment/

There has been plenty of discussion on testing stored procedures and
databases. I am not sure if the "answer" has been found.

Any test that hits the database will be slow. One alternative is to use
some small in-memory database like HSQLDB http://hsqldb.sourceforge.net/

Not sure if http://sqlunit.sourceforge.net/ is of any help. I just came
across it with a google. I am guessing you probably want the C# equivalent.

Google certainly provided many pages that looked like they were worth a
read:

http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2003-37,GGLD:en&q=unit+testing+stored+procedures

HTH
Shane

--------------------------------------------------------------------------
"Our thinking was wrong - but our tests were not. Very interesting..." -
Ron Jeffries



Relevant Pages

  • Re: Relational Database
    ... about databases in general and RDB in particular. ... Most databases, as well as the SQL Standard, have the things Jim Starkey wishes for. ... PL/SQL-like language for stored procedures, ... I dislike stored procedures for administrative reasons. ...
    (comp.lang.cobol)
  • Re: Portable stored procedures
    ... > JDatastore lets you store binary streams outside the table scema. ... Other databases usually do not store BLOB's ... > you will have to write the function in the client in Java (or whatever ... >> stored procedures written in some proprietary language. ...
    (comp.lang.java.databases)
  • Re: Distributed object models / OO Databases
    ... Usually these applications would be used by a group of people, ... channel, written in one language. ... You have a number of programmers ... Now, a lot of databases will certainly be better off being relational, ...
    (comp.object)
  • Re: Quote from student, after teaching Pick
    ... People like the PICK model for its simplicity of language not its ... The data model is but one aspect of it, ... I have used Java a bit and PHP less against MV databases, ... I don't know which DBMS you are referring to. ...
    (comp.databases.pick)
  • Re: 12 Misconceptions
    ... generation barks out empty defeatist platitudes like: ... Besides, databases aren't anything stranger for me, If you'd take the ... It's called a querying language, ... Randall Hyde is a god for you, ...
    (alt.lang.asm)