Changeset 497 for trunk/quest-core-usability-test/src/test/java/de/ugoe
- Timestamp:
- 07/27/12 14:37:14 (12 years ago)
- Location:
- trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability/TextInputStatisticsRuleTest.java
r474 r497 8 8 package de.ugoe.cs.quest.usability; 9 9 10 import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO; 11 import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS; 12 import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; 13 import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.HIGH; 14 import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.INFO; 15 import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.LOW; 16 import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.MEDIUM; 17 10 18 import org.junit.Test; 11 12 import de.ugoe.cs.quest.usability.UsabilityDefect;13 import de.ugoe.cs.quest.usability.UsabilityDefectDescription;14 import de.ugoe.cs.quest.usability.UsabilityDefectSeverity;15 import de.ugoe.cs.quest.usability.UsabilityEvaluationManager;16 19 17 20 //------------------------------------------------------------------------------------------------- … … 37 40 UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 38 41 42 // ===== check ===== 39 43 String spec = "TextInput (bla) {}"; 40 44 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 41 45 { 42 new UsabilityDefect 43 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)44 };45 46 assertUsabilityEvaluationResult47 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));48 46 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 47 }; 48 49 assertUsabilityEvaluationResult 50 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 51 52 // ===== check ===== 49 53 spec = 50 54 "Sequence {" + … … 54 58 expectedDefects = new UsabilityDefect[] 55 59 { 56 new UsabilityDefect 57 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)58 };59 60 assertUsabilityEvaluationResult61 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));62 60 new UsabilityDefect(HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 61 }; 62 63 assertUsabilityEvaluationResult 64 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 65 66 // ===== check ===== 63 67 spec = 64 68 "Sequence {" + … … 71 75 expectedDefects = new UsabilityDefect[] 72 76 { 73 new UsabilityDefect 74 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)75 };76 77 assertUsabilityEvaluationResult78 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));79 77 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 78 }; 79 80 assertUsabilityEvaluationResult 81 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 82 83 // ===== check ===== 80 84 spec = 81 85 "Selection {" + … … 88 92 expectedDefects = new UsabilityDefect[] 89 93 { 90 new UsabilityDefect 91 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)92 };93 94 assertUsabilityEvaluationResult95 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));96 94 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 95 }; 96 97 assertUsabilityEvaluationResult 98 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 99 100 // ===== check ===== 97 101 spec = 98 102 "Iteration {" + … … 102 106 expectedDefects = new UsabilityDefect[] 103 107 { 104 new UsabilityDefect 105 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 108 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 106 109 }; 107 110 … … 109 112 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 110 113 114 // ===== check ===== 111 115 spec = 112 116 "Sequence {" + … … 171 175 expectedDefects = new UsabilityDefect[] 172 176 { 173 new UsabilityDefect 174 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 177 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 175 178 }; 176 179 … … 190 193 UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 191 194 195 // ===== check ===== 192 196 String spec = 193 197 "Sequence {" + … … 201 205 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 202 206 { 203 new UsabilityDefect 204 (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)205 };206 207 assertUsabilityEvaluationResult208 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));209 207 new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) 208 }; 209 210 assertUsabilityEvaluationResult 211 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 212 213 // ===== check ===== 210 214 spec = 211 215 "Sequence {" + … … 217 221 "}"; 218 222 223 expectedDefects = new UsabilityDefect[] 224 { 225 new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) 226 }; 227 228 assertUsabilityEvaluationResult 229 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 230 231 // ===== check ===== 232 spec = 233 "Sequence {" + 234 " Interaction {}" + 235 " TextInput (a) {}" + 236 " Interaction {}" + 237 " Interaction {}" + 238 " Interaction {}" + 239 "}"; 240 219 241 expectedDefects = new UsabilityDefect[0]; 220 221 assertUsabilityEvaluationResult222 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));223 242 243 assertUsabilityEvaluationResult 244 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 245 246 // ===== check ===== 224 247 spec = 225 248 "Selection {" + … … 233 256 expectedDefects = new UsabilityDefect[] 234 257 { 235 new UsabilityDefect 236 (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)237 };238 239 assertUsabilityEvaluationResult240 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));241 258 new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) 259 }; 260 261 assertUsabilityEvaluationResult 262 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 263 264 // ===== check ===== 242 265 spec = 243 266 "Sequence {" + … … 316 339 expectedDefects = new UsabilityDefect[] 317 340 { 318 new UsabilityDefect 319 (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)320 };321 322 assertUsabilityEvaluationResult323 (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));324 341 new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) 342 }; 343 344 assertUsabilityEvaluationResult 345 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 346 347 // ===== check ===== 325 348 spec = 326 349 "Sequence {" + … … 397 420 "}"; 398 421 399 expectedDefects = new UsabilityDefect[0]; 422 expectedDefects = new UsabilityDefect[] 423 { 424 new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) 425 }; 400 426 401 427 assertUsabilityEvaluationResult … … 414 440 UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 415 441 442 // ===== check ===== 416 443 String spec = 417 444 "Sequence {" + … … 447 474 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 448 475 { 449 new UsabilityDefect 450 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 451 new UsabilityDefect 452 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 476 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 477 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) 453 478 }; 454 479 … … 456 481 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 457 482 483 // ===== check ===== 458 484 spec = 459 485 "Sequence {" + … … 489 515 expectedDefects = new UsabilityDefect[] 490 516 { 491 new UsabilityDefect 492 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 493 new UsabilityDefect 494 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 495 }; 496 497 assertUsabilityEvaluationResult 498 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 499 517 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 518 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_REPETITIONS) 519 }; 520 521 assertUsabilityEvaluationResult 522 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 523 524 // ===== check ===== 500 525 spec = 501 526 "Sequence {" + … … 531 556 expectedDefects = new UsabilityDefect[] 532 557 { 533 new UsabilityDefect 534 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 535 new UsabilityDefect 536 (UsabilityDefectSeverity.MEDIUM, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 558 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 559 new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) 537 560 }; 538 561 … … 540 563 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 541 564 565 // ===== check ===== 542 566 spec = 543 567 "Sequence {" + … … 573 597 expectedDefects = new UsabilityDefect[] 574 598 { 575 new UsabilityDefect 576 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 577 new UsabilityDefect 578 (UsabilityDefectSeverity.MEDIUM, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 599 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 600 new UsabilityDefect(MEDIUM, TEXT_FIELD_INPUT_REPETITIONS) 579 601 }; 580 602 … … 582 604 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 583 605 606 // ===== check ===== 584 607 spec = 585 608 "Sequence {" + … … 594 617 expectedDefects = new UsabilityDefect[] 595 618 { 596 new UsabilityDefect 597 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 598 new UsabilityDefect 599 (UsabilityDefectSeverity.LOW, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 619 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 620 new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) 600 621 }; 601 622 … … 603 624 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 604 625 626 // ===== check ===== 605 627 spec = 606 628 "Sequence {" + … … 615 637 expectedDefects = new UsabilityDefect[] 616 638 { 617 new UsabilityDefect 618 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 619 new UsabilityDefect 620 (UsabilityDefectSeverity.LOW, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 639 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 640 new UsabilityDefect(LOW, TEXT_FIELD_INPUT_REPETITIONS) 621 641 }; 622 642 … … 624 644 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 625 645 646 // ===== check ===== 626 647 spec = 627 648 "Sequence {" + … … 636 657 expectedDefects = new UsabilityDefect[] 637 658 { 638 new UsabilityDefect 639 (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO), 640 new UsabilityDefect 641 (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS) 659 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 660 new UsabilityDefect(INFO, TEXT_FIELD_INPUT_REPETITIONS) 642 661 }; 643 662 … … 647 666 } 648 667 668 //----------------------------------------------------------------------------------------------- 669 /** 670 * TODO: comment 671 * 672 */ 673 //----------------------------------------------------------------------------------------------- 674 @Test 675 public void testNoLetterOrDigitInput() 676 { 677 UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 678 679 // ===== check ===== 680 String spec = 681 "Sequence {" + 682 " TextInput (_a_b_c_) {}" + 683 "}"; 684 685 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 686 { 687 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 688 new UsabilityDefect(HIGH, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) 689 }; 690 691 assertUsabilityEvaluationResult 692 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 693 694 // ===== check ===== 695 spec = 696 "Sequence {" + 697 " TextInput (12345_6789012345) {}" + 698 "}"; 699 700 expectedDefects = new UsabilityDefect[] 701 { 702 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 703 new UsabilityDefect(MEDIUM, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) 704 }; 705 706 assertUsabilityEvaluationResult 707 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 708 709 // ===== check ===== 710 spec = 711 "Sequence {" + 712 " TextInput (123456789012345678901234567890_123456789012345) {}" + 713 "}"; 714 715 expectedDefects = new UsabilityDefect[] 716 { 717 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 718 new UsabilityDefect(LOW, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) 719 }; 720 721 assertUsabilityEvaluationResult 722 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 723 724 // ===== check ===== 725 spec = 726 "Sequence {" + 727 " TextInput (1234567890123456789012345678901234567890123456789_01234567890" + 728 "12345678901234567890123456789012345) {}" + 729 "}"; 730 731 expectedDefects = new UsabilityDefect[] 732 { 733 new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO), 734 new UsabilityDefect(INFO, TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) 735 }; 736 737 assertUsabilityEvaluationResult 738 (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 739 740 } 649 741 } -
trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java
r475 r497 8 8 package de.ugoe.cs.quest.usability; 9 9 10 import static org.junit.Assert.*; 10 import static org.junit.Assert.assertNotNull; 11 import static org.junit.Assert.assertNotSame; 11 12 12 13 import java.util.HashMap; … … 14 15 15 16 import org.junit.Test; 16 17 import de.ugoe.cs.quest.usability.UsabilityDefectDescription;18 17 19 18 //-------------------------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.