From: Greg M. <gre...@ya...> - 2001-11-16 21:28:51
|
I recently had a brief discussion with a couple of developers on the c2 wiki (http://c2.com/cgi/wiki?MockObject) regarding database testing & MockObjects. Here is an excerpt: <excerpt> I'm curious - for those of you out there who are using MockObjects to test JDBC code, do you typically have at least one unit test which uses a "real" database connection as a santiy check? Or do you keep live connections out of the unit testing altogether, letting this type of testing fall under the umbrella of "functional testing"? While I like the speed and focus of MockObjects for database testing, certain things about it make me nervous, e.g. SQL statements are not validated. --GregMerrill I'm currently getting big into database mock objects with VbUnitThree. I'm currently ignoring the issue of testing the real database objects. But I know this is a mistake; I'll have to come back and write unit tests for them, just like any other class. -- JeffGrigg OK, it bit me today: My unit tests didn't test the SQL, and so didn't catch a stray column. But that's OK, because the end-to-end functional tests (done in the same unit testing framework, only less often), caught the problem. No blood; no foul. (Yes, I still need to write unit tests for the SQL. I will, I will... ;-) -- jtg </excerpt> My question to this list is: would anyone be interested in an optional SQL validation feature on relevant mock sql objects (MockStatement/MockPreparedStatement)? Something along the lines of setExpectValidSQL(boolean)? When true, this property would validate the syntax of SQL statements on calls to executeUpdate() & executeQuery(). Very handy to ensure that dynamically-generated queries don't have syntax problems. I've created a prototype of such a feature, using a parser generated with JavaCC and a contributed grammar (http://www.cobase.cs.ucla.edu/pub/javacc/). It seems to work OK. (The grammar is a little Oracle-specific, but should handle standard SQL just fine.) Do you think this kind of feature would fit well in the mock objects core? Or does it seem more like an optional feature which should be released/maintained separately? And the bottom line - does basic SQL validation have a place in MockObject-style unit testing? Or should this type of responsibililty lie with functional testing, since the SQL validation which is actually done at runtime is database-dependent? -Greg Merrill __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com |
From: Vincent T. <Vin...@ge...> - 2001-11-16 21:48:46
|
One easy thing to do to complement your MockObjects testing is to test your expected SQL query string against the DB with a simple SQL query analyzer. Once you are sure of your syntax (providing that your table definition doesnt change) you can rely on MockObjects testing until functional testing. That's what we do and it hasn't reserved any bad surprise ... yet :-) -Vincent- -----Original Message----- From: moc...@li... [mailto:moc...@li...]On Behalf Of Greg Merrill Sent: Friday, November 16, 2001 4:29 PM To: moc...@li... Subject: [MO-java-dev] SQL validation I recently had a brief discussion with a couple of developers on the c2 wiki (http://c2.com/cgi/wiki?MockObject) regarding database testing & MockObjects. Here is an excerpt: <excerpt> I'm curious - for those of you out there who are using MockObjects to test JDBC code, do you typically have at least one unit test which uses a "real" database connection as a santiy check? Or do you keep live connections out of the unit testing altogether, letting this type of testing fall under the umbrella of "functional testing"? While I like the speed and focus of MockObjects for database testing, certain things about it make me nervous, e.g. SQL statements are not validated. --GregMerrill I'm currently getting big into database mock objects with VbUnitThree. I'm currently ignoring the issue of testing the real database objects. But I know this is a mistake; I'll have to come back and write unit tests for them, just like any other class. -- JeffGrigg OK, it bit me today: My unit tests didn't test the SQL, and so didn't catch a stray column. But that's OK, because the end-to-end functional tests (done in the same unit testing framework, only less often), caught the problem. No blood; no foul. (Yes, I still need to write unit tests for the SQL. I will, I will... ;-) -- jtg </excerpt> My question to this list is: would anyone be interested in an optional SQL validation feature on relevant mock sql objects (MockStatement/MockPreparedStatement)? Something along the lines of setExpectValidSQL(boolean)? When true, this property would validate the syntax of SQL statements on calls to executeUpdate() & executeQuery(). Very handy to ensure that dynamically-generated queries don't have syntax problems. I've created a prototype of such a feature, using a parser generated with JavaCC and a contributed grammar (http://www.cobase.cs.ucla.edu/pub/javacc/). It seems to work OK. (The grammar is a little Oracle-specific, but should handle standard SQL just fine.) Do you think this kind of feature would fit well in the mock objects core? Or does it seem more like an optional feature which should be released/maintained separately? And the bottom line - does basic SQL validation have a place in MockObject-style unit testing? Or should this type of responsibililty lie with functional testing, since the SQL validation which is actually done at runtime is database-dependent? -Greg Merrill __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com _______________________________________________ Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: <moc...@li...> - 2001-11-17 09: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YXRlIGZlYXR1cmUgdG8gbWUuIERvIHBlb3BsZSB0aGluayBpdCBzaG91 bGQgYmUgaG9zdGVkIG9uIHRoZSBNb2NrIE9iamVjdHMgcHJvamVjdD8NCg0KU3RldmUNCg0K |
From: <moc...@li...> - 2001-11-18 14:04:04
|
As we are all about testing - I would like to see someone put some work into testing SQL this way - it sounds cool. As you pointed out steve - there is an art to testing just the right amount so it would be interesting to see how this works out - but in theory why not work on it here and see how it pans out? Tim > the other thought that strikes me is that we know that test-first > changes the way we write our code (to make it testable). I would > expect that writing db access for testability would change the > way we write SQL. Has anyone noticed this? > > > I've created a prototype of such a feature, using a > > parser generated with JavaCC and a contributed grammar > > (http://www.cobase.cs.ucla.edu/pub/javacc/). It seems > > to work OK. (The grammar is a little Oracle-specific, > > but should handle standard SQL just fine.) > > > > Do you think this kind of feature would fit well in > > the mock objects core? Or does it seem more like an > > optional feature which should be released/maintained > > separately? > > It sounds like a separate feature to me. Do people think it > should be hosted on the Mock Objects project? > > Steve > > 2$¡¸ÞrÛ#jözùX§X¬´ÊãyËl«ÚuëåËl²«qçè®§zØm¶?þX¬¶Ë(º·~à > zwþX¬¶ÏåËbú?$¡¸ÞrÛ#jö |
From: Greg M. <gre...@ya...> - 2001-11-18 20:58:51
|
Why don't I finish the prototype & pass it along to you guys. Then you can decide if it's worth inclusion in the project, and if so, in what capactiy. --- moc...@li... wrote: > As we are all about testing - I would like to see > someone put some work into > testing SQL this way - it sounds cool. As you > pointed out steve - there is > an art to testing just the right amount so it would > be interesting to see > how this works out - but in theory why not work on > it here and see how it > pans out? > > Tim > > > the other thought that strikes me is that we know > that test-first > > changes the way we write our code (to make it > testable). I would > > expect that writing db access for testability > would change the > > way we write SQL. Has anyone noticed this? > > > > > I've created a prototype of such a feature, > using a > > > parser generated with JavaCC and a contributed > grammar > > > (http://www.cobase.cs.ucla.edu/pub/javacc/). It > seems > > > to work OK. (The grammar is a little > Oracle-specific, > > > but should handle standard SQL just fine.) > > > > > > Do you think this kind of feature would fit well > in > > > the mock objects core? Or does it seem more > like an > > > optional feature which should be > released/maintained > > > separately? > > > > It sounds like a separate feature to me. Do people > think it > > should be hosted on the Mock Objects project? > > > > Steve > > > > > 2$¡¸ÞrÛ#jözùX§X¬´ÊãyËl«ÚuëåËl²«qçè®§zØm¶?þX¬¶Ë(º·~à > > zwþX¬¶ÏåËbú?$¡¸ÞrÛ#jö > > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com |
From: Steve F. <st...@m3...> - 2001-11-18 21:53:48
|
V2UgY2FuIGFsd2F5cyBob3N0IGl0IHdoZW4geW91J3JlIHJlYWR5IGFuZCBzZWUgaWYgdGhlcmUn cyBhbnkgdGFrZSB1cC4NCg0KU3RldmUNCg0KRnJvbTogIkdyZWcgTWVycmlsbCIgPGdyZWdobWVy cmlsbEB5YWhvby5jb20+DQo+IFdoeSBkb24ndCBJIGZpbmlzaCB0aGUgcHJvdG90eXBlICYgcGFz cyBpdCBhbG9uZyB0bw0KPiB5b3UgZ3V5cy4gIFRoZW4geW91IGNhbiBkZWNpZGUgaWYgaXQncyB3 b3J0aCBpbmNsdXNpb24NCj4gaW4gdGhlIHByb2plY3QsIGFuZCBpZiBzbywgaW4gd2hhdCBjYXBh Y3RpeS4NCg0K |
From: Steve F. <st...@m3...> - 2001-11-18 21:00:34
|
RnJvbTogPG1vY2tvYmplY3RzLWphdmEtZGV2LWFkbWluQGxpc3RzLnNvdXJjZWZvcmdlLm5ldD4N Cj4gQXMgd2UgYXJlIGFsbCBhYm91dCB0ZXN0aW5nIC0gSSB3b3VsZCBsaWtlIHRvIHNlZSBzb21l b25lIHB1dCBzb21lIHdvcmsgaW50bw0KPiB0ZXN0aW5nIFNRTCB0aGlzIHdheSAtIGl0IHNvdW5k cyBjb29sLiBBcyB5b3UgcG9pbnRlZCBvdXQgc3RldmUgLSB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bP5VPLYp36P3M/JKG43nLbI2r2nQ0KPiANCj4gDQo+IF9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IE1vY2tvYmplY3RzLWphdmEtZGV2IG1haWxp bmcgbGlzdA0KPiBNb2Nrb2JqZWN0cy1qYXZhLWRldkBsaXN0cy5zb3VyY2Vmb3JnZS5uZXQNCj4g aHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vbW9ja29iamVjdHMt amF2YS1kZXYNCj4gDQo= |
From: Greg M. <gre...@ya...> - 2001-11-18 20:56:20
|
> > And the bottom line - does basic SQL validation > have a > > place in MockObject-style unit testing? Or should > > this type of responsibililty lie with functional > > testing, since the SQL validation which is > actually > > done at runtime is database-dependent? > > my (doubtless naive) take on this is that is that > most SQL is either simple (pop a couple of values in > a query) or dreadfully complicated. For the former, > all you really need to check _in the unit test_ is > that the right values get passed through, which you > can probably do with a simple substring match. > There's a bit of an art to specifiying the minimum > that is important in a unit test. For the latter, > you probably want a separate object to generate the > SQL which would be tested away from the JDBC -- in > which case your parser might be appropriate. This take is not naive, but is in fact quite consistent with my experience. I think queries typically do fall into the two categories you mention: trivially simple or flat-out ghastly. I also agree with the notion of "a separate object to generate the SQL" in complex cases; for example, I use a "Query" object with methods like addSelect(), addFrom(), and addWhere(). Using this object helps ensure that for complex queries, all the punctuation & conjunctions separating various parts of the query end up in the right places. Nevertheless, mistakes are still occasionally made in both the simple and complex types (particularly when making changes to pre-existing code), and SQL syntax errors just _feel_ to me like they should be detectable earlier in the testing process. I say this because what is and isn't valid SQL syntax is not going to change during the life of the project, as something such as the db schema will. > Of course, this kind of development also requires a > higher-level test to make sure you haven't drifted > away from the schema. For a small application, that > would probably be your acceptance tests (or whatever > we're calling them now). For a large application, > you might have some DB integration tests. > > the other thought that strikes me is that we know > that test-first changes the way we write our code > (to make it testable). I would expect that writing > db access for testability would change the way we > write SQL. Has anyone noticed this? Interesting notion. I think most folks currently test db access which falls outside of the JDBC API (e.g. the SQL itself) not with unit tests, but with "acceptance tests" and "DB integration tests", as you have mentioned. Until unit-like facilities are available in the db access domain, I don't imagine we'll know the answer to this question. > > I've created a prototype of such a feature, using > a > > parser generated with JavaCC and a contributed > grammar > > (http://www.cobase.cs.ucla.edu/pub/javacc/). It > seems > > to work OK. (The grammar is a little > Oracle-specific, > > but should handle standard SQL just fine.) > > > > Do you think this kind of feature would fit well > in > > the mock objects core? Or does it seem more like > an > > optional feature which should be > released/maintained > > separately? > > It sounds like a separate feature to me. Do people > think it should be hosted on the Mock Objects > project? The more I think about it, the more I agree with you on this point. The Oracle-specificness of the grammar alone suggests to me that this is not core functionality. -Greg __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com |