Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 67644 invoked from network); 12 Apr 2006 14:25:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2006 14:25:22 -0000 Received: (qmail 24637 invoked by uid 500); 12 Apr 2006 14:25:15 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 24573 invoked by uid 500); 12 Apr 2006 14:25:14 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 24562 invoked by uid 99); 12 Apr 2006 14:25:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 07:25:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [63.80.142.98] (HELO agile.mail.baypackets.com) (63.80.142.98) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 07:25:13 -0700 Received: from prasadsony ([208.188.93.129]) by agile.mail.baypackets.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 12 Apr 2006 07:26:26 -0700 Message-ID: <022101c65e3c$d88ac6a0$a95dbcd0@prasadsony> From: "Fasih" To: "Jakarta Commons Users List" References: Subject: Re: [SCXML] Document validation and testing (was: BUG: Inner States with no InitialState) Date: Wed, 12 Apr 2006 09:24:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 12 Apr 2006 14:26:26.0843 (UTC) FILETIME=[1534B6B0:01C65E3D] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Then, the validation and generation of test cases for path coverage around this transition has become one step easier. However, as you'll notice, this means that such support needs to be "layered" appropriately, the EL used needs to be amicable to introspection so the SCXML test tooling can be built on top of that, and so on ... There is more than meets the eye. Lets say, on connection.alerting I call a ccxml:accept, that's it. How do I proceed further, given that the custom action can expect something in the payload. I guess, what we want to do is not a model validation but a compilation. IMO compilation should be the first step. This is what I see compilation as. 1. Validate against DTD [Already in place] 2. Generate classes for events rather than allowing strings to be entered. Something like an abstract class Event {} And instead of saying new TriggerEvent we do a exec.fire(new ConnectionConnectedEvent()). This should help eliminate the common typos. Having an interface would be even better as it will ensure that we dont make a mistake like ConnectinConnectedEvent also and not to use it. 3. Generate warning when for an event when there is a cond like "a eq b" and not "! a eq b" More ideas can be put in.... Comments!! +Fasih ----- Original Message ----- From: "Rahul Akolkar" To: "Jakarta Commons Users List" Sent: Tuesday, April 11, 2006 5:11 PM Subject: [SCXML] Document validation and testing (was: BUG: Inner States with no InitialState) On 4/10/06, Fasih wrote: > I think that the validation will be quite some task. I started off > thinking > on how to go about it, the first problem is the PayLoad. I can generate > events, but what payload to use! At least in my case, there is a heavy > dependency on the payloads of the event. Any suggestions? Incidently, there happened to be a thread on one of the other lists (either struts or myfaces) that I only had a cursory glance at which talked about tooling for expression languages (or the lack thereof). Lets say we are given some "smarts" such that by introspecting this transition element: we get informed that this transition will be followed if and only if: * An event with name "event.foo.bar" is received * The payload has a readable property "foo" * The value of the payload's "foo" property is "foovalue" * The transition target "bar" exists [Commons SCXML already verifies the fourth bit at document parsing time.] Then, the validation and generation of test cases for path coverage around this transition has become one step easier. However, as you'll notice, this means that such support needs to be "layered" appropriately, the EL used needs to be amicable to introspection so the SCXML test tooling can be built on top of that, and so on ... A more down to earth approach may be to begin with a simple generic "SCXMLTestCase" that given a state machine, a list of events to be fired (already populated with payload instances) in some order, and the expected outcome at each step runs through that single execution to validate the test. This should be trivial, the Commons SCXML test cases pretty much do this. Further, small incremental conveniences can be added, for example, a generic payload class that wires readable properties via a CSV constructor argument can reduce the amount of procedural code to write to come up with a test case. A lot of introspection can be done on the Commons SCXML object model (barring the EL bits) to figure out the topology of the state machine i.e. a SCXML object exposes its child states, a State object exposes the candidate outbound transitions and so on ... that can be used to our benefit. Ofcourse, as we try things, more and better ideas will probably surface. This is all quite "researchy" in my mind, which is one of the reasons I find it interesting ;-) -Rahul > And yeah, If I do > manage to get something out, would definitely share it with Commons. > > +Fasih > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org