Ignore:
Timestamp:
07/27/12 14:37:14 (12 years ago)
Author:
pharms
Message:
  • added further text entry based evaluation rule
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  
    88package de.ugoe.cs.quest.usability; 
    99 
     10import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO; 
     11import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS; 
     12import static de.ugoe.cs.quest.usability.UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; 
     13import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.HIGH; 
     14import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.INFO; 
     15import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.LOW; 
     16import static de.ugoe.cs.quest.usability.UsabilityDefectSeverity.MEDIUM; 
     17 
    1018import 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; 
    1619 
    1720//------------------------------------------------------------------------------------------------- 
     
    3740    UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 
    3841     
     42    // ===== check ===== 
    3943    String spec = "TextInput (bla) {}"; 
    4044    UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    4145    { 
    42       new UsabilityDefect 
    43         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    44     }; 
    45      
    46     assertUsabilityEvaluationResult 
    47       (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 ===== 
    4953    spec = 
    5054      "Sequence {" + 
     
    5458    expectedDefects = new UsabilityDefect[] 
    5559    { 
    56       new UsabilityDefect 
    57         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    58     }; 
    59      
    60     assertUsabilityEvaluationResult 
    61       (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 ===== 
    6367    spec = 
    6468      "Sequence {" + 
     
    7175    expectedDefects = new UsabilityDefect[] 
    7276    { 
    73       new UsabilityDefect 
    74         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    75     }; 
    76      
    77     assertUsabilityEvaluationResult 
    78       (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 ===== 
    8084    spec = 
    8185      "Selection {" + 
     
    8892    expectedDefects = new UsabilityDefect[] 
    8993    { 
    90       new UsabilityDefect 
    91         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    92     }; 
    93        
    94     assertUsabilityEvaluationResult 
    95       (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 ===== 
    97101    spec = 
    98102      "Iteration {" + 
     
    102106    expectedDefects = new UsabilityDefect[] 
    103107    { 
    104       new UsabilityDefect 
    105         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
     108      new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 
    106109    }; 
    107110       
     
    109112      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    110113         
     114    // ===== check ===== 
    111115    spec = 
    112116      "Sequence {" + 
     
    171175    expectedDefects = new UsabilityDefect[] 
    172176    { 
    173       new UsabilityDefect 
    174         (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
     177      new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) 
    175178    }; 
    176179     
     
    190193    UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 
    191194     
     195    // ===== check ===== 
    192196    String spec = 
    193197      "Sequence {" + 
     
    201205    UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    202206    { 
    203       new UsabilityDefect 
    204         (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    205     }; 
    206      
    207     assertUsabilityEvaluationResult 
    208       (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 ===== 
    210214    spec = 
    211215      "Sequence {" + 
     
    217221      "}"; 
    218222         
     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           
    219241    expectedDefects = new UsabilityDefect[0]; 
    220        
    221     assertUsabilityEvaluationResult 
    222       (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    223242         
     243    assertUsabilityEvaluationResult 
     244      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
     245         
     246    // ===== check ===== 
    224247    spec = 
    225248      "Selection {" + 
     
    233256    expectedDefects = new UsabilityDefect[] 
    234257    { 
    235       new UsabilityDefect 
    236         (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    237     }; 
    238        
    239     assertUsabilityEvaluationResult 
    240       (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 ===== 
    242265    spec = 
    243266      "Sequence {" + 
     
    316339    expectedDefects = new UsabilityDefect[] 
    317340    { 
    318       new UsabilityDefect 
    319         (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO) 
    320     }; 
    321      
    322     assertUsabilityEvaluationResult 
    323       (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 ===== 
    325348    spec = 
    326349      "Sequence {" + 
     
    397420      "}"; 
    398421 
    399     expectedDefects = new UsabilityDefect[0]; 
     422    expectedDefects = new UsabilityDefect[] 
     423    { 
     424      new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) 
     425    }; 
    400426 
    401427    assertUsabilityEvaluationResult 
     
    414440    UsabilityEvaluationManager manager = new UsabilityEvaluationManager(); 
    415441     
     442    // ===== check ===== 
    416443    String spec = 
    417444      "Sequence {" + 
     
    447474    UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    448475    { 
    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) 
    453478    }; 
    454479     
     
    456481      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));    
    457482 
     483    // ===== check ===== 
    458484    spec = 
    459485      "Sequence {" + 
     
    489515    expectedDefects = new UsabilityDefect[] 
    490516    { 
    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 ===== 
    500525    spec = 
    501526      "Sequence {" + 
     
    531556    expectedDefects = new UsabilityDefect[] 
    532557    { 
    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) 
    537560    }; 
    538561 
     
    540563      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    541564  
     565    // ===== check ===== 
    542566    spec = 
    543567      "Sequence {" + 
     
    573597    expectedDefects = new UsabilityDefect[] 
    574598    { 
    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) 
    579601    }; 
    580602 
     
    582604      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    583605    
     606    // ===== check ===== 
    584607    spec = 
    585608      "Sequence {" + 
     
    594617    expectedDefects = new UsabilityDefect[] 
    595618    { 
    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) 
    600621    }; 
    601622 
     
    603624      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    604625      
     626    // ===== check ===== 
    605627    spec = 
    606628      "Sequence {" + 
     
    615637    expectedDefects = new UsabilityDefect[] 
    616638    { 
    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) 
    621641    }; 
    622642 
     
    624644      (expectedDefects, manager.evaluateUsability(createTaskTree(spec))); 
    625645        
     646    // ===== check ===== 
    626647    spec = 
    627648      "Sequence {" + 
     
    636657    expectedDefects = new UsabilityDefect[] 
    637658    { 
    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) 
    642661    }; 
    643662 
     
    647666  } 
    648667 
     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  } 
    649741} 
  • trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java

    r475 r497  
    88package de.ugoe.cs.quest.usability; 
    99 
    10 import static org.junit.Assert.*; 
     10import static org.junit.Assert.assertNotNull; 
     11import static org.junit.Assert.assertNotSame; 
    1112 
    1213import java.util.HashMap; 
     
    1415 
    1516import org.junit.Test; 
    16  
    17 import de.ugoe.cs.quest.usability.UsabilityDefectDescription; 
    1817 
    1918//------------------------------------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.