-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document test failure reasons #3
Comments
Regarding option 1: That's a serious bit of work, compared to option 2 - building a library of messages. If I understand you correctly for example for "sampleModel.allNumeric" expression definition in the sampleModel/plugin.xml we shall define a human readable display message, such as "Selection should only contain numeric values"? You mentioned that
Could you explain or give an example? I imagine that ideally with a well structured reusable expression definitions, context won't matter that much. |
Hmm, something like "A frequency dataset is required". Or, whilst the test may be an "AND" for "has location", "has course", "has speed", our user-oriented message for the AND failure could be "Requires a composite track". |
Hmm, I've had a play. Whilst I can change the schema to include documentation elements, and the XML file still gets read in, the content is ignored by Eclipse (which I'm pretty sure is what you said). This may offer an alternative strategy. What if we also read the XML code into a DOM object. Then, use XPath (or similar) to navigate to the comment/supporting content for a particular entry. Is this worth further consideration? |
I think with this we'll avoid trying to extend the EXSD schema. I had some doubts that the Eclipse Plugin editor might drop elements not contained in the schema when you do save the plugin.xml, but it's not the case - I also tested with custom "fail" documentation elements/attributes, and those are preserved. Regarding the "Requires a composite track" user message for the AND(hasLocation, hasCourse, hasSpeed) expression. Could this expression have different user message in a different context? If not, we can follow approach 2 for it. This means it will be contained in a separate definition like "requiresCompositeTrack", and then we could have a property file containing the message |
On 28th Feb Dinko said:
That strategy sounds just like what I was hoping for. Having the user feedback in there with the actual content will make things much easier to maintain & understand. @dinkoivanov - I'd appreciate you exploring this further. |
How will those failure messages be presented to the user? Imagine the following applicability expression:
In case one of the inner ANDs fail, the outer will fail as well - what should be the message then? Shall we show only the outermost message? Showing all the fail messages will make the task harder, since we'll need to also convey the expression data somehow - whether it's an AND/OR node, etc. |
Ok, we'll imagine that the track is missing a "course" attribute. Somewhere, we'd declare that failing "hasCourse" is presented as: This could be declared as a "failMessage" for , or somewhere centrally. So the error message for a track that omits both course and speed would be: Selection invalid, reasons as follows:
|
I did some exploratory work in a separate branch here: |
That's clear, however the "because of" relationship might not be clear. For example if sizeBiggerThanZero failed too, there'll be a "Requires multiple elements" message on bottom and it won't be clear whether "Needs multiple..." or "Requires a composite ..." failed due to sizeBiggerThanZero. |
Yes, maybe something like this (I've used characters to force the indent). Selection invalid, reasons as follows:
|
The presentation is checked in. Failure reason related classes are moved to a separate package - samplemodel.failurelog.
And here is the result when a String and a Date are selected:
In essence there is an ExpressionLogger class, that is invoked during expression evaluation (In the CustomExpression class). It creates a hierarchical structure of LoggerNode instances, to represent the failure messages at specific parts of the expression. |
Yes, I saw the screenshot of your code earlier on, it looks great (the indent-level code is clever). I may not get chance to test this until later this week. |
We wish to let users learn more about the applicable elements for operations.
This will show them why the current selection isn't applicable to a particular operation. It will also teach them what kind of elements that an operation will apply to.
In my original spec, I did hope to include the text in the applicable tests:
debrief/limpet#65 (comment)
But, I appreciate that if they aren't available in the parent schema, then we can't use them.
It would be great, however, if we could add these string attributes to the applicable tests - then our logic code can display text to a user regarding the specific test that failed.
So, these appear to be the options (in descending preference order, IMHO):
Would you mind considering/investigating these?
The text was updated successfully, but these errors were encountered: