Re: [widgets] Test Suite for Packaging and Configuration

Hmm, well as you really can only test observable behaviour - and the  
behaviour of a widget is really what the A&E spec is concerned with...  
I can see the problem we have here.

If we completed the "widget catalogue" Atom feed profile we mooted a  
while back that would also give us another behaviour to test with (as  
in, you can ask a UA "what widgets do you have?" and check the  
catalogue metadata fits with the test cases).

It could be a good sanity check - if an element in P&C has no effect  
on any behaviour that we can observe, what is it there for? Should it  
be exposed in A&E? Or in a widget catalogue feed?

S


On 7 Aug 2009, at 17:33, Marcos Caceres wrote:

> I'm wondering, for the sake of testing, should we mandate the that in
> order to run the test suite a user agent support the widgets A&E
> specification? This would kinda sucks because we say in the spec that
> a UA is not required to support of the Widgets A&E spec. However,
> without the A&E spec, testing becomes a bit more difficult.
>
> For example, consider the following testable assertion:
>
>  "If this is not the first name element encountered by the user agent,
> then the user agent must skip this element."
>
> The test would be:
>
> <!-- To pass, the second name element must be skipped by the user  
> agent -->
> <widget xmlns="http://www.w3.org/ns/widgets">
>  <name>PASS</name>
>  <name>FAIL</name>
> </widget>
>
> However, there is no way to visualize this test without using the
> widgets A&E spec:
> <!doctype html>
> <html>
> <body style="background-color:red">
> <script>
>   body = document.getElementsByTagName("body")[0];
>   if(widget.name == "PASS"){
>      body.setAttribute("style","background-color:green");
>      body.innerHTML = "<h1>PASS </h1>";
>   }else{
>      body.innerHTML = "<h1>FAIL</h1>";
>   }
> </script>
>
> Actually, there are some tests that cannot even be visualized with the
> A&E spec... e.g., testing the <license> element, whose content is not
> exposed via any attribute of the widget object. The only way for a UA
> to verify if it passed, is to dump its internal representation of the
> Configuration Defaults table.
>
> Other things that suck about adding support for A&E is that tests are
> no longer atomic. To actually get widget.name, about 100 other
> preconditions need to have occurred.
>
> Thoughts? Or have I answered my own question (don't test with the A&E
> spec! :) )?
>
> Kind regards,
> Marcos
>
> --
> Marcos Caceres
> http://datadriven.com.au
>

Received on Friday, 7 August 2009 18:48:13 UTC