0

I am searching for a tool that can generate invalid data for xml.

I know data valid in one system might be invalid in other. Still some error like length, signs, repetition could be simulated. I do not found any good tool for that. It could be generated from xml or from xsd- from my point of view this does not matter.

5
  • 2
    XML has two levels of validation: 1) checking whether this is correct XML document, 2) checking whether this XML is compliant to XSD. Which one do you care about?
    – dzieciou
    Mar 12, 2014 at 14:45
  • 2
    Also, the way the question is written, checking that the data contained in the XML is correct.
    – Kate Paulk
    Mar 12, 2014 at 16:57
  • 2
    What volume of (invalid) XML is needed? Have you considered using a tool to generate valid XML, then modifying it (perhaps manually) to make it invalid in the ways you need? Mar 12, 2014 at 23:18
  • From my point of view both points : 1)checking if XML document is correct and 2) checking if it is ok with xsd are not important. I assume thay ok, and valid.
    – SkorpEN
    Mar 24, 2014 at 9:35
  • I want to generate problematic data (single space, invalid item, etc.). It could be done by mutation of valid xml, or by generating valid and then change. Any tool will be good starting point.
    – SkorpEN
    Mar 24, 2014 at 10:24

2 Answers 2

1

dzieciou is right, generating usefully broken XML cases you need to separate feeding in plain oldbroken XML and XML which breaks your schema (the application.) The latter is probably the most useful, because it is hardest to guard against, and a test program that generates valid xml using all the known elements and attributes your application recognizes by randomizing their ordering, their parent/child and so on will probably generate plenty of test-data. I have found SAX or parsing-based apps break if you change the order that nodes appear in the file for example.

So having some knowledge of the approach the application under test uses is going to save you some time.

1

Maybe you could modify your schema (many times, you may want to automate this), then generate bad data from the bad schema, and validate the bad data against the good schema to see if the data's bad. Let me know what you did for a solution. Thanks! Another thing to do is to generate a "bad" schema from a metaschema, and then generate XML from the generated "bad" schema.

1
  • I did not find automatic solution. Some sort of tools that insert into xml random data is from my point of view enough. Still it is far from automatic. So I guess in my situation is modyfing parts of xml(for example from bash or script). But I still miss part when data like int's are generated with all tricky cases (0,-1, max_Int, -max_int etc.).
    – SkorpEN
    May 7, 2018 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.