RE: [Cppunit-devel] Parameterizing tests by using XML
Brought to you by:
blep
From: Moran Ben-D. <mbe...@ii...> - 2002-07-19 14:20:14
|
I'd just like to add to the discussion with a point about usefullness of parameterizing tests.. The protocol for passing parameters to tests cases that I'm actually looking for is one which allows my command line tools to pass in variables to my tests.. that is.. I always create a command line tool for running the tests for the case where i need to check the validity of component on a remote system for support, etc.. thus, my tests have several contexts in which they run: 1. development (my machine) 2. qa (centralized server) 3. other developers machines 4. production (which can often mean two machines if there is a staging server) Just thought I throw this into the salad of parameterizing tests.. XML in my case is too beaurocratic to run in the case of the QA or production servers.. i need a quick way of running a parameterized test and XML as simple as it is, still ends up costing too much effort on my part (e.g. with issues like is the installed xml parser version correct, does it work properly, etc.) moran -----Original Message----- From: Robert Wenner [mailto:ro...@po...] Sent: Friday, July 19, 2002 3:01 AM 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. 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. Just my 2 cents, Robert ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |