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

Last change on this file since 1335 was 1335, checked in by pharms, 10 years ago
  • corrected and extended usability evaluations
  • checking now more text field specific for required input formats and word repetitions
  • checking also for required scrolls
File size: 23.3 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
[922]17import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO;
18import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS;
19import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO;
20import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.HIGH;
21import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.INFO;
22import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.LOW;
23import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.MEDIUM;
[497]24
[474]25import org.junit.Test;
26
[922]27import de.ugoe.cs.autoquest.usability.UsabilityDefect;
28
[474]29/**
[1335]30 *
[474]31 */
[561]32public class TextInputStatisticsRuleTest extends AbstractUsabilityEvaluationTC {
[474]33
[561]34    /**
[1335]35     *
[561]36     */
37    @Test
[1335]38    public void testWithDifferentTextInputInteractionsOnly_01() {
39        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[474]40
[561]41        // ===== check =====
42        String spec =
[1210]43            "UserSession {" +
[1335]44            "  TextInput elem1 (bla) {}" +
[1210]45            "}";
[1335]46       
[561]47        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
48            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[474]49
[1335]50        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[474]51
[1335]52    }
53
54    /**
55     *
56     */
57    @Test
58    public void testWithDifferentTextInputInteractionsOnly_02() {
59        TextInputStatisticsRule rule = new TextInputStatisticsRule();
60
[561]61        // ===== check =====
[1335]62        String spec =
[1210]63            "UserSession {" +
[1335]64            "  TextInput elem1 (a) {}" +
65            "  TextInput elem1 (b) {}" +
66            "  TextInput elem1 (c) {}" +
67            "  TextInput elem1 (d) {}" +
[561]68            "}";
[474]69
[1335]70        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]71            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[474]72
[1335]73        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[474]74
[1335]75    }
76
77
78    /**
79     *
80     */
81    @Test
82    public void testWithDifferentTextInputInteractionsOnly_03() {
83        TextInputStatisticsRule rule = new TextInputStatisticsRule();
84
[561]85        // ===== check =====
[1335]86        String spec =
[1210]87            "UserSession {" +
[1335]88            "  TextInput elem1 (a) {}" +
89            "  TextInput elem1 (b) {}" +
90            "  TextInput elem1 (c) {}" +
91            "  TextInput elem1 (d) {}" +
[561]92            "}";
[474]93
[1335]94        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]95            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[474]96
[1335]97        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[474]98
[1335]99    }
100
101
102    /**
103     *
104     */
105    @Test
106    public void testWithDifferentTextInputInteractionsOnly_04() {
107        TextInputStatisticsRule rule = new TextInputStatisticsRule();
108
[561]109        // ===== check =====
[1335]110        String spec =
111            "UserSession {" +
112            "  Iteration {" +
113            "    TextInput elem1 (bla) {}" +
114            "  }" +
[561]115            "}";
[474]116
[1335]117        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]118            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[474]119
[1335]120        assertUsabilityEvaluationResult(expectedDefects, 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
[1335]179        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]180            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[474]181
[1335]182        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]183    }
[474]184
[561]185    /**
[1335]186     *
[561]187     */
188    @Test
[1335]189    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_01() {
190        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[474]191
[561]192        // ===== check =====
193        String spec =
[1335]194            "UserSession {" +
195            "  Sequence {" +
196            "    Interaction elem1 {}" +
197            "    TextInput elem1 (a) {}" +
198            "    TextInput elem1 (b) {}" +
199            "    Interaction elem1 {}" +
200            "    TextInput elem1 (c) {}" +
201            "  }" +
[561]202            "}";
[497]203
[561]204        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
205            { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) };
[497]206
[1335]207        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
208    }
[497]209
[1335]210    /**
211     *
212     */
213    @Test
214    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_02() {
215        TextInputStatisticsRule rule = new TextInputStatisticsRule();
216
[561]217        // ===== check =====
[1335]218        String spec =
219            "UserSession {" +
220            "  Sequence {" +
221            "    Interaction elem1 {}" +
222            "    TextInput elem1 (a) {}" +
223            "    Interaction elem1 {}" +
224            "    Interaction elem1 {}" +
225            "    TextInput elem1 (c) {}" +
226            "  }" +
[561]227            "}";
[497]228
[1335]229        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]230            { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) };
231
[1335]232        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]233
[1335]234    }
235
236
237    /**
238     *
239     */
240    @Test
241    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_03() {
242        TextInputStatisticsRule rule = new TextInputStatisticsRule();
243
[561]244        // ===== check =====
[1335]245        String spec =
246            "UserSession {" +
247            "  Sequence {" +
248            "    Interaction elem1 {}" +
249            "    TextInput elem1 (a) {}" +
250            "    Interaction elem1 {}" +
251            "    Interaction elem1 {}" +
252            "    Interaction elem1 {}" +
253            "  }" +
[561]254            "}";
255
[1335]256        UsabilityDefect[] expectedDefects = new UsabilityDefect[0];
[561]257
[1335]258        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]259
[1335]260    }
261
262
263    /**
264     *
265     */
266    @Test
267    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_04() {
268        TextInputStatisticsRule rule = new TextInputStatisticsRule();
269
[561]270        // ===== check =====
[1335]271        String spec =
272            "UserSession {" +
273            "  Selection {" +
274            "    TextInput elem1 (a) {}" +
275            "  }" +
[561]276            "}";
277
[1335]278        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
279            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
[561]280
[1335]281        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]282
[1335]283    }
284
285
286    /**
287     *
288     */
289    @Test
290    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_05() {
291        TextInputStatisticsRule rule = new TextInputStatisticsRule();
292
[561]293        // ===== check =====
[1335]294        String spec =
295            "UserSession {" +
296            "  Sequence seq1 {" +
297            "    TextInput elem1 (a) {}" +
298            "    Sequence seq2 {" +
299            "      Interaction elem1 {}" +
300            "      TextInput elem1 (b) {}" +
301            "      TextInput elem1 (c) {}" +
302            "      Interaction elem1 {}" +
303            "      TextInput elem1 (d) {}" +
[561]304            "    }" +
[1335]305            "    Iteration it1 {" +
306            "      TextInput elem1 (e) {}" +
[561]307            "    }" +
[1335]308            "    Interaction elem1 {}" +
309            "    Selection sel1 {" +
310            "      TextInput elem1 (f) {}" +
[561]311            "    }" +
[1335]312            "    Sequence seq3 {" +
313            "      TextInput elem1 (j) {}" +
314            "      Sequence seq4 {" +
315            "        TextInput elem1 (k) {}" +
316            "        Interaction elem1 {}" +
317            "        TextInput elem1 (l) {}" +
318            "        TextInput elem1 (m) {}" +
319            "        Interaction elem1 {}" +
320            "        TextInput elem1 (n) {}" +
321            "        TextInput elem1 (o) {}" +
322            "      }" +
323            "      Iteration it2{" +
324            "        Interaction elem1 {}" +
325            "      }" +
326            "      Interaction elem1 {}" +
327            "      Selection sel1 {" +
328            "        TextInput elem1 (p) {}" +
329            "      }" +
[561]330            "    }" +
[1335]331            "    Selection sel1 {" +
332            "      Sequence seq 5{" +
333            "        TextInput elem1 (w) {}" +
334            "        Interaction elem1 {}" +
335            "        TextInput elem1 (x) {}" +
336            "        TextInput elem1 (y) {}" +
337            "        Interaction elem1 {}" +
338            "      }" +
[561]339            "    }" +
[1335]340            "    Interaction elem1 {}" +
[561]341            "  }" +
342            "}";
343
[1335]344        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]345            { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) };
346
[1335]347        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]348
[1335]349    }
350
351
352    /**
353     *
354     */
355    @Test
356    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_06() {
357        TextInputStatisticsRule rule = new TextInputStatisticsRule();
358
[561]359        // ===== check =====
[1335]360        String spec =
361            "UserSession {" +
362            "  Sequence seq1 {" +
363            "    TextInput elem1 (a) {}" +
364            "    Sequence seq2 {" +
365            "      Interaction elem1 {}" +
366            "      TextInput elem1 (b) {}" +
367            "      Interaction elem1 {}" +
368            "      Interaction elem1 {}" +
369            "      TextInput elem1 (c) {}" +
[561]370            "    }" +
[1335]371            "    Iteration it1 {" +
372            "      TextInput elem1 (d) {}" +
[561]373            "    }" +
[1335]374            "    Interaction elem1 {}" +
375            "    Selection sel1 {" +
376            "      TextInput elem1 (e) {}" +
[561]377            "    }" +
[1335]378            "    Sequence seq3 {" +
379            "      TextInput elem1 (i) {}" +
380            "      Sequence seq4 {" +
381            "        TextInput elem1 (j) {}" +
382            "        Interaction elem1 {}" +
383            "        TextInput elem1 (k) {}" +
384            "        Interaction elem1 {}" +
385            "        Interaction elem1 {}" +
386            "        TextInput elem1 (m) {}" +
387            "        Interaction elem1 {}" +
388            "      }" +
389            "      Iteration it2 {" +
390            "        Interaction elem1 {}" +
391            "      }" +
392            "      Interaction elem1 {}" +
393            "      Selection sel1 {" +
394            "        Interaction elem1 {}" +
395            "      }" +
[561]396            "    }" +
[1335]397            "    Selection sel1 {" +
398            "      Sequence seq5 {" +
399            "        TextInput elem1 (v) {}" +
400            "        Interaction elem1 {}" +
401            "        Interaction elem1 {}" +
402            "        TextInput elem1 (x) {}" +
403            "        Interaction elem1 {}" +
404            "      }" +
[561]405            "    }" +
[1335]406            "    Interaction elem1 {}" +
[561]407            "  }" +
408            "}";
409
[1335]410        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]411            { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) };
412
[1335]413        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]414    }
415
416    /**
[1335]417     *
[561]418     */
419    @Test
[1335]420    public void testTextEntryRepetitions_01() {
421        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[561]422
423        // ===== check =====
424        String spec =
[1335]425            "UserSession {" +
426            "  Sequence seq1 {" +
427            "    TextInput elem1 (a) {}" +
428            "    TextInput elem2 (a) {}" +
[561]429            "  }" +
430            "}";
431
432        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
433            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]434              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
[561]435              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) };
436
[1335]437        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
438    }
[561]439
[1335]440    /**
441     *
442     */
443    @Test
444    public void testTextEntryRepetitions_02() {
445        TextInputStatisticsRule rule = new TextInputStatisticsRule();
446
[561]447        // ===== check =====
[1335]448        String spec =
449            "UserSession {" +
450            "  Sequence seq1 {" +
451            "    TextInput elem1 (a) {}" +
452            "    Sequence seq2 {" +
453            "      TextInput elem2 (a) {}" +
[561]454            "    }" +
[1335]455            "    Iteration it1 {" +
456            "      TextInput elem3 (a) {}" +
457            "    }" +
458            "    Selection sel1 {" +
459            "      TextInput elem4 (a) {}" +
460            "    }" +
[561]461            "  }" +
462            "}";
463
[1335]464        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]465            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]466              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
467              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
468              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
469              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
470              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
471              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
472              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
473              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
474              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
475              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
476              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
[561]477              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) };
478
[1335]479        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]480
[1335]481    }
482
483    /**
484     *
485     */
486    @Test
487    public void testTextEntryRepetitions_03() {
488        TextInputStatisticsRule rule = new TextInputStatisticsRule();
489
[561]490        // ===== check =====
[1335]491        String spec =
492            "UserSession {" +
493            "  Sequence seq1 {" +
494            "    TextInput elem1 (a) {}" +
495            "    TextInput elem2 (z) {}" +
496            "    TextInput elem1 (b) {}" +
497            "    TextInput elem2 (b) {}" +
498            "    TextInput elem1 (c) {}" +
499            "    TextInput elem2 (c) {}" +
[561]500            "  }" +
501            "}";
502
[1335]503        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]504            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]505              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS),
[561]506              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) };
507
[1335]508        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]509
[1335]510    }
511
512    /**
513     *
514     */
515    @Test
516    public void testTextEntryRepetitions_04() {
517        TextInputStatisticsRule rule = new TextInputStatisticsRule();
518
[561]519        // ===== check =====
[1335]520        String spec =
521            "UserSession {" +
522            "  Sequence seq1 {" +
523            "    TextInput elem1 (a) {}" +
524            "    TextInput elem2 (z) {}" +
525            "    TextInput elem1 (b) {}" +
526            "    TextInput elem2 (y) {}" +
527            "    TextInput elem1 (c) {}" +
528            "    TextInput elem2 (c) {}" +
[561]529            "  }" +
530            "}";
531
[1335]532        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]533            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]534              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS),
535              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) };
[561]536
[1335]537        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]538
[1335]539    }
540
541    /**
542     *
543     */
544    @Test
545    public void testTextEntryRepetitions_05() {
546        TextInputStatisticsRule rule = new TextInputStatisticsRule();
547
[561]548        // ===== check =====
[1335]549        String spec =
550            "UserSession {" +
551            "  Sequence seq1 {" +
552            "    TextInput elem1 (a) {}" +
553            "    TextInput elem2 (z) {}" +
554            "    TextInput elem1 (b) {}" +
555            "    TextInput elem2 (y) {}" +
556            "    TextInput elem1 (c) {}" +
557            "    TextInput elem2 (x) {}" +
558            "    TextInput elem1 (d) {}" +
559            "    TextInput elem2 (w) {}" +
560            "    TextInput elem1 (e) {}" +
561            "    TextInput elem2 (v) {}" +
562            "    TextInput elem1 (f) {}" +
563            "    TextInput elem2 (f) {}" +
[561]564            "  }" +
565            "}";
566
[1335]567        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]568            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]569              new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS),
570              new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS) };
[561]571
[1335]572        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]573
[1335]574    }
575
576    /**
577     *
578     */
579    @Test
580    public void testTextEntryRepetitions_06() {
581        TextInputStatisticsRule rule = new TextInputStatisticsRule();
582
[561]583        // ===== check =====
[1335]584        String spec =
585            "UserSession {" +
586            "  Sequence seq1 {" +
587            "    TextInput elem1 (a) {}" +
588            "    TextInput elem1 (b) {}" +
589            "    Sequence seq2 {" +
590            "      TextInput elem2 (a) {}" +
591            "      TextInput elem2 (b) {}" +
592            "      TextInput elem2 (c) {}" +
593            "    }" +
[561]594            "  }" +
595            "}";
596
[1335]597        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]598            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]599              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
600              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) };
[561]601
[1335]602        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
603    }
[561]604
[1335]605    /**
606     *
607     */
608    @Test
609    public void testTextEntryRepetitions_07() {
610        TextInputStatisticsRule rule = new TextInputStatisticsRule();
611
[561]612        // ===== check =====
[1335]613        String spec =
614            "UserSession {" +
615            "  Sequence seq1 {" +
616            "    TextInput elem1 (a) {}" +
617            "    Sequence seq2 {" +
618            "      TextInput elem2 (a) {}" +
619            "      TextInput elem2 (b) {}" +
620            "      TextInput elem2 (c) {}" +
621            "    }" +
[561]622            "  }" +
623            "}";
624
[1335]625        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]626            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
[1335]627              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
628              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) };
[561]629
[1335]630        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]631    }
632
633    /**
[1335]634     *
[561]635     */
636    @Test
[1335]637    public void testNoLetterOrDigitInput_01() {
638        TextInputStatisticsRule rule = new TextInputStatisticsRule();
[561]639
640        // ===== check =====
641        String spec =
[1335]642            "UserSession {" +
643            "  Sequence {" +
644            "    TextInput elem1 (_a_b_c_) {}" +
645            "  }" +
[561]646            "}";
647
648        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
649            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
650              new UsabilityDefect(HIGH, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
651
[1335]652        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]653
[1335]654    }
655
656    /**
657     *
658     */
659    @Test
660    public void testNoLetterOrDigitInput_02() {
661        TextInputStatisticsRule rule = new TextInputStatisticsRule();
662
[561]663        // ===== check =====
[1335]664        String spec =
665            "UserSession {" +
666            "  Sequence {" +
667            "    TextInput elem1 (12345_6789012345) {}" +
668            "  }" +
[561]669            "}";
670
[1335]671        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]672            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
673              new UsabilityDefect(MEDIUM, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
674
[1335]675        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]676
[1335]677    }
678
679    /**
680     *
681     */
682    @Test
683    public void testNoLetterOrDigitInput_03() {
684        TextInputStatisticsRule rule = new TextInputStatisticsRule();
685
[561]686        // ===== check =====
[1335]687        String spec =
688            "UserSession {" +
689            "  Sequence {" +
690            "    TextInput elem1 (123456789012345678901234567890_123456789012345) {}" +
691            "  }" +
[561]692            "}";
693
[1335]694        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]695            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
696              new UsabilityDefect(LOW, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
697
[1335]698        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]699
[1335]700    }
701
702    /**
703     *
704     */
705    @Test
706    public void testNoLetterOrDigitInput_04() {
707        TextInputStatisticsRule rule = new TextInputStatisticsRule();
708
[561]709        // ===== check =====
[1335]710        String spec =
711            "UserSession {" +
712            "  Sequence {" +
713            "    TextInput elem1 (1234567890123456789012345678901234567890123456789_01234567890" +
[561]714            "12345678901234567890123456789012345) {}" +
[1335]715            "  }" +
[561]716            "}";
717
[1335]718        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
[561]719            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
720              new UsabilityDefect(INFO, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
721
[1335]722        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
[561]723
724    }
[474]725}
Note: See TracBrowser for help on using the repository browser.