RE: [Cppunit-devel] Parameterizing tests by using XML
Brought to you by:
blep
From: Michel A. <Arm...@si...> - 2002-07-19 07:21:35
|
> -----Original Message----- > From: Robert Wenner [mailto:ro...@po...] > Sent: Freitag, 19. Juli 2002 09:01 > To: Michel Armin; cpp...@li... > Subject: Re: [Cppunit-devel] Parameterizing tests by using XML > > > Hi, > > On Friday 19 July 2002 08:36, Michel Armin wrote: > > Hi all. > > > > Actually I was thinking about a little bit different solution here. > > It differs mainly in two points: > > > > 1. the framework should be responsible for parsing the xml file and > > invoke the test with a particular set of parameters (as opposed to > > let each of the test cases perform the parsing) > > > > 2. the DTD of the xml file is a less sophisticated > > These are _very_ important points -- you would not want to need test > cases for your test cases, right? > > I still see two big drawbacks on using a XML driven test. > > First it drops the advantage of having the tests written in the same > language as the code under test. Developers have to learn another new > language / syntax / semantics and can not focus on their real work. > Even though XML looks easy, it has some pitfalls you will most likely > uncover and which will cost really lots of time, nerves, and sanity. That's of course true, but I do not want to get rid of the current flavor of programming tests; I just want to add a new possibility to write tests. > Second I don't think the XML overhead justifies the results. How many > tests do you have that run the same way that you just need to > exchange > the input and output values? (And how many of those use primitive > inputs and outputs?) If I ever have to write more than three > tests for > the same method, I think hard about abetter design, usually > the method > has just too much responsibilities. Actually almost all of my tests would benifit from such a parameterized testing approach. (Most of our code is concerned with manipulating images. Of course, we support a number of different types of images. Our functions should be able to deal with all of these types of images in a transparent way. If I have a possibility to parameterize the type of the image used for a test, I could greatly improve the test coverage.) Armin. |