ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007630 | Part 01: TTCN-3 Core Language | Clarification | public | 09-03-2017 12:40 | 30-12-2017 20:02

Reporter | Jacob Wieland - Spirent |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.9.1 (published 2017-05) |
Target Version | v4.10.1 (published 2018-05) | Fixed in Version | v4.10.1 (published 2018-05) |
Clause Reference(s) | 15.11
Source (company - Author) | Spirent - Jacob Wieland

Summary | 0007630: example creating empty template is wrong

Description

in section 15.11 in EXAMPLE 1 can be found the following sub-example:
"
template octetstring mw_myoct3 := ('ABCD'O & ? length(2)) length (1..3);
// However, this is correct but will not match any value;
"
According to the definition of template in the definitions in section 3, a template must match at least one value.
"
A TTCN-3 template identifies a subset of the
values of its type (where the subset may contain a single instance of the type, several instances or all instances) or the
matching mechanism omit.
"
Since great pains have been taken to assure that no empty types (types containing no value) can be defined in TTCN-3, the above definition excludes also all empty template definitions from validity.
Therefore, the example is wrong insofar that it explicitly allows such an empty template and should be corrected.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | 7630.doc (23,552) 09-06-2017 08:59 http://oldforge.etsi.org/mantis/file_download.php?file_id=3624&type=bug

Issue History
Date Modified | Username | Field | Change
09-03-2017 12:40 | Jacob Wieland - Spirent | New Issue |
11-04-2017 15:22 | szabados | Note Added: 0014552 |
12-04-2017 08:17 | Jacob Wieland - Spirent | Note Added: 0014553 |
12-04-2017 08:17 | Jacob Wieland - Spirent | Note Deleted: 0014553 |
12-04-2017 08:20 | Jacob Wieland - Spirent | Note Added: 0014554 |
12-04-2017 08:22 | Jacob Wieland - Spirent | Note Added: 0014555 |
12-04-2017 08:24 | Jacob Wieland - Spirent | Note Added: 0014556 |
12-04-2017 08:24 | Jacob Wieland - Spirent | Note Deleted: 0014555 |
12-04-2017 08:24 | Jacob Wieland - Spirent | Note Deleted: 0014554 |
17-04-2017 13:18 | szabados | Note Added: 0014557 |
17-04-2017 13:18 | szabados | Note Deleted: 0014557 |
17-04-2017 13:26 | szabados | Note Added: 0014558 |
17-04-2017 13:26 | szabados | Note Deleted: 0014558 |
17-04-2017 13:26 | szabados | Note Added: 0014559 |
17-04-2017 13:26 | szabados | Note Deleted: 0014559 |
17-04-2017 13:28 | szabados | Note Added: 0014560 |
17-04-2017 13:28 | szabados | Note Deleted: 0014560 |
18-04-2017 07:12 | szabados | Note Added: 0014564 |
18-04-2017 07:12 | szabados | Note Deleted: 0014564 |
18-04-2017 07:16 | szabados | Note Added: 0014565 |
18-04-2017 07:16 | szabados | Note Deleted: 0014565 |
18-04-2017 07:18 | szabados | Note Added: 0014566 |
18-04-2017 07:19 | szabados | Note Deleted: 0014566 |
18-04-2017 07:21 | szabados | Note Added: 0014567 |
06-06-2017 14:07 | Jens Grabowski | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
06-06-2017 14:08 | Jens Grabowski | Assigned To | => Julien Deltour
06-06-2017 14:08 | Jens Grabowski | Status | new => assigned
09-06-2017 08:59 | Julien Deltour | File Added: 7630.doc |
09-06-2017 08:59 | Julien Deltour | Note Added: 0014684 |
09-06-2017 08:59 | Julien Deltour | Status | assigned => confirmed
09-06-2017 08:59 | Julien Deltour | Assigned To | Julien Deltour => Jacob Wieland - Spirent
09-06-2017 08:59 | Julien Deltour | Status | confirmed => assigned
09-06-2017 15:13 | Jacob Wieland - Spirent | Note Added: 0014701 |
09-06-2017 15:13 | Jacob Wieland - Spirent | Status | assigned => resolved
09-06-2017 15:13 | Jacob Wieland - Spirent | Fixed in Version | => v4.10.1 (published 2018-05)
09-06-2017 15:13 | Jacob Wieland - Spirent | Resolution | open => fixed
09-06-2017 15:13 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
30-12-2017 20:02 | Gyorgy Rethy | Note Added: 0014970 |
30-12-2017 20:02 | Gyorgy Rethy | Status | resolved => closed
30-12-2017 20:02 | Gyorgy Rethy | Product Version | => v4.9.1 (published 2017-05)
30-12-2017 20:02 | Gyorgy Rethy | Target Version | => v4.10.1 (published 2018-05)

Notes

(0014552)
szabados
11-04-2017 15:22

If I understand correctly it should be corrected to:
template octetstring mw_myoct3 := ('ABCD'O & ? length(2)) length (4);
// However, this is correct.
// results in the template 'ABCD??'O
Maybe we should also add an example, which demonstrates that templates that look fine might actually not match to anything. This is incorrect ... but given the complexity tools might not be able to detect this situation during static analysis.

(0014556)
Jacob Wieland - Spirent
12-04-2017 08:24

In principle,the restriction of no empty-set-templates is a bit pointless. For me, this should just be a warning and not an error, same as if I write down if false or a false comparison of 1 and 2.
I mean, what harm can an empty template do? It just never matches, so all branches it guards will not be entered.
Yes, if they are empty because of a mistake the test writer made, the tool should help and point it out. But, the same can happen with a template that accidentally only matches 10 values instead of an infinte number, so the distinction between 0 and non-0 seems a bit arbitrary.
The same argument can be made for empty types. What harm can they do? Absolutely none. You simply cannot instantiate any value for those types and their emptiness propagates to surrounding record-layers, if they are the type of non-optional fields. Thus, if they are empty by mistake, the mistake will become apparent as soon as an instance is to be created.

(0014567)
szabados
18-04-2017 07:21

Please note that detecting and reporting quality problems does make a difference.
A template not matching anything -whether because of a typo or architectural misunderstandings- can lead to an incorrect testcase:
- waste of execution time
- increased maintenance cost
- incorrect/misleading result ... leading to faults left in the products
A distinction between 0/unbound and non-0/bound_with_incorrect_value sound like a technical and theoretical limitation:
At current level of call/data flow checking ... 0/unbound -issues are much easier to detect than off-by-1 issues.
And I believe it might also be theoretically impossible to tell just from the source code, that the requirement of a protocol was mentioning an off-by-1 value.

(0014684)
Julien Deltour
09-06-2017 08:59

Please review the proposal

(0014701)
Jacob Wieland - Spirent
09-06-2017 15:13

looks fine

(0014970)
Gyorgy Rethy
30-12-2017 20:02

Added to draft V4.9.2