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
Line 
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
15package de.ugoe.cs.autoquest.usability;
16
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;
24
25import org.junit.Test;
26
27import de.ugoe.cs.autoquest.usability.UsabilityDefect;
28
29/**
30 *
31 */
32public class TextInputStatisticsRuleTest extends AbstractUsabilityEvaluationTC {
33
34    /**
35     *
36     */
37    @Test
38    public void testWithDifferentTextInputInteractionsOnly_01() {
39        TextInputStatisticsRule rule = new TextInputStatisticsRule();
40
41        // ===== check =====
42        String spec =
43            "UserSession {" +
44            "  TextInput elem1 (bla) {}" +
45            "}";
46       
47        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
48            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
49
50        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
51
52    }
53
54    /**
55     *
56     */
57    @Test
58    public void testWithDifferentTextInputInteractionsOnly_02() {
59        TextInputStatisticsRule rule = new TextInputStatisticsRule();
60
61        // ===== check =====
62        String spec =
63            "UserSession {" +
64            "  TextInput elem1 (a) {}" +
65            "  TextInput elem1 (b) {}" +
66            "  TextInput elem1 (c) {}" +
67            "  TextInput elem1 (d) {}" +
68            "}";
69
70        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
71            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
72
73        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
74
75    }
76
77
78    /**
79     *
80     */
81    @Test
82    public void testWithDifferentTextInputInteractionsOnly_03() {
83        TextInputStatisticsRule rule = new TextInputStatisticsRule();
84
85        // ===== check =====
86        String spec =
87            "UserSession {" +
88            "  TextInput elem1 (a) {}" +
89            "  TextInput elem1 (b) {}" +
90            "  TextInput elem1 (c) {}" +
91            "  TextInput elem1 (d) {}" +
92            "}";
93
94        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
95            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
96
97        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
98
99    }
100
101
102    /**
103     *
104     */
105    @Test
106    public void testWithDifferentTextInputInteractionsOnly_04() {
107        TextInputStatisticsRule rule = new TextInputStatisticsRule();
108
109        // ===== check =====
110        String spec =
111            "UserSession {" +
112            "  Iteration {" +
113            "    TextInput elem1 (bla) {}" +
114            "  }" +
115            "}";
116
117        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
118            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
119
120        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
121
122    }
123
124
125    /**
126     *
127     */
128    @Test
129    public void testWithDifferentTextInputInteractionsOnly_05() {
130        TextInputStatisticsRule rule = new TextInputStatisticsRule();
131
132        // ===== check =====
133        String spec =
134            "UserSession {" +
135            "  Sequence {" +
136            "    TextInput elem1 (a) {}" +
137            "    Sequence seq1 {" +
138            "      TextInput elem1 (b) {}" +
139            "      TextInput elem1 (c) {}" +
140            "      TextInput elem1 (d) {}" +
141            "      TextInput elem1 (e) {}" +
142            "    }" +
143            "    Iteration it1 {" +
144            "      TextInput elem1 (f) {}" +
145            "     TextInput elem1 (g) {}" +
146            "      TextInput elem1 (h) {}" +
147            "      TextInput elem1 (i) {}" +
148            "    }" +
149            "    TextInput elem1 (j) {}" +
150            "    Selection sel1 {" +
151            "      TextInput elem1 (k) {}" +
152            "    }" +
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            "      }" +
171            "    }" +
172            "    Selection sel2 {" +
173            "      TextInput elem1 (w) {}" +
174            "    }" +
175            "    TextInput elem1 (x) {}" +
176            "  }" +
177            "}";
178
179        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
180            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
181
182        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
183    }
184
185    /**
186     *
187     */
188    @Test
189    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_01() {
190        TextInputStatisticsRule rule = new TextInputStatisticsRule();
191
192        // ===== check =====
193        String spec =
194            "UserSession {" +
195            "  Sequence {" +
196            "    Interaction elem1 {}" +
197            "    TextInput elem1 (a) {}" +
198            "    TextInput elem1 (b) {}" +
199            "    Interaction elem1 {}" +
200            "    TextInput elem1 (c) {}" +
201            "  }" +
202            "}";
203
204        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
205            { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) };
206
207        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
208    }
209
210    /**
211     *
212     */
213    @Test
214    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_02() {
215        TextInputStatisticsRule rule = new TextInputStatisticsRule();
216
217        // ===== check =====
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            "  }" +
227            "}";
228
229        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
230            { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) };
231
232        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
233
234    }
235
236
237    /**
238     *
239     */
240    @Test
241    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_03() {
242        TextInputStatisticsRule rule = new TextInputStatisticsRule();
243
244        // ===== check =====
245        String spec =
246            "UserSession {" +
247            "  Sequence {" +
248            "    Interaction elem1 {}" +
249            "    TextInput elem1 (a) {}" +
250            "    Interaction elem1 {}" +
251            "    Interaction elem1 {}" +
252            "    Interaction elem1 {}" +
253            "  }" +
254            "}";
255
256        UsabilityDefect[] expectedDefects = new UsabilityDefect[0];
257
258        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
259
260    }
261
262
263    /**
264     *
265     */
266    @Test
267    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_04() {
268        TextInputStatisticsRule rule = new TextInputStatisticsRule();
269
270        // ===== check =====
271        String spec =
272            "UserSession {" +
273            "  Selection {" +
274            "    TextInput elem1 (a) {}" +
275            "  }" +
276            "}";
277
278        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
279            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) };
280
281        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
282
283    }
284
285
286    /**
287     *
288     */
289    @Test
290    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_05() {
291        TextInputStatisticsRule rule = new TextInputStatisticsRule();
292
293        // ===== check =====
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) {}" +
304            "    }" +
305            "    Iteration it1 {" +
306            "      TextInput elem1 (e) {}" +
307            "    }" +
308            "    Interaction elem1 {}" +
309            "    Selection sel1 {" +
310            "      TextInput elem1 (f) {}" +
311            "    }" +
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            "      }" +
330            "    }" +
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            "      }" +
339            "    }" +
340            "    Interaction elem1 {}" +
341            "  }" +
342            "}";
343
344        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
345            { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) };
346
347        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
348
349    }
350
351
352    /**
353     *
354     */
355    @Test
356    public void testCombinationsOfTextInputInteractionsAndOtherInteractions_06() {
357        TextInputStatisticsRule rule = new TextInputStatisticsRule();
358
359        // ===== check =====
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) {}" +
370            "    }" +
371            "    Iteration it1 {" +
372            "      TextInput elem1 (d) {}" +
373            "    }" +
374            "    Interaction elem1 {}" +
375            "    Selection sel1 {" +
376            "      TextInput elem1 (e) {}" +
377            "    }" +
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            "      }" +
396            "    }" +
397            "    Selection sel1 {" +
398            "      Sequence seq5 {" +
399            "        TextInput elem1 (v) {}" +
400            "        Interaction elem1 {}" +
401            "        Interaction elem1 {}" +
402            "        TextInput elem1 (x) {}" +
403            "        Interaction elem1 {}" +
404            "      }" +
405            "    }" +
406            "    Interaction elem1 {}" +
407            "  }" +
408            "}";
409
410        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
411            { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) };
412
413        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
414    }
415
416    /**
417     *
418     */
419    @Test
420    public void testTextEntryRepetitions_01() {
421        TextInputStatisticsRule rule = new TextInputStatisticsRule();
422
423        // ===== check =====
424        String spec =
425            "UserSession {" +
426            "  Sequence seq1 {" +
427            "    TextInput elem1 (a) {}" +
428            "    TextInput elem2 (a) {}" +
429            "  }" +
430            "}";
431
432        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
433            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
434              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
435              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) };
436
437        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
438    }
439
440    /**
441     *
442     */
443    @Test
444    public void testTextEntryRepetitions_02() {
445        TextInputStatisticsRule rule = new TextInputStatisticsRule();
446
447        // ===== check =====
448        String spec =
449            "UserSession {" +
450            "  Sequence seq1 {" +
451            "    TextInput elem1 (a) {}" +
452            "    Sequence seq2 {" +
453            "      TextInput elem2 (a) {}" +
454            "    }" +
455            "    Iteration it1 {" +
456            "      TextInput elem3 (a) {}" +
457            "    }" +
458            "    Selection sel1 {" +
459            "      TextInput elem4 (a) {}" +
460            "    }" +
461            "  }" +
462            "}";
463
464        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
465            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
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),
477              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) };
478
479        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
480
481    }
482
483    /**
484     *
485     */
486    @Test
487    public void testTextEntryRepetitions_03() {
488        TextInputStatisticsRule rule = new TextInputStatisticsRule();
489
490        // ===== check =====
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) {}" +
500            "  }" +
501            "}";
502
503        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
504            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
505              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS),
506              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) };
507
508        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
509
510    }
511
512    /**
513     *
514     */
515    @Test
516    public void testTextEntryRepetitions_04() {
517        TextInputStatisticsRule rule = new TextInputStatisticsRule();
518
519        // ===== check =====
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) {}" +
529            "  }" +
530            "}";
531
532        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
533            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
534              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS),
535              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) };
536
537        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
538
539    }
540
541    /**
542     *
543     */
544    @Test
545    public void testTextEntryRepetitions_05() {
546        TextInputStatisticsRule rule = new TextInputStatisticsRule();
547
548        // ===== check =====
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) {}" +
564            "  }" +
565            "}";
566
567        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
568            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
569              new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS),
570              new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS) };
571
572        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
573
574    }
575
576    /**
577     *
578     */
579    @Test
580    public void testTextEntryRepetitions_06() {
581        TextInputStatisticsRule rule = new TextInputStatisticsRule();
582
583        // ===== check =====
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            "    }" +
594            "  }" +
595            "}";
596
597        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
598            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
599              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
600              new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) };
601
602        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
603    }
604
605    /**
606     *
607     */
608    @Test
609    public void testTextEntryRepetitions_07() {
610        TextInputStatisticsRule rule = new TextInputStatisticsRule();
611
612        // ===== check =====
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            "    }" +
622            "  }" +
623            "}";
624
625        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
626            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
627              new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS),
628              new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) };
629
630        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
631    }
632
633    /**
634     *
635     */
636    @Test
637    public void testNoLetterOrDigitInput_01() {
638        TextInputStatisticsRule rule = new TextInputStatisticsRule();
639
640        // ===== check =====
641        String spec =
642            "UserSession {" +
643            "  Sequence {" +
644            "    TextInput elem1 (_a_b_c_) {}" +
645            "  }" +
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
652        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
653
654    }
655
656    /**
657     *
658     */
659    @Test
660    public void testNoLetterOrDigitInput_02() {
661        TextInputStatisticsRule rule = new TextInputStatisticsRule();
662
663        // ===== check =====
664        String spec =
665            "UserSession {" +
666            "  Sequence {" +
667            "    TextInput elem1 (12345_6789012345) {}" +
668            "  }" +
669            "}";
670
671        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
672            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
673              new UsabilityDefect(MEDIUM, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
674
675        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
676
677    }
678
679    /**
680     *
681     */
682    @Test
683    public void testNoLetterOrDigitInput_03() {
684        TextInputStatisticsRule rule = new TextInputStatisticsRule();
685
686        // ===== check =====
687        String spec =
688            "UserSession {" +
689            "  Sequence {" +
690            "    TextInput elem1 (123456789012345678901234567890_123456789012345) {}" +
691            "  }" +
692            "}";
693
694        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
695            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
696              new UsabilityDefect(LOW, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
697
698        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
699
700    }
701
702    /**
703     *
704     */
705    @Test
706    public void testNoLetterOrDigitInput_04() {
707        TextInputStatisticsRule rule = new TextInputStatisticsRule();
708
709        // ===== check =====
710        String spec =
711            "UserSession {" +
712            "  Sequence {" +
713            "    TextInput elem1 (1234567890123456789012345678901234567890123456789_01234567890" +
714            "12345678901234567890123456789012345) {}" +
715            "  }" +
716            "}";
717
718        UsabilityDefect[] expectedDefects = new UsabilityDefect[]
719            { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO),
720              new UsabilityDefect(INFO, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) };
721
722        assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec)));
723
724    }
725}
Note: See TracBrowser for help on using the repository browser.