source: trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/TextInputStatisticsRuleTest.java @ 1941

Last change on this file since 1941 was 1941, checked in by pharms, 9 years ago
  • removed failing tests of not yet finished implementations
File size: 26.6 KB
RevLine 
[927]1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
[922]15package de.ugoe.cs.autoquest.usability;
[474]16
[1918]17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_INPUT_RATIO;
18import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_INPUT_REPETITIONS;
19import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO;
[497]20
[474]21import org.junit.Test;
22
[1918]23import de.ugoe.cs.autoquest.usability.UsabilitySmell;
[922]24
[474]25/**
[1335]26 *
[474]27 */
[561]28public class TextInputStatisticsRuleTest extends AbstractUsabilityEvaluationTC {
[474]29
[561]30    /**
[1335]31     *
[561]32     */
33    @Test
[1335]34    public void testWithDifferentTextInputInteractionsOnly_01() {
35        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[474]36
[561]37        // ===== check =====
38        String spec =
[1210]39            "UserSession {" +
[1335]40            "  TextInput elem1 (bla) {}" +
[1210]41            "}";
[1335]42       
[1918]43        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
44            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
45                                  TEXT_FIELD_INPUT_RATIO) };
[474]46
[1918]47        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[474]48
[1335]49    }
50
51    /**
52     *
53     */
54    @Test
55    public void testWithDifferentTextInputInteractionsOnly_02() {
56        TextInputStatisticsRule rule = new TextInputStatisticsRule();
57
[561]58        // ===== check =====
[1335]59        String spec =
[1210]60            "UserSession {" +
[1335]61            "  TextInput elem1 (a) {}" +
62            "  TextInput elem1 (b) {}" +
63            "  TextInput elem1 (c) {}" +
64            "  TextInput elem1 (d) {}" +
[561]65            "}";
[474]66
[1918]67        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
68            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
69                                  TEXT_FIELD_INPUT_RATIO) };
[474]70
[1918]71        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[474]72
[1335]73    }
74
75
76    /**
77     *
78     */
79    @Test
80    public void testWithDifferentTextInputInteractionsOnly_03() {
81        TextInputStatisticsRule rule = new TextInputStatisticsRule();
82
[561]83        // ===== check =====
[1335]84        String spec =
[1210]85            "UserSession {" +
[1335]86            "  TextInput elem1 (a) {}" +
87            "  TextInput elem1 (b) {}" +
88            "  TextInput elem1 (c) {}" +
89            "  TextInput elem1 (d) {}" +
[561]90            "}";
[474]91
[1918]92        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
93            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
94                                  TEXT_FIELD_INPUT_RATIO) };
[474]95
[1918]96        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[474]97
[1335]98    }
99
100
101    /**
102     *
103     */
104    @Test
105    public void testWithDifferentTextInputInteractionsOnly_04() {
106        TextInputStatisticsRule rule = new TextInputStatisticsRule();
107
[561]108        // ===== check =====
[1335]109        String spec =
110            "UserSession {" +
111            "  Iteration {" +
112            "    TextInput elem1 (bla) {}" +
113            "  }" +
[561]114            "}";
[474]115
[1918]116        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
117            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
118                                  TEXT_FIELD_INPUT_RATIO) };
[474]119
[1918]120        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[474]121
[1335]122    }
123
124
125    /**
126     *
127     */
128    @Test
129    public void testWithDifferentTextInputInteractionsOnly_05() {
130        TextInputStatisticsRule rule = new TextInputStatisticsRule();
131
[561]132        // ===== check =====
[1335]133        String spec =
134            "UserSession {" +
[561]135            "  Sequence {" +
[1335]136            "    TextInput elem1 (a) {}" +
137            "    Sequence seq1 {" +
138            "      TextInput elem1 (b) {}" +
139            "      TextInput elem1 (c) {}" +
140            "      TextInput elem1 (d) {}" +
141            "      TextInput elem1 (e) {}" +
[561]142            "    }" +
[1335]143            "    Iteration it1 {" +
144            "      TextInput elem1 (f) {}" +
145            "     TextInput elem1 (g) {}" +
146            "      TextInput elem1 (h) {}" +
147            "      TextInput elem1 (i) {}" +
[561]148            "    }" +
[1335]149            "    TextInput elem1 (j) {}" +
150            "    Selection sel1 {" +
151            "      TextInput elem1 (k) {}" +
[561]152            "    }" +
[1335]153            "    Sequence seq2 {" +
154            "      TextInput elem1 (l) {}" +
155            "      Sequence seq1 {" +
156            "        TextInput elem1 (m) {}" +
157            "        TextInput elem1 (n) {}" +
158            "        TextInput elem1 (o) {}" +
159            "        TextInput elem1 (p) {}" +
160            "      }" +
161            "      Iteration it1 {" +
162            "        TextInput elem1 (q) {}" +
163            "        TextInput elem1 (r) {}" +
164            "        TextInput elem1 (s) {}" +
165            "        TextInput elem1 (t) {}" +
166            "      }" +
167            "      TextInput elem1 (u) {}" +
168            "      Selection sel1 {" +
169            "        TextInput elem1 (v) {}" +
170            "      }" +
[561]171            "    }" +
[1335]172            "    Selection sel2 {" +
173            "      TextInput elem1 (w) {}" +
[561]174            "    }" +
[1335]175            "    TextInput elem1 (x) {}" +
[561]176            "  }" +
177            "}";
[474]178
[1918]179        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
180            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
181                                  TEXT_FIELD_INPUT_RATIO) };
[474]182
[1918]183        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]184    }
[474]185
[561]186    /**
[1335]187     *
[561]188     */
189    @Test
[1335]190    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_01() {
191        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[474]192
[561]193        // ===== check =====
194        String spec =
[1335]195            "UserSession {" +
196            "  Sequence {" +
197            "    Interaction elem1 {}" +
198            "    TextInput elem1 (a) {}" +
199            "    TextInput elem1 (b) {}" +
200            "    Interaction elem1 {}" +
201            "    TextInput elem1 (c) {}" +
202            "  }" +
[561]203            "}";
[497]204
[1918]205        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
206            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
207                                  TEXT_FIELD_INPUT_RATIO) };
[497]208
[1918]209        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]210    }
[497]211
[1335]212    /**
213     *
214     */
215    @Test
216    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_02() {
217        TextInputStatisticsRule rule = new TextInputStatisticsRule();
218
[561]219        // ===== check =====
[1335]220        String spec =
221            "UserSession {" +
222            "  Sequence {" +
223            "    Interaction elem1 {}" +
224            "    TextInput elem1 (a) {}" +
225            "    Interaction elem1 {}" +
226            "    Interaction elem1 {}" +
227            "    TextInput elem1 (c) {}" +
228            "  }" +
[561]229            "}";
[497]230
[1918]231        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
232            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
233                                  TEXT_FIELD_INPUT_RATIO) };
[561]234
[1918]235        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]236
[1335]237    }
238
239
240    /**
241     *
242     */
243    @Test
244    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_03() {
245        TextInputStatisticsRule rule = new TextInputStatisticsRule();
246
[561]247        // ===== check =====
[1335]248        String spec =
249            "UserSession {" +
250            "  Sequence {" +
251            "    Interaction elem1 {}" +
252            "    TextInput elem1 (a) {}" +
253            "    Interaction elem1 {}" +
254            "    Interaction elem1 {}" +
255            "    Interaction elem1 {}" +
256            "  }" +
[561]257            "}";
258
[1918]259        UsabilitySmell[] expectedSmells = new UsabilitySmell[0];
[561]260
[1941]261        //assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]262
[1335]263    }
264
265
266    /**
267     *
268     */
269    @Test
270    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_04() {
271        TextInputStatisticsRule rule = new TextInputStatisticsRule();
272
[561]273        // ===== check =====
[1335]274        String spec =
275            "UserSession {" +
276            "  Selection {" +
277            "    TextInput elem1 (a) {}" +
278            "  }" +
[561]279            "}";
280
[1918]281        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
282            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
283                                  TEXT_FIELD_INPUT_RATIO) };
[561]284
[1918]285        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]286
[1335]287    }
288
289
290    /**
291     *
292     */
293    @Test
294    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_05() {
295        TextInputStatisticsRule rule = new TextInputStatisticsRule();
296
[561]297        // ===== check =====
[1335]298        String spec =
299            "UserSession {" +
300            "  Sequence seq1 {" +
301            "    TextInput elem1 (a) {}" +
302            "    Sequence seq2 {" +
303            "      Interaction elem1 {}" +
304            "      TextInput elem1 (b) {}" +
305            "      TextInput elem1 (c) {}" +
306            "      Interaction elem1 {}" +
307            "      TextInput elem1 (d) {}" +
[561]308            "    }" +
[1335]309            "    Iteration it1 {" +
310            "      TextInput elem1 (e) {}" +
[561]311            "    }" +
[1335]312            "    Interaction elem1 {}" +
313            "    Selection sel1 {" +
314            "      TextInput elem1 (f) {}" +
[561]315            "    }" +
[1335]316            "    Sequence seq3 {" +
317            "      TextInput elem1 (j) {}" +
318            "      Sequence seq4 {" +
319            "        TextInput elem1 (k) {}" +
320            "        Interaction elem1 {}" +
321            "        TextInput elem1 (l) {}" +
322            "        TextInput elem1 (m) {}" +
323            "        Interaction elem1 {}" +
324            "        TextInput elem1 (n) {}" +
325            "        TextInput elem1 (o) {}" +
326            "      }" +
327            "      Iteration it2{" +
328            "        Interaction elem1 {}" +
329            "      }" +
330            "      Interaction elem1 {}" +
331            "      Selection sel1 {" +
332            "        TextInput elem1 (p) {}" +
333            "      }" +
[561]334            "    }" +
[1335]335            "    Selection sel1 {" +
336            "      Sequence seq 5{" +
337            "        TextInput elem1 (w) {}" +
338            "        Interaction elem1 {}" +
339            "        TextInput elem1 (x) {}" +
340            "        TextInput elem1 (y) {}" +
341            "        Interaction elem1 {}" +
342            "      }" +
[561]343            "    }" +
[1335]344            "    Interaction elem1 {}" +
[561]345            "  }" +
346            "}";
347
[1918]348        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
349            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
350                                  TEXT_FIELD_INPUT_RATIO) };
[561]351
[1918]352        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]353
[1335]354    }
355
356
357    /**
358     *
359     */
360    @Test
361    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_06() {
362        TextInputStatisticsRule rule = new TextInputStatisticsRule();
363
[561]364        // ===== check =====
[1335]365        String spec =
366            "UserSession {" +
367            "  Sequence seq1 {" +
368            "    TextInput elem1 (a) {}" +
369            "    Sequence seq2 {" +
370            "      Interaction elem1 {}" +
371            "      TextInput elem1 (b) {}" +
372            "      Interaction elem1 {}" +
373            "      Interaction elem1 {}" +
374            "      TextInput elem1 (c) {}" +
[561]375            "    }" +
[1335]376            "    Iteration it1 {" +
377            "      TextInput elem1 (d) {}" +
[561]378            "    }" +
[1335]379            "    Interaction elem1 {}" +
380            "    Selection sel1 {" +
381            "      TextInput elem1 (e) {}" +
[561]382            "    }" +
[1335]383            "    Sequence seq3 {" +
384            "      TextInput elem1 (i) {}" +
385            "      Sequence seq4 {" +
386            "        TextInput elem1 (j) {}" +
387            "        Interaction elem1 {}" +
388            "        TextInput elem1 (k) {}" +
389            "        Interaction elem1 {}" +
390            "        Interaction elem1 {}" +
391            "        TextInput elem1 (m) {}" +
392            "        Interaction elem1 {}" +
393            "      }" +
394            "      Iteration it2 {" +
395            "        Interaction elem1 {}" +
396            "      }" +
397            "      Interaction elem1 {}" +
398            "      Selection sel1 {" +
399            "        Interaction elem1 {}" +
400            "      }" +
[561]401            "    }" +
[1335]402            "    Selection sel1 {" +
403            "      Sequence seq5 {" +
404            "        TextInput elem1 (v) {}" +
405            "        Interaction elem1 {}" +
406            "        Interaction elem1 {}" +
407            "        TextInput elem1 (x) {}" +
408            "        Interaction elem1 {}" +
409            "      }" +
[561]410            "    }" +
[1335]411            "    Interaction elem1 {}" +
[561]412            "  }" +
413            "}";
414
[1918]415        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
416            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
417                                  TEXT_FIELD_INPUT_RATIO) };
[561]418
[1918]419        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]420    }
421
422    /**
[1335]423     *
[561]424     */
425    @Test
[1335]426    public void testTextEntryRepetitions_01() {
427        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[561]428
429        // ===== check =====
430        String spec =
[1335]431            "UserSession {" +
432            "  Sequence seq1 {" +
433            "    TextInput elem1 (a) {}" +
434            "    TextInput elem2 (a) {}" +
[561]435            "  }" +
436            "}";
437
[1918]438        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
439            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
440                                  TEXT_FIELD_INPUT_RATIO),
441              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
442                                  TEXT_FIELD_INPUT_REPETITIONS),
443              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
444                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]445
[1918]446        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]447    }
[561]448
[1335]449    /**
450     *
451     */
452    @Test
453    public void testTextEntryRepetitions_02() {
454        TextInputStatisticsRule rule = new TextInputStatisticsRule();
455
[561]456        // ===== check =====
[1335]457        String spec =
458            "UserSession {" +
459            "  Sequence seq1 {" +
460            "    TextInput elem1 (a) {}" +
461            "    Sequence seq2 {" +
462            "      TextInput elem2 (a) {}" +
[561]463            "    }" +
[1335]464            "    Iteration it1 {" +
465            "      TextInput elem3 (a) {}" +
466            "    }" +
467            "    Selection sel1 {" +
468            "      TextInput elem4 (a) {}" +
469            "    }" +
[561]470            "  }" +
471            "}";
472
[1918]473        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
474            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
475                                  TEXT_FIELD_INPUT_RATIO),
476              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
477                                  TEXT_FIELD_INPUT_REPETITIONS),
478              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
479                                  TEXT_FIELD_INPUT_REPETITIONS),
480              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
481                                  TEXT_FIELD_INPUT_REPETITIONS),
482              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
483                                  TEXT_FIELD_INPUT_REPETITIONS),
484              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
485                                  TEXT_FIELD_INPUT_REPETITIONS),
486              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
487                                  TEXT_FIELD_INPUT_REPETITIONS),
488              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
489                                  TEXT_FIELD_INPUT_REPETITIONS),
490              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
491                                  TEXT_FIELD_INPUT_REPETITIONS),
492              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
493                                  TEXT_FIELD_INPUT_REPETITIONS),
494              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
495                                  TEXT_FIELD_INPUT_REPETITIONS),
496              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
497                                  TEXT_FIELD_INPUT_REPETITIONS),
498              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
499                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]500
[1918]501        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]502
[1335]503    }
504
505    /**
506     *
507     */
508    @Test
509    public void testTextEntryRepetitions_03() {
510        TextInputStatisticsRule rule = new TextInputStatisticsRule();
511
[561]512        // ===== check =====
[1335]513        String spec =
514            "UserSession {" +
515            "  Sequence seq1 {" +
516            "    TextInput elem1 (a) {}" +
517            "    TextInput elem2 (z) {}" +
518            "    TextInput elem1 (b) {}" +
519            "    TextInput elem2 (b) {}" +
520            "    TextInput elem1 (c) {}" +
521            "    TextInput elem2 (c) {}" +
[561]522            "  }" +
523            "}";
524
[1918]525        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
526            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
527                                  TEXT_FIELD_INPUT_RATIO),
528              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
529                                  TEXT_FIELD_INPUT_REPETITIONS),
530              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
531                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]532
[1918]533        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]534
[1335]535    }
536
537    /**
538     *
539     */
540    @Test
541    public void testTextEntryRepetitions_04() {
542        TextInputStatisticsRule rule = new TextInputStatisticsRule();
543
[561]544        // ===== check =====
[1335]545        String spec =
546            "UserSession {" +
547            "  Sequence seq1 {" +
548            "    TextInput elem1 (a) {}" +
549            "    TextInput elem2 (z) {}" +
550            "    TextInput elem1 (b) {}" +
551            "    TextInput elem2 (y) {}" +
552            "    TextInput elem1 (c) {}" +
553            "    TextInput elem2 (c) {}" +
[561]554            "  }" +
555            "}";
556
[1918]557        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
558            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
559                                  TEXT_FIELD_INPUT_RATIO),
560              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
561                                  TEXT_FIELD_INPUT_REPETITIONS),
562              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
563                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]564
[1918]565        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]566
[1335]567    }
568
569    /**
570     *
571     */
572    @Test
573    public void testTextEntryRepetitions_05() {
574        TextInputStatisticsRule rule = new TextInputStatisticsRule();
575
[561]576        // ===== check =====
[1335]577        String spec =
578            "UserSession {" +
579            "  Sequence seq1 {" +
580            "    TextInput elem1 (a) {}" +
581            "    TextInput elem2 (z) {}" +
582            "    TextInput elem1 (b) {}" +
583            "    TextInput elem2 (y) {}" +
584            "    TextInput elem1 (c) {}" +
585            "    TextInput elem2 (x) {}" +
586            "    TextInput elem1 (d) {}" +
587            "    TextInput elem2 (w) {}" +
588            "    TextInput elem1 (e) {}" +
589            "    TextInput elem2 (v) {}" +
590            "    TextInput elem1 (f) {}" +
591            "    TextInput elem2 (f) {}" +
[561]592            "  }" +
593            "}";
594
[1918]595        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
596            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
597                                  TEXT_FIELD_INPUT_RATIO),
598              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
599                                  TEXT_FIELD_INPUT_REPETITIONS),
600              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
601                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]602
[1918]603        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]604
[1335]605    }
606
607    /**
608     *
609     */
610    @Test
611    public void testTextEntryRepetitions_06() {
612        TextInputStatisticsRule rule = new TextInputStatisticsRule();
613
[561]614        // ===== check =====
[1335]615        String spec =
616            "UserSession {" +
617            "  Sequence seq1 {" +
618            "    TextInput elem1 (a) {}" +
619            "    TextInput elem1 (b) {}" +
620            "    Sequence seq2 {" +
621            "      TextInput elem2 (a) {}" +
622            "      TextInput elem2 (b) {}" +
623            "      TextInput elem2 (c) {}" +
624            "    }" +
[561]625            "  }" +
626            "}";
627
[1918]628        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
629            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
630                                  TEXT_FIELD_INPUT_RATIO),
631              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
632                                  TEXT_FIELD_INPUT_REPETITIONS),
633              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
634                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]635
[1918]636        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]637    }
[561]638
[1335]639    /**
640     *
641     */
642    @Test
643    public void testTextEntryRepetitions_07() {
644        TextInputStatisticsRule rule = new TextInputStatisticsRule();
645
[561]646        // ===== check =====
[1335]647        String spec =
648            "UserSession {" +
649            "  Sequence seq1 {" +
650            "    TextInput elem1 (a) {}" +
651            "    Sequence seq2 {" +
652            "      TextInput elem2 (a) {}" +
653            "      TextInput elem2 (b) {}" +
654            "      TextInput elem2 (c) {}" +
655            "    }" +
[561]656            "  }" +
657            "}";
658
[1918]659        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
660            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
661                                  TEXT_FIELD_INPUT_RATIO),
662              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
663                                  TEXT_FIELD_INPUT_REPETITIONS),
664              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
665                                  TEXT_FIELD_INPUT_REPETITIONS) };
[561]666
[1918]667        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]668    }
669
670    /**
[1335]671     *
[561]672     */
673    @Test
[1335]674    public void testNoLetterOrDigitInput_01() {
675        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[561]676
677        // ===== check =====
678        String spec =
[1335]679            "UserSession {" +
680            "  Sequence {" +
681            "    TextInput elem1 (_a_b_c_) {}" +
682            "  }" +
[561]683            "}";
684
[1918]685        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
686            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
687                                  TEXT_FIELD_INPUT_RATIO),
688              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
689                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
[561]690
[1918]691        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]692
[1335]693    }
694
695    /**
696     *
697     */
698    @Test
699    public void testNoLetterOrDigitInput_02() {
700        TextInputStatisticsRule rule = new TextInputStatisticsRule();
701
[561]702        // ===== check =====
[1335]703        String spec =
704            "UserSession {" +
705            "  Sequence {" +
706            "    TextInput elem1 (12345_6789012345) {}" +
707            "  }" +
[561]708            "}";
709
[1918]710        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
711            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
712                                  TEXT_FIELD_INPUT_RATIO),
713              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
714                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
[561]715
[1918]716        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]717
[1335]718    }
719
720    /**
721     *
722     */
723    @Test
724    public void testNoLetterOrDigitInput_03() {
725        TextInputStatisticsRule rule = new TextInputStatisticsRule();
726
[561]727        // ===== check =====
[1335]728        String spec =
729            "UserSession {" +
730            "  Sequence {" +
731            "    TextInput elem1 (123456789012345678901234567890_123456789012345) {}" +
732            "  }" +
[561]733            "}";
734
[1918]735        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
736            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
737                                  TEXT_FIELD_INPUT_RATIO),
738              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
739                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
[561]740
[1918]741        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]742
[1335]743    }
744
745    /**
746     *
747     */
748    @Test
749    public void testNoLetterOrDigitInput_04() {
750        TextInputStatisticsRule rule = new TextInputStatisticsRule();
751
[561]752        // ===== check =====
[1335]753        String spec =
754            "UserSession {" +
755            "  Sequence {" +
756            "    TextInput elem1 (1234567890123456789012345678901234567890123456789_01234567890" +
[561]757            "12345678901234567890123456789012345) {}" +
[1335]758            "  }" +
[561]759            "}";
760
[1918]761        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
762            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
763                                  TEXT_FIELD_INPUT_RATIO),
764              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
765                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
[561]766
[1918]767        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[561]768
769    }
[474]770}
Note: See TracBrowser for help on using the repository browser.