0

I would like to develop an automated test framework for testing/verifying the data model of a Desktop application using Java. Basically, the approach I would like go for is to retrieve the data in to an excel file and assert against the data provided from the business. I am running in to questions here on :

  • What would be the ideal approach for a Test Framework for data model testing?
  • Are there any test frameworks that can adapt to my situation?
  • What are the things that need to be considered for a data model testing (fields, references and qualifiers.)

Any inputs is much appreciated. Thanks.

3
  • Could you give the example of what the datamodel consists of?
    – Alexey R.
    Jun 4, 2018 at 13:12
  • Thanks for your reply @AlexeyR. The Data model consists of 'Fields', 'properties' for each field, 'fieldTypes' etc which are all in XML format which I have them converted to Excel (Actual Data) to make it comparable with the Expected Data which is provided in Excel too.
    – Tester
    Jun 4, 2018 at 13:25
  • excel automation is messy and requires expensive dependencies that you can't really use in CI , XML is far easier to handle.
    – Amias
    Jun 4, 2018 at 15:36

1 Answer 1

1

I consider Excel a bad format for storing "data model" since it represents "flat" data and it is quite hard to treat them as the "model".

Since your model is originally stored in xml format the good choice for you would be xsd schema. A technology that is initially designed for validating the models described in xml.

If you need to compare flat data vs flat data I wouldn't call it a data-model testing. However if you need to convert your xml to flat-data you could make use of xlt-transformation that would traverse your data structure and bring it to a flat-format (likely csv, not true excel).

4
  • Yes, the Data model which is provided (as expected data) is a flat file and is in Excel (might have multiple sheets though). So, the actual data model though in XML, I am converting it to Excel to match the input type and perform the assertions on.. No a good idea you think?
    – Tester
    Jun 4, 2018 at 13:39
  • Yes, since when you convert any structured model to a flat model you miss meta-information about the structure.
    – Alexey R.
    Jun 4, 2018 at 13:43
  • Yes, that makes sense. okay, then I need to transform Excel (expected data) to XML to a XML structure that can be compared.. which can be done in Java pretty easily. Do you think, there is any framework that can support XML comparison here.
    – Tester
    Jun 4, 2018 at 14:06
  • I would still try to request xml from whoever provides you the golden-source, or the description of a model so that you could build xsd on your own. Since there would no reliable way to build structured data from the flat file. Apart from that Java SDK is delivered with jaxb framework that allows to easily parse any xml or validate xml schema using xsd files.
    – Alexey R.
    Jun 4, 2018 at 14:13

Your Answer

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

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