It's been a little while since I gave an update on where the PsychoPath XPath 2.0 processor stands from a W3C Test Suite compliance point. Mukul Gandhi (note: nudge him to get his blog on Planet Eclipse since he is an Eclipse committer now) and I have been working our way steadily through the entire test suite. Here are the current results:
Tests: 8137
Failures: 988
Errors: 42
Code Coverage according to ECLEmma:
The test suite now covers about 76% of the PsychoPath. I suspect that we will be close to 80% to 85% code coverage by the time we complete the test suite. When we started we had about 30 or 40 tests that covered about 20% of the code. Unless you run the coverage analysis with a tool like ECLEmma you really do not know how much of your code is actually being executed by your tests. Trying to get to 100% coverage is not worth doing, getting to above 75% is worth doing and should be worked toward.
XPath 2.0 Castable, Durations, and Date/Times:
This has been the bane of my existance for the last several weeks. Reading the W3C specifications on when something can be cast and when something shouldn't be cast can give one a headache pretty quickly. Luckily the XPath 2.0 and XQuery 1.0 Functions Specification has this nice handy table:
The SeqCastableTest test suite covers about 648 test cases for the core specification. PschyoPath now passes all of these tests. With out the above table, trying to figure out the wording of the specification can be difficult at best, and just plain maddening at worst.
The Natives Will Byte You!
One thing that constantly was biting me was the imprecision that the Java primitive types have. PsychoPath in it's original implementation used the Integer, Double, and Float classes exclusively. The problem was that in many cases, especially during IntegerLiteral and DecimalLiteral parsing or creation, these were either too small to hold the numbers the tests wanted, or their precision was not accurate enough. A good explanation of the reason can be found in "Double Precision Numbers". Switching where need to BigInteger and BigDecimal solved many of these issues.
Dates are still another pain to deal with especially calculations. Again you start to run into a precision issue, where some numbers are stored too low. I did some experimentation and both the com.ibm.icu.util.GregorianCalendar and the built in Java GregorianCalendar have precision issues, some in the same place others not. I had thought about trying to leverage Joda Time but that was previously turned down by Eclipse IP team due to pedigree concerns.
I dread debugging these issues. Dates and Time calculations give me a headache.
What's left:
Lots. There are several core functions that are not working or are missing. Some logic expression errors to correct, and a few more lexer/parser issues to address. Overall though, PsychoPath passes about 88% of the W3C Test Suite, so is much more compliant than it started out. Credit still has to be given to Andrea Bittau, the original author, for a well designed implementation, and some very clean and easy to maintain code. Compared to some of the code I've worked on at Eclipse, this is just a pleasure to work with.
All current changes are in the WTP Source Editing CVS Repository.
Eclipse: PsychoPath XPath 2.0 Processor Update
About Me
- David Carver
- My technical interests include XML, agile development, open source projects, and improving business to business standards development. At Eclipse.org I serve on the Architecture Council, and I'm a committer on the WTP Source Editing project focusing on XPath 2.0, XSLT, XML, and DTD development. I also help with the WTP Incubator VEX, XQuery, and RelaxNG development. View my linkedin profile.

Intellectual Cramps by David Carver is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Based on a work at intellectualcramps.blogspot.com.
Archives
-
▼
2009
(189)
-
►
November
(12)
- Testing Cramps
- eXist 1.4, Love It...Hate it...Love it!
- Individuals 149, IBM 132
- Functional Testing Builds
- PsychoPath 1.1M3 a Java 5 (1.5) or greater XPath 2...
- Do Eclipse Projects need to roll out Patches faste...
- Performance Tuning an Athena/Hudson build
- Eclipse XSL Tools gets SAXON Debugging Support
- SWARM for the Community
- XPath 2: Collections and PsychoPath
- Eclipse Documentation on the Wiki
- Making it Easy for Contributors to Contribute
-
►
October
(14)
- VEX (Visual Editor for XML) gets some life
- Bad Habit in Design: Concentrating on the 20%
- IDs Need to be Published
- Eclipse DemoCamp - Columbus, OH
- Model the Data not the Form
- API Design is easy...Good API Design is HARD
- XQDT now at Eclipse
- The Problem of Exporting Everything
- User Defined Schema Types and PsychoPath
- XSL Aware Outline Part II
- XSL Aware Outline
- Yellow Does Not Equal Green/Blue
- Vendor Lock In
- Small Bits and Pieces
-
►
September
(11)
- Common Eclipse Build Failures and Causes
- XSL Tools 1.0.2 Released
- XSLT Processor Extensions Part III
- Builds: We make them complicated - Follow Up
- XSLT Processor Extensions Part II
- XSLT Processor Extensions
- Builds: We make them complicated.
- Standards, Documentation, Single Sourcing, and Con...
- A Hudson Transition
- Messy Syntax??
- XML Security Tools 0.5
-
►
August
(16)
- Cramps on Single Sourcing with Wikis
- Dangers of Standards Profiles
- XSL Tools Tip: Run Last Transformation
- Fresh Meat
- Operating System Colors and CSS
- PsychoPath 1.1M1 Available
- Mylyn-Mantis Connect 3.0.5
- Eclipse Documentation Guidelines
- WikiText and DocBook almost valid/well-formed
- Installing Eclipse SDK into a Product = Bad Mojo!
- Single Sourcing from a Wiki
- PsychoPath 1.1 User Manual
- Testing Words of Wisdom
-
▼
July
(19)
- Athena Common Builder and XSL Tools
- DocMan, Joomla, and Redirection
- Build Types Cramps
- Highlighting Changes when Single Sourcing
- Standards Organizations Need Issue/Change Tracking...
- Some Random Cramps
- WYSIWYG XML Editting
- Eclipse: RelaxNG Tools Editor
- XPath 2.0: IF . THEN . ELSE ....RESOLVED!
- The MUST Have Eclipse T-Shirt
- Eclipse: XQDT 2.0 Released
- XML IDE for Eclipse
- Eclipse: The Bare Minimum of XML Editing
- The Latest HOT Term
- Eclipse: PsychoPath XPath 2.0 Processor Update
- XText for RelaxNG Update
- UntypedAtomic and YearMonthDuration Casting Questi...
- XText for RelaxNG
- Eclipse Galileo: Setting up PDT 2.1 and XDebug sup...
-
►
November
(12)
Categories
- agile (64)
- agora (1)
- ant (2)
- bliteotw (2)
- bugday (2)
- build (20)
- cms (1)
- css (1)
- dita (12)
- docbook (25)
- docman (1)
- documentation (16)
- dr horrible (1)
- dvcs (2)
- e4 (1)
- eclipse (342)
- encryption (1)
- galileo (1)
- home theater (1)
- java (1)
- joomla (3)
- linux (2)
- mantis (5)
- mono (1)
- mylyn (6)
- netflix (1)
- open source (7)
- osgi (3)
- pde (4)
- pdt (1)
- performance (3)
- php (5)
- refactoring (21)
- referring (1)
- relaxng (3)
- release engineering (17)
- reviews (1)
- schematron (1)
- scrum (6)
- security (3)
- silverlight (1)
- soccer (1)
- standards (32)
- standards. (2)
- summer of code (2)
- testing (31)
- testing. (1)
- ubuntu (2)
- web services (3)
- wiki (1)
- wsdl (1)
- wsi (1)
- xforms (2)
- xml (219)
- xpath (21)
- xquery (14)
- xsd (1)
- xsl (50)
- xslt (43)
- xtext (3)
- year end review (1)
- zombies (1)
Nice reference to the wonderful EclEmma plugin and good code coverage rate for such a number of LoC, well done!