From: Curt S. <cj...@cy...> - 2002-05-31 06:43:00
|
On Thu, 30 May 2002, Kent Beck wrote: > At the risk of sounding like a broken record, shared setup is a symptom of > excessive design coupling. It's a design problem, and can't be solved with > testing techniques. I think you misunderstand what I'm trying to say. The "shared setup" is nothing to do with design coupling in the code being tested, since there's nothing at all (except a desire for efficiency) stopping you from re-doing your entire setup every time. In fact, there is already some shared setup done when using JUnit; we don't start a new JVM for each test when running a group of tests, for example. We could, and that would make running a set of five tests together more like running each of those five tests separately, but doing that for all the tests in the project would lengthen testing time considerably. > Once all duplication of database access logic and structure has been > eliminated, you should be able to easily replace the real database with an > in-memory spoof. Good try. But an in-memory spoof just isn't the real database, and doesn't have the syntax variations, bugs and other quirks that the real database has. (It's got its own, different set.) If someone touches a database-accessing method, I insist in most cases that there be unit tests for it that can run against every database the product uses, and that they all be run before the code is committed. A spoof can work for higher-level stuff, of course. > A small number of tests that confirm the correspondance of > the spoof with the real database should serve to provide confidence that the > system is working correctly. Yeah, well, the work to write a spoof that would duplicate all of the syntax variations, quirks and bugs in, say, a particular version of MS SQL Server and JDBC driver would take a lot more than a "small number" of tests, and just writing the spoof itself would be a huge job. cjs -- Curt Sampson <cj...@cy...> +81 90 7737 2974 http://www.netbsd.org Don't you know, in this new Dark Age, we're all light. --XTC |