testing-strategies

testing strategies: generating a XML file


I'm writing a couple of classes that generate xml file. (Details probably not important at the moment).

I wondering the best testing strategy is.

Options that come to mind:

Virtual Bonus if you know any libraries for C++ and/or Google Test.

Ideas?


Solution

  • Have you considered using XSD's and validating your XML to the XSD? You didn't mention if it was content or structure you were testing for (probably both).
    If it validates, it will test the structure of the XML will conform to the required structure.