Welcome, Guest
Username: Password:
  • Page:
  • 1

TOPIC:

Summer TTCN-3 question about action & timer usage 04 Aug 2005 07:01 #6845

Hello!

Here is a question for all TTCN-3 experts!

Which fragment of TTCN-3 you think is more correct?
I guess this could be one of the TTCN-3 idioms or design patterns.

Fragment A)
...
action("Please DO SOMETHING");
TWait.start; // wait for operator action
alt
{
[] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
[] TWait.timeout {setverdict(inconc); stop} // operator was sleeping
}
...

Fragment B)
...
TWait.start; // wait for operator action
action("Please DO SOMETHING");
alt
{
[] TWait.timeout {setverdict(inconc); stop} // operator was sleeping
[] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
}
...

One of the above fragments is from one publicly available test
suite and in my opinion it is wrong.

Best regards,
Vesa-Matti

--
Vesa-Matti Puro
OpenTTCN Oy
E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web: www.openttcn.com

Please Log in to join the conversation.

Summer TTCN-3 question about action & timer usage 04 Aug 2005 07:01 #6846

Semantically, these a (nearly) equivalent. Only in the (highly unlikely) case that message receiption and the timout of the timer are (from the view point of the test system) instantaneously, these will give different results.

So, it comes down mostly to readabiliy of the fragments, in which case I would prefer fragment A, because it lists the expected ways for a testcase to pass before the ways not to pass, which I find more intuitive, but I guess this is matter of taste.

Cheers

Stephan
--
Stephan Tobies Software Design Engineer, European Microsoft Innovation Center
E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Work Phone: +49-241-9978439
Mobile: +49-160-5892831
Address: EMIC, Ritterstrasse 23, 52072 Aachen, Germany

>
Ursprüngliche Nachricht
> Von: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] Im Auftrag von
> Vesa-Matti Puro
> Gesendet: Donnerstag, 4. August 2005 09:01
> An: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Betreff: Summer TTCN-3 question about action & timer usage
>
> Hello!
>
> Here is a question for all TTCN-3 experts!
>
> Which fragment of TTCN-3 you think is more correct?
> I guess this could be one of the TTCN-3 idioms or design patterns.
>
> Fragment A)
> ...
> action("Please DO SOMETHING");
> TWait.start; // wait for operator action alt
> {
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> }
> ...
>
> Fragment B)
> ...
> TWait.start; // wait for operator action action("Please DO
> SOMETHING"); alt
> {
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> }
> ...
>
> One of the above fragments is from one publicly available
> test suite and in my opinion it is wrong.
>
> Best regards,
> Vesa-Matti
>
> --
> Vesa-Matti Puro
> OpenTTCN Oy
> E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web:
> www.openttcn.com
>

Please Log in to join the conversation.

Summer TTCN-3 question about action & timer usage 04 Aug 2005 08:41 #6848

None of them is wrong semantically but all reasonable tester would use the pattern in fragment A. The reason has been given by Stephan: if the received message and the timeout are processed by the same snapshot, the timeout "wins", though the expected message has been received.

Of course, in the case of human actions, where timers are in the range of 1/2 minute and above, this is not very probable. But with short timer values (e.g. message exchange guard timers) it may happen. And for readability/maintainability reasons it is advisable to keep a unique style.

Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: Thursday, August 04, 2005 09:01 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Summer TTCN-3 question about action & timer usage
>
>
> Hello!
>
> Here is a question for all TTCN-3 experts!
>
> Which fragment of TTCN-3 you think is more correct?
> I guess this could be one of the TTCN-3 idioms or design patterns.
>
> Fragment A)
> ...
> action("Please DO SOMETHING");
> TWait.start; // wait for operator action
> alt
> {
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> }
> ...
>
> Fragment B)
> ...
> TWait.start; // wait for operator action
> action("Please DO SOMETHING");
> alt
> {
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> }
> ...
>
> One of the above fragments is from one publicly available test
> suite and in my opinion it is wrong.
>
> Best regards,
> Vesa-Matti
>
> --
> Vesa-Matti Puro
> OpenTTCN Oy
> E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web:
www.openttcn.com

Please Log in to join the conversation.

Summer TTCN-3 question about action & timer usage 05 Aug 2005 08:03 #6850

Hello,

I believe, Fragment A) is (more) correct than B).

action() could potentially be implemented blocking, lets say with an
own unknown timeout. Fragment A) would then let some time for processing
and
message reply, where in Fragment B), the timer could already have timed
out
during the wait-loop inside the action statement.

Kind regards,
Matthias


>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Vesa-Matti Puro
> Sent: Thursday, August 04, 2005 9:01 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Summer TTCN-3 question about action & timer usage
>
> Hello!
>
> Here is a question for all TTCN-3 experts!
>
> Which fragment of TTCN-3 you think is more correct?
> I guess this could be one of the TTCN-3 idioms or design patterns.
>
> Fragment A)
> ...
> action("Please DO SOMETHING");
> TWait.start; // wait for operator action
> alt
> {
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> }
> ...
>
> Fragment B)
> ...
> TWait.start; // wait for operator action
> action("Please DO SOMETHING");
> alt
> {
> [] TWait.timeout {setverdict(inconc); stop} // operator
> was sleeping
> [] p.receive(something) {setverdict(pass);} // SOMETHING was DONE
> }
> ...
>
> One of the above fragments is from one publicly available test
> suite and in my opinion it is wrong.
>
> Best regards,
> Vesa-Matti
>
> --
> Vesa-Matti Puro
> OpenTTCN Oy
> E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web:
> www.openttcn.com
>
>


Telelogic Lifecycle Solutions:
Helping You Define, Design & Deliver Advanced Systems & Software
Learn More at www.telelogic.com

Dr. Matthias Jung
Senior Consultant
Telelogic Deutschland GmbH, Otto-Brenner-Str. 247, Bielefeld, D-33604, Germany
Phone: +49 (521) 145 0333
Fax: +49 (521) 145 0350
Mobile phone:

This email address is being protected from spambots. You need JavaScript enabled to view it.
www.telelogic.com


Telelogic - Requirements-Driven Innovation!

Aktuelle Events:

DOORS Schnupperkurs, 12. + 26.08.2005 in Munchen
SYNERGY Schnupperkurs, 19.08. + 02.09.2005 in Munchen
SYNERGY/CM 6.4 Upgrade Training 26.07.2005 in Bielefeld

Registrieren: www.telelogic.com/news/events/index.cfm


The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited.

Please Log in to join the conversation.

Summer TTCN-3 question about action & timer usage 05 Aug 2005 08:36 #6851

Hi,

I argue with this view; action() is just a specific sending event, and as such - at the abstract language level - it shall always be considered successful and taking no time. The difference between p.send and action is that no port shall be defined for action => the test tool uses its own means (e.g. poping up a window, adding the message to events in an execution window etc.) to "send" the specified message. action() does not allow to receive any kind of reply (like pressing a button on the keyboard); this shall be solved by other means (an external function or a p.receive). Though it may not come through from the TTCN-3 standard, action() is the equivalent for the TTCN-2 implicit send.

Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: Friday, August 05, 2005 10:04 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Summer TTCN-3 question about action & timer usage
>
>
> Hello,
>
> I believe, Fragment A) is (more) correct than B).
>
> action() could potentially be implemented blocking, lets say with an
> own unknown timeout. Fragment A) would then let some time for
> processing
> and
> message reply, where in Fragment B), the timer could already
> have timed
> out
> during the wait-loop inside the action statement.
>
> Kind regards,
> Matthias
>
>
> >
Original Message
> > From: active_ttcn3 : mts stf133 ttcn version 3 - active
> > members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of
> Vesa-Matti Puro
> > Sent: Thursday, August 04, 2005 9:01 AM
> > To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> > Subject: Summer TTCN-3 question about action & timer usage
> >
> > Hello!
> >
> > Here is a question for all TTCN-3 experts!
> >
> > Which fragment of TTCN-3 you think is more correct?
> > I guess this could be one of the TTCN-3 idioms or design patterns.
> >
> > Fragment A)
> > ...
> > action("Please DO SOMETHING");
> > TWait.start; // wait for operator action
> > alt
> > {
> > [] p.receive(something) {setverdict(pass);} //
> SOMETHING was DONE
> > [] TWait.timeout {setverdict(inconc); stop} // operator
> > was sleeping
> > }
> > ...
> >
> > Fragment B)
> > ...
> > TWait.start; // wait for operator action
> > action("Please DO SOMETHING");
> > alt
> > {
> > [] TWait.timeout {setverdict(inconc); stop} // operator
> > was sleeping
> > [] p.receive(something) {setverdict(pass);} //
> SOMETHING was DONE
> > }
> > ...
> >
> > One of the above fragments is from one publicly available test
> > suite and in my opinion it is wrong.
> >
> > Best regards,
> > Vesa-Matti
> >
> > --
> > Vesa-Matti Puro
> > OpenTTCN Oy
> > E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web:
> > www.openttcn.com
> >
> >
>
>
>
>
> Telelogic Lifecycle Solutions:
> Helping You Define, Design & Deliver Advanced Systems & Software
> Learn More at www.telelogic.com
>
> Dr. Matthias Jung
> Senior Consultant
> Telelogic Deutschland GmbH, Otto-Brenner-Str. 247, Bielefeld,
> D-33604, Germany
> Phone: +49 (521) 145 0333
> Fax: +49 (521) 145 0350
> Mobile phone:
>
> This email address is being protected from spambots. You need JavaScript enabled to view it.
> www.telelogic.com
>
>
> Telelogic - Requirements-Driven Innovation!
>
>
> Aktuelle Events:
>
> DOORS Schnupperkurs, 12. + 26.08.2005 in Munchen
> SYNERGY Schnupperkurs, 19.08. + 02.09.2005 in Munchen
> SYNERGY/CM 6.4 Upgrade Training 26.07.2005 in
> Bielefeld
>
> Registrieren: www.telelogic.com/news/events/index.cfm
>
>
> The information contained in this e-mail, including any
> attachment or enclosure, is intended only for the person or
> entity to which it is addressed and may contain confidential
> material. Any unauthorized use, review, retransmissions,
> dissemination, copying or other use of this information by
> persons or entities other than the intended recipient is prohibited.
>

Please Log in to join the conversation.

  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin