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