XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] How many unit tests should I create for my XML application?

On 11/24/2012 1:29 PM, Costello, Roger L. wrote:
> Hi Folks,
>
> I am building an XML application. That is, my application consumes XML documents and then performs processing. The XML documents conform to an XML Schema.
>
> How many unit tests should I write for my XML application?

The usual approach to measuring test coverage is to look at what 
percentage of your source code (generally measured by lines, or 
sometimes also branches of conditionals when those don't correspond to 
lines) is exercised by the test suite.  There are a lot of tools for 
doing this w/Java and other programming languages.  We recently 
developed one for XSLT that uses Saxon's CodeInjector; I am hoping we 
will be able to release it as open source some time in the not too 
distant future. It does measure coverage by lines, and although that 
does seem a bit weird for XSLT it is a good enough approximation I think.

It sounds as if you are interested in testing your schema rather than an 
actual application as I would think of it?  I'm not sure how difficult 
it would be to create a test coverage tool for XML Schema validation, 
but it should in theory be possible to instrument the validator, and 
count the number of distinct lines exercised by your test suite, and 
even produce a report showing which ones those are, so you can continue 
to improve your coverage by focusing new tests on areas with coverage gaps.

-Mike Sokolov


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS