[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Cost of catching data errors at the periphery during XML validationvice inside the system, during application processing?
- From: "Costello, Roger L." <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Fri, 10 Oct 2014 14:27:29 +0000
Hi Folks,
Have you done a cost analysis of catching and dealing with data errors during XML validation (at the periphery, before the data has gone into the system) versus catching and dealing with data errors during application processing (after the data has gotten inside the system)?
I am guessing that the relative costs are something like this:
Cost during XML validation: $1
Cost during application processing: $1000
That is, it's a thousand times more expensive to deal with erroneous data once it's gotten inside the system than to catch and deal with errors at the periphery, via XML Schema (or Relax NG schema or Schematron schema) validation. I am making up those figures; I want to know if someone has real figures.
Here's a scenario to illustrate:
A client creates an XML document and sends it to a web service. The XML document contains data about an aircraft, including its takeoff weight. Due to a bug in the client's software (or perhaps the error is a malicious attack), the XML document contains this:
<TakeoffWeight units="pounds">-12000</TakeoffWeight>
The value for takeoff weight is a negative value, which is clearly an error.
The web service receives the XML document and (at the periphery of the system) validates it against an XML Schema. The schema has a well-constrained declaration for TakeoffWeight:
<xs:element name="TakeoffWeight">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="weightType">
<xs:attribute name="units" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="pounds" />
<xs:enumeration value="kilograms" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:simpleType name="weightType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0" />
<xs:maxInclusive value="100000" />
<xs:fractionDigits value="2" />
</xs:restriction>
</xs:simpleType>
Schema validation detects the error and the web service immediately deals with the error (which might include dropping the XML document on the floor).
Alternatively, suppose the web service receives the XML document and validates it against an unconstrained XML Schema, which has this:
<xs:element name="TakeoffWeight" type="xs:decimal" />
Or worse, the web service doesn't do any validation and immediately hands the XML document off to an application to process it.
The data error is not immediately detected and the erroneous XML document insidiously winds its way deeper and deeper into the web service's system. At what cost?
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]