Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Unit Testing and Code Generation Expand / Collapse
Author
Message
Posted Friday, June 9, 2006 12:32 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 6:53 AM
Points: 13,890, Visits: 28,285
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/gFritchey/unittestingandcodegeneration.asp

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #286386
Posted Wednesday, June 21, 2006 12:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Sunday, July 25, 2010 12:00 PM
Points: 125, Visits: 20
Good work Grant..






Regards,
Sudheer 

My Blog

Post #288959
Posted Wednesday, June 21, 2006 7:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 30, 2006 5:28 AM
Points: 3, Visits: 1

I'm glad to see people starting to write about modern development techniques for relational databases.  I suspect that over then next two or three years we're going to see major changes with respect to how databases are developed and evolved.   We're clearly moving away from the serial approach favored by many data professionals to the evolutionary approach favored by application developers.

If you're interested in reading more about database regression testing, I suspect that you'll find http://www.agiledata.org/essays/databaseTesting.html to be an interesting read.

- Scott

Post #289047
Posted Thursday, June 22, 2006 6:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, February 8, 2013 6:52 AM
Points: 8, Visits: 40
This is an exciting development with the Visual Studio IDE. This is a big step forward in how to manage database additions and changes.
Post #289311
Posted Friday, June 23, 2006 12:28 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, January 19, 2011 2:35 PM
Points: 13, Visits: 50

Great article!

Post #289831
Posted Wednesday, June 28, 2006 10:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, January 20, 2009 3:33 PM
Points: 124, Visits: 13
I have a lot of interest in this topic. I'm glad you're taking TSQLUnit beyond the discussion I had in my article a couple of years ago (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlpro04/html/sp04i1.asp).

I followed you up to the point where you query sysobjects for a list of stored procedures and their parameters. After that things get murky for me. Seems that your statements that the individual programmer needs to determine expected results runs contrary to your efforts to generate templates.

You also have a note about running a comparison set between two data sets. I'm not quite understanding here. (It might be just me that's a bit slower than normal. I've traveled about 15,000 miles in the last couple of weeks.)




Steve Miller
Post #290834
Posted Wednesday, June 28, 2006 10:53 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, January 20, 2009 3:33 PM
Points: 124, Visits: 13
Scott, I'm glad to see you here. Your previous book has helped me a lot. Hopefully I can get your new book soon.

Steve Miller




Steve Miller
Post #290838
Posted Wednesday, June 28, 2006 4:52 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 30, 2006 5:28 AM
Points: 3, Visits: 1

Thanks.  The new book is called Refactoring Databases: Evolutionary Database Design and a description of it can be found at http://www.ambysoft.com/books/refactoringDatabases.html .  Although I'm obviously biased, I believe that it is one of those few seminal books which comes along that every data professional will want to read.  This is particularly true for the Microsoft community as the beta release of Visual Studio for Database Professionals ( http://msdn.microsoft.com/vstudio/teamsystem/products/dbpro/  shows rudimentary support for DB refactoring and testing.  Microsoft has a gotten a great head start on modern database development techniques.  I believe that the adoption of agile/evolutionary database development techniques will prove to be a fundamental shift in the data community, and database regression testing and database refactoring are primary techniques in your new intellectual toolkit.

The frustrating thing is that this new direction is coming from the agile community and not where it really should be coming from, the data management community.  Agilists are starting to raise the bar on data professionals, they had better start paying attention.

- Scott

Post #290951
Posted Thursday, June 29, 2006 5:18 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 6:53 AM
Points: 13,890, Visits: 28,285

Hello,

Sorry I didn't get back to you sooner, but I didn't get any alerts that there were posts on this article. I thought no one was reading it.

Several of us here have read your article and we used it as a template to get started. Thanks for your work.

Sorry I was unclear in the article. Yes, we're generating the templates, but not completely eliminating the need for a developer to build out an expected result set. It's just not something we've been able to come up with any method of automating. The main thing the generation does for us is eliminate a ton of typing since we build out the variable declaration and query execution, etc..

We built a query that compares two sets of data by simply doing a count of the table and a count of the union. If they're different, it fails the test. Simplistic and limited it may be, but it gets the job done. We had tried exporting data to XML & doing all kinds of other comparisons, but this simple approach seemed to work much better than the fancier ones.

So, the developers have to generate an expected test data set, run the proc to get the actual data set and run these into the assert proc to determine if they're the same.

Hopefully that sheds a bit more light on the matter. Sorry again for the lack of clarity. Thanks again for your article, it was a big help to get us started.



----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #291075
Posted Thursday, June 29, 2006 5:22 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 6:53 AM
Points: 13,890, Visits: 28,285

Woo Hoo! Scott Ambler!

Thanks for the response. I've read both your database books (Agile Database Techniques & Refactoring Databases) and have forced a few people in the organization to read the first one (I'm not finished with the second). It's great work and has really helped us align our database development with the Agile methods that the application developers have been working on.

I've read most of your web site (some of several times) and that's been a big help too. I'd also recommend people to subscribe to the Agile database email list.



----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #291079
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse