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 | |
---|
15 | package de.ugoe.cs.autoquest.usability; |
---|
16 | |
---|
17 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO; |
---|
18 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS; |
---|
19 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; |
---|
20 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.HIGH; |
---|
21 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.INFO; |
---|
22 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.LOW; |
---|
23 | import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.MEDIUM; |
---|
24 | |
---|
25 | import org.junit.Test; |
---|
26 | |
---|
27 | import de.ugoe.cs.autoquest.usability.UsabilityDefect; |
---|
28 | import de.ugoe.cs.autoquest.usability.UsabilityDefectDescription; |
---|
29 | import de.ugoe.cs.autoquest.usability.UsabilityEvaluationManager; |
---|
30 | |
---|
31 | /** |
---|
32 | * TODO comment |
---|
33 | * |
---|
34 | * @version $Revision: $ $Date: 18.07.2012$ |
---|
35 | * @author 2012, last modified by $Author: pharms$ |
---|
36 | */ |
---|
37 | public class TextInputStatisticsRuleTest extends AbstractUsabilityEvaluationTC { |
---|
38 | |
---|
39 | /** |
---|
40 | * TODO: comment |
---|
41 | * |
---|
42 | */ |
---|
43 | @Test |
---|
44 | public void testWithDifferentTextInputInteractionsOnly() { |
---|
45 | UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); |
---|
46 | |
---|
47 | // ===== check ===== |
---|
48 | String spec = |
---|
49 | "TextInput (bla) {}"; |
---|
50 | UsabilityDefect[] expectedDefects = new UsabilityDefect[] |
---|
51 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; |
---|
52 | |
---|
53 | assertUsabilityEvaluationResult |
---|
54 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
55 | |
---|
56 | // ===== check ===== |
---|
57 | spec = |
---|
58 | "Sequence {" + |
---|
59 | " TextInput (bla) {}" + |
---|
60 | "}"; |
---|
61 | |
---|
62 | expectedDefects = new UsabilityDefect[] |
---|
63 | { new UsabilityDefect(HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) }; |
---|
64 | |
---|
65 | assertUsabilityEvaluationResult |
---|
66 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
67 | |
---|
68 | // ===== check ===== |
---|
69 | spec = |
---|
70 | "Sequence {" + |
---|
71 | " TextInput (a) {}" + |
---|
72 | " TextInput (b) {}" + |
---|
73 | " TextInput (c) {}" + |
---|
74 | " TextInput (d) {}" + |
---|
75 | "}"; |
---|
76 | |
---|
77 | expectedDefects = new UsabilityDefect[] |
---|
78 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; |
---|
79 | |
---|
80 | assertUsabilityEvaluationResult |
---|
81 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
82 | |
---|
83 | // ===== check ===== |
---|
84 | spec = |
---|
85 | "Selection {" + |
---|
86 | " TextInput (a) {}" + |
---|
87 | " TextInput (b) {}" + |
---|
88 | " TextInput (c) {}" + |
---|
89 | " TextInput (d) {}" + |
---|
90 | "}"; |
---|
91 | |
---|
92 | expectedDefects = new UsabilityDefect[] |
---|
93 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; |
---|
94 | |
---|
95 | assertUsabilityEvaluationResult |
---|
96 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
97 | |
---|
98 | // ===== check ===== |
---|
99 | spec = |
---|
100 | "Iteration {" + |
---|
101 | " TextInput (bla) {}" + |
---|
102 | "}"; |
---|
103 | |
---|
104 | expectedDefects = new UsabilityDefect[] |
---|
105 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; |
---|
106 | |
---|
107 | assertUsabilityEvaluationResult |
---|
108 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
109 | |
---|
110 | // ===== check ===== |
---|
111 | spec = |
---|
112 | "Sequence {" + |
---|
113 | " TextInput (a) {}" + |
---|
114 | " Sequence {" + |
---|
115 | " TextInput (b) {}" + |
---|
116 | " TextInput (c) {}" + |
---|
117 | " TextInput (d) {}" + |
---|
118 | " TextInput (e) {}" + |
---|
119 | " }" + |
---|
120 | " Iteration {" + |
---|
121 | " TextInput (f) {}" + |
---|
122 | " }" + |
---|
123 | " TextInput (g) {}" + |
---|
124 | " Selection {" + |
---|
125 | " TextInput (h) {}" + |
---|
126 | " TextInput (i) {}" + |
---|
127 | " TextInput (j) {}" + |
---|
128 | " TextInput (k) {}" + |
---|
129 | " }" + |
---|
130 | " Sequence {" + |
---|
131 | " TextInput (l) {}" + |
---|
132 | " Sequence {" + |
---|
133 | " TextInput (m) {}" + |
---|
134 | " TextInput (n) {}" + |
---|
135 | " TextInput (o) {}" + |
---|
136 | " TextInput (p) {}" + |
---|
137 | " }" + |
---|
138 | " Iteration {" + |
---|
139 | " TextInput (q) {}" + |
---|
140 | " }" + |
---|
141 | " TextInput (r) {}" + |
---|
142 | " Selection {" + |
---|
143 | " TextInput (s) {}" + |
---|
144 | " TextInput (t) {}" + |
---|
145 | " TextInput (u) {}" + |
---|
146 | " TextInput (v) {}" + |
---|
147 | " }" + |
---|
148 | " }" + |
---|
149 | " Selection {" + |
---|
150 | " TextInput (w) {}" + |
---|
151 | " Sequence {" + |
---|
152 | " TextInput (x) {}" + |
---|
153 | " TextInput (y) {}" + |
---|
154 | " TextInput (z) {}" + |
---|
155 | " TextInput (aa) {}" + |
---|
156 | " }" + |
---|
157 | " Iteration {" + |
---|
158 | " TextInput (ab) {}" + |
---|
159 | " }" + |
---|
160 | " TextInput (ac) {}" + |
---|
161 | " Selection {" + |
---|
162 | " TextInput (ad) {}" + |
---|
163 | " TextInput (ae) {}" + |
---|
164 | " TextInput (af) {}" + |
---|
165 | " TextInput (ag) {}" + |
---|
166 | " }" + |
---|
167 | " }" + |
---|
168 | " TextInput (ah) {}" + |
---|
169 | "}"; |
---|
170 | |
---|
171 | expectedDefects = new UsabilityDefect[] |
---|
172 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; |
---|
173 | |
---|
174 | assertUsabilityEvaluationResult |
---|
175 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
176 | } |
---|
177 | |
---|
178 | /** |
---|
179 | * TODO: comment |
---|
180 | * |
---|
181 | */ |
---|
182 | @Test |
---|
183 | public void testCombinationsOfTextInputInteractionsAndOtherInteractions() { |
---|
184 | UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); |
---|
185 | |
---|
186 | // ===== check ===== |
---|
187 | String spec = |
---|
188 | "Sequence {" + |
---|
189 | " Interaction {}" + |
---|
190 | " TextInput (a) {}" + |
---|
191 | " TextInput (b) {}" + |
---|
192 | " Interaction {}" + |
---|
193 | " TextInput (c) {}" + |
---|
194 | "}"; |
---|
195 | |
---|
196 | UsabilityDefect[] expectedDefects = new UsabilityDefect[] |
---|
197 | { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) }; |
---|
198 | |
---|
199 | assertUsabilityEvaluationResult |
---|
200 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
201 | |
---|
202 | // ===== check ===== |
---|
203 | spec = |
---|
204 | "Sequence {" + |
---|
205 | " Interaction {}" + |
---|
206 | " TextInput (a) {}" + |
---|
207 | " Interaction {}" + |
---|
208 | " Interaction {}" + |
---|
209 | " TextInput (c) {}" + |
---|
210 | "}"; |
---|
211 | |
---|
212 | expectedDefects = new UsabilityDefect[] |
---|
213 | { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) }; |
---|
214 | |
---|
215 | assertUsabilityEvaluationResult |
---|
216 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
217 | |
---|
218 | // ===== check ===== |
---|
219 | spec = |
---|
220 | "Sequence {" + |
---|
221 | " Interaction {}" + |
---|
222 | " TextInput (a) {}" + |
---|
223 | " Interaction {}" + |
---|
224 | " Interaction {}" + |
---|
225 | " Interaction {}" + |
---|
226 | "}"; |
---|
227 | |
---|
228 | expectedDefects = new UsabilityDefect[0]; |
---|
229 | |
---|
230 | assertUsabilityEvaluationResult |
---|
231 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
232 | |
---|
233 | // ===== check ===== |
---|
234 | spec = |
---|
235 | "Selection {" + |
---|
236 | " Interaction {}" + |
---|
237 | " TextInput (a) {}" + |
---|
238 | " TextInput (b) {}" + |
---|
239 | " Interaction {}" + |
---|
240 | " TextInput (c) {}" + |
---|
241 | "}"; |
---|
242 | |
---|
243 | expectedDefects = new UsabilityDefect[] |
---|
244 | { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) }; |
---|
245 | |
---|
246 | assertUsabilityEvaluationResult |
---|
247 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
248 | |
---|
249 | // ===== check ===== |
---|
250 | spec = |
---|
251 | "Sequence {" + |
---|
252 | " TextInput (a) {}" + |
---|
253 | " Sequence {" + |
---|
254 | " Interaction {}" + |
---|
255 | " TextInput (b) {}" + |
---|
256 | " TextInput (c) {}" + |
---|
257 | " Interaction {}" + |
---|
258 | " TextInput (d) {}" + |
---|
259 | " }" + |
---|
260 | " Iteration {" + |
---|
261 | " TextInput (e) {}" + |
---|
262 | " }" + |
---|
263 | " Interaction {}" + |
---|
264 | " Selection {" + |
---|
265 | " Interaction {}" + |
---|
266 | " TextInput (f) {}" + |
---|
267 | " TextInput (g) {}" + |
---|
268 | " Interaction {}" + |
---|
269 | " TextInput (h) {}" + |
---|
270 | " TextInput (i) {}" + |
---|
271 | " }" + |
---|
272 | " Sequence {" + |
---|
273 | " TextInput (j) {}" + |
---|
274 | " Sequence {" + |
---|
275 | " TextInput (k) {}" + |
---|
276 | " Interaction {}" + |
---|
277 | " TextInput (l) {}" + |
---|
278 | " TextInput (m) {}" + |
---|
279 | " Interaction {}" + |
---|
280 | " TextInput (n) {}" + |
---|
281 | " TextInput (o) {}" + |
---|
282 | " }" + |
---|
283 | " Iteration {" + |
---|
284 | " Interaction {}" + |
---|
285 | " }" + |
---|
286 | " Interaction {}" + |
---|
287 | " Selection {" + |
---|
288 | " TextInput (p) {}" + |
---|
289 | " TextInput (q) {}" + |
---|
290 | " TextInput (r) {}" + |
---|
291 | " Interaction {}" + |
---|
292 | " TextInput (s) {}" + |
---|
293 | " TextInput (t) {}" + |
---|
294 | " Interaction {}" + |
---|
295 | " TextInput (u) {}" + |
---|
296 | " TextInput (v) {}" + |
---|
297 | " }" + |
---|
298 | " }" + |
---|
299 | " Selection {" + |
---|
300 | " Interaction {}" + |
---|
301 | " Sequence {" + |
---|
302 | " TextInput (w) {}" + |
---|
303 | " Interaction {}" + |
---|
304 | " TextInput (x) {}" + |
---|
305 | " TextInput (y) {}" + |
---|
306 | " Interaction {}" + |
---|
307 | " }" + |
---|
308 | " Iteration {" + |
---|
309 | " TextInput (z) {}" + |
---|
310 | " }" + |
---|
311 | " TextInput (aa) {}" + |
---|
312 | " Selection {" + |
---|
313 | " TextInput (ab) {}" + |
---|
314 | " Interaction {}" + |
---|
315 | " TextInput (ac) {}" + |
---|
316 | " TextInput (ad) {}" + |
---|
317 | " Interaction {}" + |
---|
318 | " TextInput (ae) {}" + |
---|
319 | " }" + |
---|
320 | " }" + |
---|
321 | " Interaction {}" + |
---|
322 | "}"; |
---|
323 | |
---|
324 | expectedDefects = new UsabilityDefect[] |
---|
325 | { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) }; |
---|
326 | |
---|
327 | assertUsabilityEvaluationResult |
---|
328 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
329 | |
---|
330 | // ===== check ===== |
---|
331 | spec = |
---|
332 | "Sequence {" + |
---|
333 | " TextInput (a) {}" + |
---|
334 | " Sequence {" + |
---|
335 | " Interaction {}" + |
---|
336 | " TextInput (b) {}" + |
---|
337 | " Interaction {}" + |
---|
338 | " Interaction {}" + |
---|
339 | " TextInput (c) {}" + |
---|
340 | " }" + |
---|
341 | " Iteration {" + |
---|
342 | " TextInput (d) {}" + |
---|
343 | " }" + |
---|
344 | " Interaction {}" + |
---|
345 | " Selection {" + |
---|
346 | " Interaction {}" + |
---|
347 | " TextInput (e) {}" + |
---|
348 | " Interaction {}" + |
---|
349 | " Interaction {}" + |
---|
350 | " TextInput (g) {}" + |
---|
351 | " Interaction {}" + |
---|
352 | " }" + |
---|
353 | " Sequence {" + |
---|
354 | " TextInput (i) {}" + |
---|
355 | " Sequence {" + |
---|
356 | " TextInput (j) {}" + |
---|
357 | " Interaction {}" + |
---|
358 | " TextInput (k) {}" + |
---|
359 | " Interaction {}" + |
---|
360 | " Interaction {}" + |
---|
361 | " TextInput (m) {}" + |
---|
362 | " Interaction {}" + |
---|
363 | " }" + |
---|
364 | " Iteration {" + |
---|
365 | " Interaction {}" + |
---|
366 | " }" + |
---|
367 | " Interaction {}" + |
---|
368 | " Selection {" + |
---|
369 | " TextInput (o) {}" + |
---|
370 | " Interaction {}" + |
---|
371 | " Interaction {}" + |
---|
372 | " Interaction {}" + |
---|
373 | " Interaction {}" + |
---|
374 | " TextInput (s) {}" + |
---|
375 | " Interaction {}" + |
---|
376 | " TextInput (t) {}" + |
---|
377 | " TextInput (u) {}" + |
---|
378 | " }" + |
---|
379 | " }" + |
---|
380 | " Selection {" + |
---|
381 | " Interaction {}" + |
---|
382 | " Sequence {" + |
---|
383 | " TextInput (v) {}" + |
---|
384 | " Interaction {}" + |
---|
385 | " Interaction {}" + |
---|
386 | " TextInput (x) {}" + |
---|
387 | " Interaction {}" + |
---|
388 | " }" + |
---|
389 | " Iteration {" + |
---|
390 | " TextInput (y) {}" + |
---|
391 | " }" + |
---|
392 | " TextInput (z) {}" + |
---|
393 | " Selection {" + |
---|
394 | " TextInput (aa) {}" + |
---|
395 | " Interaction {}" + |
---|
396 | " TextInput (ab) {}" + |
---|
397 | " Interaction {}" + |
---|
398 | " Interaction {}" + |
---|
399 | " TextInput (ad) {}" + |
---|
400 | " }" + |
---|
401 | " }" + |
---|
402 | " Interaction {}" + |
---|
403 | "}"; |
---|
404 | |
---|
405 | expectedDefects = new UsabilityDefect[] |
---|
406 | { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) }; |
---|
407 | |
---|
408 | assertUsabilityEvaluationResult |
---|
409 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
410 | } |
---|
411 | |
---|
412 | /** |
---|
413 | * TODO: comment |
---|
414 | * |
---|
415 | */ |
---|
416 | @Test |
---|
417 | public void testTextEntryRepetitions() { |
---|
418 | UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); |
---|
419 | |
---|
420 | // ===== check ===== |
---|
421 | String spec = |
---|
422 | "Sequence {" + |
---|
423 | " TextInput (a b c) {}" + |
---|
424 | " Sequence {" + |
---|
425 | " TextInput (a) {}" + |
---|
426 | " TextInput (b) {}" + |
---|
427 | " TextInput (c) {}" + |
---|
428 | " TextInput (a) {}" + |
---|
429 | " }" + |
---|
430 | " Iteration {" + |
---|
431 | " TextInput (a) {}" + |
---|
432 | " }" + |
---|
433 | " TextInput (a) {}" + |
---|
434 | " Selection {" + |
---|
435 | " TextInput (b c) {}" + |
---|
436 | " TextInput (a) {}" + |
---|
437 | " TextInput (a c) {}" + |
---|
438 | " TextInput (b a) {}" + |
---|
439 | " }" + |
---|
440 | " Sequence {" + |
---|
441 | " TextInput (b c) {}" + |
---|
442 | " Sequence {" + |
---|
443 | " TextInput (d a c) {}" + |
---|
444 | " TextInput (b b b a) {}" + |
---|
445 | " TextInput (a a c c) {}" + |
---|
446 | " TextInput (b b a) {}" + |
---|
447 | " }" + |
---|
448 | " }" + |
---|
449 | " TextInput (d) {}" + |
---|
450 | "}"; |
---|
451 | |
---|
452 | UsabilityDefect[] expectedDefects = new UsabilityDefect[] |
---|
453 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
454 | new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
455 | |
---|
456 | assertUsabilityEvaluationResult |
---|
457 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
458 | |
---|
459 | // ===== check ===== |
---|
460 | spec = |
---|
461 | "Sequence {" + |
---|
462 | " TextInput (a b c d e f g h i j k l m) {}" + |
---|
463 | " Sequence {" + |
---|
464 | " TextInput (a) {}" + |
---|
465 | " TextInput (b) {}" + |
---|
466 | " TextInput (c) {}" + |
---|
467 | " TextInput (d) {}" + |
---|
468 | " }" + |
---|
469 | " Iteration {" + |
---|
470 | " TextInput (e) {}" + |
---|
471 | " }" + |
---|
472 | " TextInput (f) {}" + |
---|
473 | " Selection {" + |
---|
474 | " TextInput (g) {}" + |
---|
475 | " TextInput (h) {}" + |
---|
476 | " TextInput (i) {}" + |
---|
477 | " TextInput (j) {}" + |
---|
478 | " }" + |
---|
479 | " Sequence {" + |
---|
480 | " TextInput (k) {}" + |
---|
481 | " Sequence {" + |
---|
482 | " TextInput (l) {}" + |
---|
483 | " TextInput (m) {}" + |
---|
484 | " TextInput (n) {}" + |
---|
485 | " TextInput (o) {}" + |
---|
486 | " }" + |
---|
487 | " }" + |
---|
488 | " TextInput (p) {}" + |
---|
489 | "}"; |
---|
490 | |
---|
491 | expectedDefects = new UsabilityDefect[] |
---|
492 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
493 | new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
494 | |
---|
495 | assertUsabilityEvaluationResult |
---|
496 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
497 | |
---|
498 | // ===== check ===== |
---|
499 | spec = |
---|
500 | "Sequence {" + |
---|
501 | " TextInput (a b c d e f g h i j k l m) {}" + |
---|
502 | " Sequence {" + |
---|
503 | " TextInput (a) {}" + |
---|
504 | " TextInput (b) {}" + |
---|
505 | " TextInput (c) {}" + |
---|
506 | " TextInput (d) {}" + |
---|
507 | " }" + |
---|
508 | " Iteration {" + |
---|
509 | " TextInput (e) {}" + |
---|
510 | " }" + |
---|
511 | " TextInput (a) {}" + |
---|
512 | " Selection {" + |
---|
513 | " TextInput (b) {}" + |
---|
514 | " TextInput (c) {}" + |
---|
515 | " TextInput (d) {}" + |
---|
516 | " TextInput (e) {}" + |
---|
517 | " }" + |
---|
518 | " Sequence {" + |
---|
519 | " TextInput (a) {}" + |
---|
520 | " Sequence {" + |
---|
521 | " TextInput (b) {}" + |
---|
522 | " TextInput (c) {}" + |
---|
523 | " TextInput (d) {}" + |
---|
524 | " TextInput (e) {}" + |
---|
525 | " }" + |
---|
526 | " }" + |
---|
527 | " TextInput (f) {}" + |
---|
528 | "}"; |
---|
529 | |
---|
530 | expectedDefects = new UsabilityDefect[] |
---|
531 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
532 | new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
533 | |
---|
534 | assertUsabilityEvaluationResult |
---|
535 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
536 | |
---|
537 | // ===== check ===== |
---|
538 | spec = |
---|
539 | "Sequence {" + |
---|
540 | " TextInput (a b c d e f g h i j k l m) {}" + |
---|
541 | " Sequence {" + |
---|
542 | " TextInput (a) {}" + |
---|
543 | " TextInput (b) {}" + |
---|
544 | " TextInput (c) {}" + |
---|
545 | " TextInput (a) {}" + |
---|
546 | " }" + |
---|
547 | " Iteration {" + |
---|
548 | " TextInput (b) {}" + |
---|
549 | " }" + |
---|
550 | " TextInput (c) {}" + |
---|
551 | " Selection {" + |
---|
552 | " TextInput (a) {}" + |
---|
553 | " TextInput (b) {}" + |
---|
554 | " TextInput (c) {}" + |
---|
555 | " TextInput (a) {}" + |
---|
556 | " }" + |
---|
557 | " Sequence {" + |
---|
558 | " TextInput (b) {}" + |
---|
559 | " Sequence {" + |
---|
560 | " TextInput (c) {}" + |
---|
561 | " TextInput (a) {}" + |
---|
562 | " TextInput (b) {}" + |
---|
563 | " TextInput (c) {}" + |
---|
564 | " }" + |
---|
565 | " }" + |
---|
566 | " TextInput (a) {}" + |
---|
567 | "}"; |
---|
568 | |
---|
569 | expectedDefects = new UsabilityDefect[] |
---|
570 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
571 | new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
572 | |
---|
573 | assertUsabilityEvaluationResult |
---|
574 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
575 | |
---|
576 | // ===== check ===== |
---|
577 | spec = |
---|
578 | "Sequence {" + |
---|
579 | " TextInput (a b c) {}" + |
---|
580 | " Sequence {" + |
---|
581 | " TextInput (a) {}" + |
---|
582 | " TextInput (b) {}" + |
---|
583 | " TextInput (c) {}" + |
---|
584 | " }" + |
---|
585 | "}"; |
---|
586 | |
---|
587 | expectedDefects = new UsabilityDefect[] |
---|
588 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
589 | new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
590 | |
---|
591 | assertUsabilityEvaluationResult |
---|
592 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
593 | |
---|
594 | // ===== check ===== |
---|
595 | spec = |
---|
596 | "Sequence {" + |
---|
597 | " TextInput (a b c) {}" + |
---|
598 | " Sequence {" + |
---|
599 | " TextInput (a) {}" + |
---|
600 | " TextInput (a) {}" + |
---|
601 | " TextInput (b) {}" + |
---|
602 | " }" + |
---|
603 | "}"; |
---|
604 | |
---|
605 | expectedDefects = new UsabilityDefect[] |
---|
606 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
607 | new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
608 | |
---|
609 | assertUsabilityEvaluationResult |
---|
610 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
611 | |
---|
612 | // ===== check ===== |
---|
613 | spec = |
---|
614 | "Sequence {" + |
---|
615 | " TextInput (a b c) {}" + |
---|
616 | " Sequence {" + |
---|
617 | " TextInput (a) {}" + |
---|
618 | " TextInput (d) {}" + |
---|
619 | " TextInput (e) {}" + |
---|
620 | " }" + |
---|
621 | "}"; |
---|
622 | |
---|
623 | expectedDefects = new UsabilityDefect[] |
---|
624 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
625 | new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS) }; |
---|
626 | |
---|
627 | assertUsabilityEvaluationResult |
---|
628 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
629 | |
---|
630 | } |
---|
631 | |
---|
632 | /** |
---|
633 | * TODO: comment |
---|
634 | * |
---|
635 | */ |
---|
636 | @Test |
---|
637 | public void testNoLetterOrDigitInput() { |
---|
638 | UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); |
---|
639 | |
---|
640 | // ===== check ===== |
---|
641 | String spec = |
---|
642 | "Sequence {" + |
---|
643 | " TextInput (_a_b_c_) {}" + |
---|
644 | "}"; |
---|
645 | |
---|
646 | UsabilityDefect[] expectedDefects = new UsabilityDefect[] |
---|
647 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
648 | new UsabilityDefect(HIGH, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; |
---|
649 | |
---|
650 | assertUsabilityEvaluationResult |
---|
651 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
652 | |
---|
653 | // ===== check ===== |
---|
654 | spec = |
---|
655 | "Sequence {" + |
---|
656 | " TextInput (12345_6789012345) {}" + |
---|
657 | "}"; |
---|
658 | |
---|
659 | expectedDefects = new UsabilityDefect[] |
---|
660 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
661 | new UsabilityDefect(MEDIUM, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; |
---|
662 | |
---|
663 | assertUsabilityEvaluationResult |
---|
664 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
665 | |
---|
666 | // ===== check ===== |
---|
667 | spec = |
---|
668 | "Sequence {" + |
---|
669 | " TextInput (123456789012345678901234567890_123456789012345) {}" + |
---|
670 | "}"; |
---|
671 | |
---|
672 | expectedDefects = new UsabilityDefect[] |
---|
673 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
674 | new UsabilityDefect(LOW, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; |
---|
675 | |
---|
676 | assertUsabilityEvaluationResult |
---|
677 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
678 | |
---|
679 | // ===== check ===== |
---|
680 | spec = |
---|
681 | "Sequence {" + |
---|
682 | " TextInput (1234567890123456789012345678901234567890123456789_01234567890" + |
---|
683 | "12345678901234567890123456789012345) {}" + |
---|
684 | "}"; |
---|
685 | |
---|
686 | expectedDefects = new UsabilityDefect[] |
---|
687 | { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), |
---|
688 | new UsabilityDefect(INFO, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; |
---|
689 | |
---|
690 | assertUsabilityEvaluationResult |
---|
691 | (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); |
---|
692 | |
---|
693 | } |
---|
694 | } |
---|