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

TOPIC: Local variables within test steps

Local variables within test steps 20 Dec 2001 09:12 #6051

Dear all,

we realized that TTCN-3 does not allow local variables within test steps.
However, it would be very useful to allow it, for example to store an incoming
message or to do some internal calculations.

An example would be

teststep ATMN0_UNEXPECTED(...) runs on MTC
{
var STAT STAT_LocalVar;
...
alt {
[] T.receive(ST_R2V) -> value STAT_LocalVar
{ ...}
...
}
}

This would mean to change the BNF not only to enable local declarations but
also e.g. to have an alt statement instead of just an alt guard list. Well,
the second point is a matter of taste, but we think that for readability it
would be better to have the alt keyword within a teststep definition.

Looking forward to receive your comments.

With best regards,

Ina.

Ina Schieferdecker
Fraunhofer FOKUS email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Kaiserin-Augusta-Allee 31 tel: ++49-30-3463-7241
D-10589 Berlin fax: ++49-30-3463-8241
The administrator has disabled public write access.

Local variables within test steps 20 Dec 2001 09:56 #6052

  • Fr
  • Fr's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Dear I did not realize too, and it has been used every where in SIP ATS....
I completly agree Ina, we need it absolutly!

Best regards

Frederique


Original Message
From: I. Schieferdecker [This email address is being protected from spambots. You need JavaScript enabled to view it.]
Sent: 20 December 2001 10:12
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Local variables within test steps


Dear all,

we realized that TTCN-3 does not allow local variables within test steps.
However, it would be very useful to allow it, for example to store an
incoming
message or to do some internal calculations.

An example would be

teststep ATMN0_UNEXPECTED(...) runs on MTC
{
var STAT STAT_LocalVar;
...
alt {
[] T.receive(ST_R2V) -> value STAT_LocalVar
{ ...}
...
}
}

This would mean to change the BNF not only to enable local declarations but
also e.g. to have an alt statement instead of just an alt guard list. Well,
the second point is a matter of taste, but we think that for readability it
would be better to have the alt keyword within a teststep definition.

Looking forward to receive your comments.

With best regards,

Ina.

Ina Schieferdecker
Fraunhofer FOKUS email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Kaiserin-Augusta-Allee 31 tel: ++49-30-3463-7241
D-10589 Berlin fax: ++49-30-3463-8241
The administrator has disabled public write access.

Local variables within test steps 20 Dec 2001 12:17 #6054

Hi Frederique, hi Ina, hi all others,

there were two reasons not to allow local variables in test steps:

1. we tried to minimize the syntactial changes when changing from named
alternatives to test steps

2. we tried to avoid the possible side-effects when a local variable is
instantiated (note, the initial value might be the result of a
function
call).

The top alternative in a test step is considered something like the
continuation of the alternative in which the test step is called
(either
explicitly or implicitly by the default mechanism).

As side effects during the instantiation of a local test step
variable the following things to consider may happen:

(a) the guards of the following alternatives may be changed

(b) the snapshot may be changed, e.g., by restarting or stopping an
expired timer
which may remove timeouts from the timeout list.

However, the points 1 and 2(a) I don't consider as big problems. For the
resolution
of point 2(b), we would need some static rules disallowing all
operations that
potentially change the snapshot. These operations will be for example,
all receiving
operations, timer operations that potentially remove timeouts from the
list and also
port control operations that clear ports.

In most cases, noone will even think of using a variable instantiation
with such
ugly side effects and such a rule will cause no problem. My personal
concern is that
we will have an(other) exceptional rule for variable instantiation in
test steps.


Merry Christmas and a happy new Year!
Jens





Frederique Aurouet schrieb:
>
> Dear I did not realize too, and it has been used every where in SIP ATS....
> I completly agree Ina, we need it absolutly!
>
> Best regards
>
> Frederique
>
>
Original Message
> From: I. Schieferdecker [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: 20 December 2001 10:12
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Local variables within test steps
>
> Dear all,
>
> we realized that TTCN-3 does not allow local variables within test steps.
> However, it would be very useful to allow it, for example to store an
> incoming
> message or to do some internal calculations.
>
> An example would be
>
> teststep ATMN0_UNEXPECTED(...) runs on MTC
> {
> var STAT STAT_LocalVar;
> ...
> alt {
> [] T.receive(ST_R2V) -> value STAT_LocalVar
> { ...}
> ...
> }
> }
>
> This would mean to change the BNF not only to enable local declarations but
> also e.g. to have an alt statement instead of just an alt guard list. Well,
> the second point is a matter of taste, but we think that for readability it
> would be better to have the alt keyword within a teststep definition.
>
> Looking forward to receive your comments.
>
> With best regards,
>
> Ina.
>
>
> Ina Schieferdecker
> Fraunhofer FOKUS email: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Kaiserin-Augusta-Allee 31 tel: ++49-30-3463-7241
> D-10589 Berlin fax: ++49-30-3463-8241
>

--

======================================================================
Dr. Jens Grabowski
Institute for Telematics phone: +49 451 500 3723
University of Luebeck fax: +49 451 500 3722
Ratzeburger Allee 160 eMail: This email address is being protected from spambots. You need JavaScript enabled to view it.
D-23538 Luebeck or This email address is being protected from spambots. You need JavaScript enabled to view it.
(Germany) WWW: www.itm.mu-luebeck.de
======================================================================
The administrator has disabled public write access.

Local variables within test steps 20 Dec 2001 15:49 #6055

On Thu, 20 Dec 2001, I. Schieferdecker wrote:

> Dear all,
>
> we realized that TTCN-3 does not allow local variables within test steps.
> However, it would be very useful to allow it, for example to store an incoming
> message or to do some internal calculations.
>
> An example would be
>
> teststep ATMN0_UNEXPECTED(...) runs on MTC
> {
> var STAT STAT_LocalVar;
> ...
> alt {
> [] T.receive(ST_R2V) -> value STAT_LocalVar
> { ...}
> ...
> }
> }

Actually, it is already possible with a little work-around:

teststep ATMN0_UNEXPECTED(...) runs on MTC
{
[] check(T.receive(ST_R2V)) {
var STAT STAT_LocalVar;
T.receive(ST_R2V) -> value STAT_LocalVar;
...
}
[] ...
}

Otherwise, as Jens wisely pointed out, a side-effect-freeness
static analysis for teststeps must be enforced.

Another possible way would be, of course, to use parameters.
But, I agree that that would be in most cases a very ugly hack.

Greetings, Jacob
The administrator has disabled public write access.

Local variables within test steps 20 Dec 2001 16:28 #6056

> On Thu, 20 Dec 2001, I. Schieferdecker wrote:
>
> > Dear all,
> >
> > we realized that TTCN-3 does not allow local variables within test steps.
> > However, it would be very useful to allow it, for example to store an
incoming
> > message or to do some internal calculations.
> >
> > An example would be
> >
> > teststep ATMN0_UNEXPECTED(...) runs on MTC
> > {
> > var STAT STAT_LocalVar;
> > ...
> > alt {
> > [] T.receive(ST_R2V) -> value STAT_LocalVar
> > { ...}
> > ...
> > }
> > }
>
> Actually, it is already possible with a little work-around:
>
> teststep ATMN0_UNEXPECTED(...) runs on MTC
> {
> [] check(T.receive(ST_R2V)) {
> var STAT STAT_LocalVar;
> T.receive(ST_R2V) -> value STAT_LocalVar;
> ...
> }
> [] ...
> }

which is not very performant.

>
> Otherwise, as Jens wisely pointed out, a side-effect-freeness
> static analysis for teststeps must be enforced.
>
> Another possible way would be, of course, to use parameters.
> But, I agree that that would be in most cases a very ugly hack.

sure, we did it like that currently. This however could generate a long list
of parameters - again a question of performance. Another is that of locality
.. why should the invoker of the test step care about a parameter to be used
just within the teststep.

With best regards,

Ina.


>
> Greetings, Jacob
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin