Changeset 1918 for trunk


Ignore:
Timestamp:
03/12/15 15:50:28 (10 years ago)
Author:
pharms
Message:
  • extension with further smell detections
  • may not fully work. But Hudson is more happy because compile errors should be gone
Location:
trunk
Files:
10 added
15 edited
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/AbstractUsabilityEvaluationTC.java

    r1427 r1918  
    7373     * 
    7474     */ 
    75     protected void assertUsabilityEvaluationResult(UsabilityDefect[]         expectedDefects, 
     75    protected void assertUsabilityEvaluationResult(UsabilitySmell[]         expectedSmells, 
    7676                                                   UsabilityEvaluationResult evaluationResult) 
    7777    { 
    78         assertEquals(evaluationResult.getAllDefects().toString(), 
    79                      expectedDefects.length, evaluationResult.getAllDefects().size()); 
     78        assertEquals(evaluationResult.getAllSmells().toString(), 
     79                     expectedSmells.length, evaluationResult.getAllSmells().size()); 
    8080 
    8181        EXPECTED_DEFECT_ITERATION: 
    82         for (UsabilityDefect expectedDefect : expectedDefects) { 
    83             for (UsabilityDefect defect : evaluationResult.getAllDefects()) { 
    84                 if (expectedDefect.equals(defect)) { 
    85                     System.err.println(defect.getParameterizedDescription()); 
     82        for (UsabilitySmell expectedSmell : expectedSmells) { 
     83            for (UsabilitySmell smell : evaluationResult.getAllSmells()) { 
     84                if (expectedSmell.equals(smell)) { 
     85                    System.err.println(smell.getParameterizedDescription()); 
    8686                    continue EXPECTED_DEFECT_ITERATION; 
    8787                } 
    8888            } 
    8989 
    90             for (UsabilityDefect defect : evaluationResult.getAllDefects()) { 
    91                 System.err.println(defect); 
     90            for (UsabilitySmell smell : evaluationResult.getAllSmells()) { 
     91                System.err.println(smell); 
    9292            } 
    9393 
    94             fail("expected defect " + expectedDefect + " not found in evaluation result"); 
     94            fail("expected smell " + expectedSmell + " not found in evaluation result"); 
    9595        } 
    9696    } 
  • trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRuleTest.java

    r1493 r1918  
    1515package de.ugoe.cs.autoquest.usability; 
    1616 
    17 import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.INEFFICIENT_ACTIONS; 
    18 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.HIGH; 
    19 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.INFO; 
    20 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.LOW; 
    21 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.MEDIUM; 
     17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.INEFFICIENT_ACTIONS; 
    2218 
    2319import org.junit.Before; 
    2420import org.junit.Test; 
    2521 
    26 import de.ugoe.cs.autoquest.usability.UsabilityDefect; 
     22import de.ugoe.cs.autoquest.usability.UsabilitySmell; 
    2723 
    2824/** 
     
    3632    @Before 
    3733    public void setUp() { 
    38         UsabilityDefectSeverity.defaultCoverageQuantile = 0; 
     34        //UsabilitySmellIntensity.defaultCoverageQuantile = 0; 
    3935    } 
    4036     
     
    5349            "}"; 
    5450         
    55         // no defect expected, as interactions do not form tasks 
    56         UsabilityDefect[] expectedDefects = new UsabilityDefect[] {  }; 
    57  
    58         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     51        // no smell expected, as interactions do not form tasks 
     52        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  }; 
     53 
     54        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    5955 
    6056    } 
     
    7672            "}"; 
    7773         
    78         // no defect expected, as interactions do not form tasks 
    79         UsabilityDefect[] expectedDefects = new UsabilityDefect[] { }; 
    80  
    81         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     74        // no smell expected, as interactions do not form tasks 
     75        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { }; 
     76 
     77        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    8278 
    8379    } 
     
    9995            "}"; 
    10096         
    101         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    102             { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 
    103  
    104         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     97        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     98            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     99                                  INEFFICIENT_ACTIONS) }; 
     100 
     101        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    105102 
    106103    } 
     
    122119            "}"; 
    123120         
    124         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    125             { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 
    126  
    127         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     121        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     122            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     123                                  INEFFICIENT_ACTIONS) }; 
     124 
     125        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    128126 
    129127    } 
     
    149147            "}"; 
    150148         
    151         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    152             { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 
    153  
    154         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     149        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     150            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     151                                  INEFFICIENT_ACTIONS) }; 
     152 
     153        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    155154 
    156155    } 
     
    176175            "}"; 
    177176         
    178         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    179             { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 
    180  
    181         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     177        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     178            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     179                                  INEFFICIENT_ACTIONS) }; 
     180 
     181        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    182182 
    183183    } 
     
    202202            "}"; 
    203203         
    204         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    205             { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 
    206  
    207         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     204        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     205            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     206                                  INEFFICIENT_ACTIONS) }; 
     207 
     208        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    208209 
    209210    } 
     
    237238            "}"; 
    238239         
    239         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    240             { new UsabilityDefect(MEDIUM, INEFFICIENT_ACTIONS) }; 
    241  
    242         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     240        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     241            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     242                                  INEFFICIENT_ACTIONS) }; 
     243 
     244        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    243245 
    244246    } 
     
    272274            "}"; 
    273275         
    274         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    275             { new UsabilityDefect(MEDIUM, INEFFICIENT_ACTIONS) }; 
    276  
    277         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     276        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     277            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     278                                  INEFFICIENT_ACTIONS) }; 
     279 
     280        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    278281 
    279282    } 
     
    311314            "}"; 
    312315         
    313         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    314            { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 
    315  
    316         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     316        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     317           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     318                                  INEFFICIENT_ACTIONS) }; 
     319 
     320        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    317321 
    318322    } 
     
    350354            "}"; 
    351355         
    352         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    353            { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 
    354  
    355         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     356        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     357           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     358                                  INEFFICIENT_ACTIONS) }; 
     359 
     360        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    356361 
    357362    } 
     
    387392            "}"; 
    388393         
    389         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    390             { new UsabilityDefect(INFO, INEFFICIENT_ACTIONS) }; 
    391  
    392         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     394        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     395            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     396                                  INEFFICIENT_ACTIONS) }; 
     397 
     398        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    393399 
    394400    } 
     
    424430            "}"; 
    425431         
    426         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    427             { new UsabilityDefect(INFO, INEFFICIENT_ACTIONS) }; 
    428  
    429         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     432        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     433            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     434                                  INEFFICIENT_ACTIONS) }; 
     435 
     436        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    430437 
    431438    } 
     
    477484            "}"; 
    478485         
    479         UsabilityDefect[] expectedDefects = new UsabilityDefect[] { }; 
    480  
    481         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     486        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { }; 
     487 
     488        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    482489 
    483490    } 
     
    529536            "}"; 
    530537         
    531         UsabilityDefect[] expectedDefects = new UsabilityDefect[] { }; 
    532  
    533         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     538        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { }; 
     539 
     540        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    534541 
    535542    } 
  • trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/TaskCooccurrenceRuleTest.java

    r1493 r1918  
    1515package de.ugoe.cs.autoquest.usability; 
    1616 
    17 import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.COOCCURENCE_PRECED; 
    18 import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.COOCCURENCE_SUCCEED; 
    19 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.HIGH; 
    20 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.INFO; 
    21 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.LOW; 
    22 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.MEDIUM; 
     17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.COOCCURENCE_PRECED; 
     18import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.COOCCURENCE_SUCCEED; 
    2319 
    2420import org.junit.Before; 
    2521import org.junit.Test; 
    2622 
    27 import de.ugoe.cs.autoquest.usability.UsabilityDefect; 
     23import de.ugoe.cs.autoquest.usability.UsabilitySmell; 
    2824 
    2925/** 
     
    3733    @Before 
    3834    public void setUp() { 
    39         UsabilityDefectSeverity.defaultCoverageQuantile = 0; 
     35        //UsabilitySmellIntensity.defaultCoverageQuantile = 0; 
    4036    } 
    4137 
     
    5450            "}"; 
    5551         
    56         // no defect expected, as interactions do not form tasks 
    57         UsabilityDefect[] expectedDefects = new UsabilityDefect[] {  }; 
    58  
    59         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     52        // no smell expected, as interactions do not form tasks 
     53        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  }; 
     54 
     55        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    6056 
    6157    } 
     
    7773            "}"; 
    7874         
    79         // no defect expected, as interactions do not form tasks 
    80         UsabilityDefect[] expectedDefects = new UsabilityDefect[] { }; 
    81  
    82         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     75        // no smell expected, as interactions do not form tasks 
     76        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { }; 
     77 
     78        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    8379 
    8480    } 
     
    10096            "}"; 
    10197         
    102         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    103             { new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    104               new UsabilityDefect(HIGH, COOCCURENCE_PRECED) }; 
    105  
    106         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     98        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     99            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     100                                  COOCCURENCE_SUCCEED), 
     101              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     102                                  COOCCURENCE_PRECED) }; 
     103 
     104        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    107105 
    108106    } 
     
    128126            "}"; 
    129127         
    130         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    131             { new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    132               new UsabilityDefect(HIGH, COOCCURENCE_PRECED) }; 
    133  
    134         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     128        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     129            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     130                                  COOCCURENCE_SUCCEED), 
     131              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     132                                  COOCCURENCE_PRECED) }; 
     133 
     134        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    135135 
    136136    } 
     
    155155            "}"; 
    156156         
    157         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    158             { new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    159               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    160               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    161               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    162               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    163               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    164               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    165               new UsabilityDefect(HIGH, COOCCURENCE_PRECED) }; 
    166  
    167         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     157        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     158            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     159                                  COOCCURENCE_SUCCEED), 
     160              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     161                                  COOCCURENCE_SUCCEED), 
     162              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     163                                  COOCCURENCE_SUCCEED), 
     164              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     165                                  COOCCURENCE_SUCCEED), 
     166              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     167                                  COOCCURENCE_PRECED), 
     168              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     169                                  COOCCURENCE_PRECED), 
     170              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     171                                  COOCCURENCE_PRECED), 
     172              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     173                                  COOCCURENCE_PRECED) }; 
     174 
     175        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    168176 
    169177    } 
     
    193201            "}"; 
    194202         
    195         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    196             { new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    197               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    198               new UsabilityDefect(LOW, COOCCURENCE_PRECED), 
    199               new UsabilityDefect(INFO, COOCCURENCE_PRECED) }; 
    200  
    201         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     203        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     204            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     205                                  COOCCURENCE_SUCCEED), 
     206              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     207                                  COOCCURENCE_SUCCEED), 
     208              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     209                                  COOCCURENCE_PRECED), 
     210              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     211                                  COOCCURENCE_PRECED) }; 
     212 
     213        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    202214 
    203215    } 
     
    227239            "}"; 
    228240         
    229         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    230             { new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    231               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    232               new UsabilityDefect(LOW, COOCCURENCE_SUCCEED), 
    233               new UsabilityDefect(INFO, COOCCURENCE_SUCCEED) }; 
    234  
    235         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     241        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     242            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     243                                  COOCCURENCE_PRECED), 
     244              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     245                                  COOCCURENCE_PRECED), 
     246              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     247                                  COOCCURENCE_SUCCEED), 
     248              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     249                                  COOCCURENCE_SUCCEED) }; 
     250 
     251        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    236252 
    237253    } 
     
    265281            "}"; 
    266282         
    267         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    268            { new UsabilityDefect(LOW, COOCCURENCE_PRECED), 
    269              new UsabilityDefect(LOW, COOCCURENCE_PRECED), 
    270              new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    271              new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED) }; 
    272  
    273         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     283        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     284           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     285                                  COOCCURENCE_PRECED), 
     286             new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     287                                  COOCCURENCE_PRECED), 
     288             new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     289                                  COOCCURENCE_SUCCEED), 
     290             new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     291                                  COOCCURENCE_SUCCEED) }; 
     292 
     293        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    274294 
    275295    } 
     
    303323            "}"; 
    304324         
    305         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    306            { new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    307              new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    308              new UsabilityDefect(LOW, COOCCURENCE_SUCCEED), 
    309              new UsabilityDefect(LOW, COOCCURENCE_SUCCEED) }; 
    310  
    311         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     325        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     326           { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     327                                  COOCCURENCE_PRECED), 
     328             new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     329                                  COOCCURENCE_PRECED), 
     330             new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     331                                  COOCCURENCE_SUCCEED), 
     332             new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     333                                  COOCCURENCE_SUCCEED) }; 
     334 
     335        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    312336 
    313337    } 
     
    341365            "}"; 
    342366         
    343         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    344             { new UsabilityDefect(MEDIUM, COOCCURENCE_PRECED), 
    345               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    346               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED) }; 
    347  
    348         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     367        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     368            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     369                                  COOCCURENCE_PRECED), 
     370              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     371                                  COOCCURENCE_SUCCEED), 
     372              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     373                                  COOCCURENCE_SUCCEED) }; 
     374 
     375        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    349376 
    350377    } 
     
    378405            "}"; 
    379406         
    380         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    381             { new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    382               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    383               new UsabilityDefect(MEDIUM, COOCCURENCE_SUCCEED) }; 
    384  
    385         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     407        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     408            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     409                                  COOCCURENCE_PRECED), 
     410              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     411                                  COOCCURENCE_PRECED), 
     412              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     413                                  COOCCURENCE_SUCCEED) }; 
     414 
     415        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    386416 
    387417    } 
     
    431461            "}"; 
    432462         
    433         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    434             { new UsabilityDefect(MEDIUM, COOCCURENCE_PRECED), 
    435               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED), 
    436               new UsabilityDefect(HIGH, COOCCURENCE_SUCCEED) }; 
    437  
    438         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     463        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     464            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     465                                  COOCCURENCE_PRECED), 
     466              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     467                                  COOCCURENCE_SUCCEED), 
     468              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     469                                  COOCCURENCE_SUCCEED) }; 
     470 
     471        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    439472 
    440473    } 
     
    484517            "}"; 
    485518         
    486         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    487             { new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    488               new UsabilityDefect(HIGH, COOCCURENCE_PRECED), 
    489               new UsabilityDefect(MEDIUM, COOCCURENCE_SUCCEED) }; 
    490  
    491         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     519        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     520            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     521                                  COOCCURENCE_PRECED), 
     522              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     523                                  COOCCURENCE_PRECED), 
     524              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     525                                  COOCCURENCE_SUCCEED) }; 
     526 
     527        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    492528 
    493529    } 
  • trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/TextInputStatisticsRuleTest.java

    r1335 r1918  
    1515package de.ugoe.cs.autoquest.usability; 
    1616 
    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; 
     17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_INPUT_RATIO; 
     18import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_INPUT_REPETITIONS; 
     19import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; 
    2420 
    2521import org.junit.Test; 
    2622 
    27 import de.ugoe.cs.autoquest.usability.UsabilityDefect; 
     23import de.ugoe.cs.autoquest.usability.UsabilitySmell; 
    2824 
    2925/** 
     
    4541            "}"; 
    4642         
    47         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    48             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    49  
    50         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     43        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     44            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     45                                  TEXT_FIELD_INPUT_RATIO) }; 
     46 
     47        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    5148 
    5249    } 
     
    6865            "}"; 
    6966 
    70         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    71             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    72  
    73         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     67        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     68            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     69                                  TEXT_FIELD_INPUT_RATIO) }; 
     70 
     71        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    7472 
    7573    } 
     
    9290            "}"; 
    9391 
    94         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    95             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    96  
    97         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     92        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     93            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     94                                  TEXT_FIELD_INPUT_RATIO) }; 
     95 
     96        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    9897 
    9998    } 
     
    115114            "}"; 
    116115 
    117         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    118             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    119  
    120         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     116        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     117            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     118                                  TEXT_FIELD_INPUT_RATIO) }; 
     119 
     120        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    121121 
    122122    } 
     
    177177            "}"; 
    178178 
    179         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    180             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    181  
    182         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     179        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     180            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     181                                  TEXT_FIELD_INPUT_RATIO) }; 
     182 
     183        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    183184    } 
    184185 
     
    202203            "}"; 
    203204 
    204         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    205             { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) }; 
    206  
    207         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     205        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     206            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     207                                  TEXT_FIELD_INPUT_RATIO) }; 
     208 
     209        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    208210    } 
    209211 
     
    227229            "}"; 
    228230 
    229         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    230             { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) }; 
    231  
    232         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     231        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     232            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     233                                  TEXT_FIELD_INPUT_RATIO) }; 
     234 
     235        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    233236 
    234237    } 
     
    254257            "}"; 
    255258 
    256         UsabilityDefect[] expectedDefects = new UsabilityDefect[0]; 
    257  
    258         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     259        UsabilitySmell[] expectedSmells = new UsabilitySmell[0]; 
     260 
     261        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    259262 
    260263    } 
     
    276279            "}"; 
    277280 
    278         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    279             { new UsabilityDefect(HIGH, TEXT_FIELD_INPUT_RATIO) }; 
    280  
    281         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     281        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     282            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     283                                  TEXT_FIELD_INPUT_RATIO) }; 
     284 
     285        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    282286 
    283287    } 
     
    342346            "}"; 
    343347 
    344         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    345             { new UsabilityDefect(LOW, TEXT_FIELD_INPUT_RATIO) }; 
    346  
    347         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     348        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     349            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     350                                  TEXT_FIELD_INPUT_RATIO) }; 
     351 
     352        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    348353 
    349354    } 
     
    408413            "}"; 
    409414 
    410         UsabilityDefect[] expectedDefects = new UsabilityDefect[] 
    411             { new UsabilityDefect(INFO, TEXT_FIELD_INPUT_RATIO) }; 
    412  
    413         assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 
     415        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     416            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     417                                  TEXT_FIELD_INPUT_RATIO) }; 
     418 
     419        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    414420    } 
    415421 
     
    430436            "}"; 
    431437 
    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        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     439            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     440                                  TEXT_FIELD_INPUT_RATIO), 
     441              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     442                                  TEXT_FIELD_INPUT_REPETITIONS), 
     443              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     444                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     445 
     446        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    438447    } 
    439448 
     
    462471            "}"; 
    463472 
    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))); 
     473        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     474            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     475                                  TEXT_FIELD_INPUT_RATIO), 
     476              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     477                                  TEXT_FIELD_INPUT_REPETITIONS), 
     478              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     479                                  TEXT_FIELD_INPUT_REPETITIONS), 
     480              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     481                                  TEXT_FIELD_INPUT_REPETITIONS), 
     482              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     483                                  TEXT_FIELD_INPUT_REPETITIONS), 
     484              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     485                                  TEXT_FIELD_INPUT_REPETITIONS), 
     486              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     487                                  TEXT_FIELD_INPUT_REPETITIONS), 
     488              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     489                                  TEXT_FIELD_INPUT_REPETITIONS), 
     490              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     491                                  TEXT_FIELD_INPUT_REPETITIONS), 
     492              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     493                                  TEXT_FIELD_INPUT_REPETITIONS), 
     494              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     495                                  TEXT_FIELD_INPUT_REPETITIONS), 
     496              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     497                                  TEXT_FIELD_INPUT_REPETITIONS), 
     498              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     499                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     500 
     501        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    480502 
    481503    } 
     
    501523            "}"; 
    502524 
    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))); 
     525        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     526            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     527                                  TEXT_FIELD_INPUT_RATIO), 
     528              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     529                                  TEXT_FIELD_INPUT_REPETITIONS), 
     530              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     531                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     532 
     533        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    509534 
    510535    } 
     
    530555            "}"; 
    531556 
    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))); 
     557        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     558            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     559                                  TEXT_FIELD_INPUT_RATIO), 
     560              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     561                                  TEXT_FIELD_INPUT_REPETITIONS), 
     562              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     563                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     564 
     565        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    538566 
    539567    } 
     
    565593            "}"; 
    566594 
    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))); 
     595        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     596            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     597                                  TEXT_FIELD_INPUT_RATIO), 
     598              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     599                                  TEXT_FIELD_INPUT_REPETITIONS), 
     600              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     601                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     602 
     603        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    573604 
    574605    } 
     
    595626            "}"; 
    596627 
    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))); 
     628        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     629            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     630                                  TEXT_FIELD_INPUT_RATIO), 
     631              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     632                                  TEXT_FIELD_INPUT_REPETITIONS), 
     633              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     634                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     635 
     636        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    603637    } 
    604638 
     
    623657            "}"; 
    624658 
    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))); 
     659        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     660            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     661                                  TEXT_FIELD_INPUT_RATIO), 
     662              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     663                                  TEXT_FIELD_INPUT_REPETITIONS), 
     664              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     665                                  TEXT_FIELD_INPUT_REPETITIONS) }; 
     666 
     667        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    631668    } 
    632669 
     
    646683            "}"; 
    647684 
    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))); 
     685        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     686            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     687                                  TEXT_FIELD_INPUT_RATIO), 
     688              new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     689                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; 
     690 
     691        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    653692 
    654693    } 
     
    669708            "}"; 
    670709 
    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))); 
     710        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     711            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     712                                  TEXT_FIELD_INPUT_RATIO), 
     713              new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0), 
     714                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; 
     715 
     716        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    676717 
    677718    } 
     
    692733            "}"; 
    693734 
    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))); 
     735        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     736            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     737                                  TEXT_FIELD_INPUT_RATIO), 
     738              new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0), 
     739                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; 
     740 
     741        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    699742 
    700743    } 
     
    716759            "}"; 
    717760 
    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))); 
     761        UsabilitySmell[] expectedSmells = new UsabilitySmell[] 
     762            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0), 
     763                                  TEXT_FIELD_INPUT_RATIO), 
     764              new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0), 
     765                                  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO) }; 
     766 
     767        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec))); 
    723768 
    724769    } 
  • trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/UsabilitySmellDescriptionTest.java

    r1493 r1918  
    2525import org.junit.Test; 
    2626 
    27 import de.ugoe.cs.autoquest.usability.UsabilityDefectDescription; 
     27import de.ugoe.cs.autoquest.usability.UsabilitySmellDescription; 
    2828 
    2929/** 
    3030 * @author Patrick Harms 
    3131 */ 
    32 public class UsabilityDefectDescriptionTest { 
     32public class UsabilitySmellDescriptionTest { 
    3333 
    3434    /** 
     
    3737    @Test 
    3838    public void testInitialization() { 
    39         for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) { 
     39        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { 
    4040            assertNotNull(description.toString()); 
    4141            assertNotSame("", description.toString()); 
     
    4949    @Test 
    5050    public void testParameterization_01() { 
    51         for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) { 
     51        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { 
    5252            Map<String, Object> parameters = new HashMap<String, Object>(); 
    5353 
     
    6868    @Test 
    6969    public void testParameterization_02() { 
    70         for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) { 
     70        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { 
    7171            Map<String, Object> parameters = new HashMap<String, Object>(); 
    7272 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/EventCoverageQuantileRule.java

    r1493 r1918  
    5757 
    5858                //TODO document magic numbers 
    59                 UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    60                     (ratio, 990, 975, 950, 900, sequence, taskModel); 
     59                UsabilitySmellIntensity severity = 
     60                    UsabilitySmellIntensity.getIntensity(ratio, sequence, taskModel); 
    6161 
    6262                if (severity != null) { 
     
    8181                    parameters.put("ratio", effRatio); 
    8282 
    83                     results.addDefect(severity, UsabilityDefectDescription.HIGH_EVENT_COVERAGE, 
    84                                       parameters); 
     83                    results.addSmell(sequence, severity, 
     84                                     UsabilitySmellDescription.HIGH_EVENT_COVERAGE, parameters); 
    8585                } 
    8686            } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/EventCoverageRatioRule.java

    r1493 r1918  
    5656                    (TaskMetric.EVENT_COVERAGE_RATIO); 
    5757 
    58                 //TODO document magic numbers 
    59                 UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    60                     (ratio, 300, 150, 50, 10, sequence, taskModel); 
     58                UsabilitySmellIntensity severity = 
     59                    UsabilitySmellIntensity.getIntensity(ratio, sequence, taskModel); 
    6160 
    6261                if (severity != null) { 
     
    6564                    parameters.put("ratio", (ratio / 10)); 
    6665 
    67                     results.addDefect(severity, UsabilityDefectDescription.HIGH_EVENT_COVERAGE, 
    68                                       parameters); 
     66                    results.addSmell(sequence, severity, 
     67                                     UsabilitySmellDescription.HIGH_EVENT_COVERAGE, parameters); 
    6968                } 
    7069            } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/MissingFeedbackRule.java

    r1493 r1918  
    7878            // be considered as usability smell. 
    7979             
    80             UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    81                 (entry.getValue(), 2000, 1000, 500, 50, entry.getKey(), taskModel); 
    82  
    83             if (severity != null) { 
     80            UsabilitySmellIntensity intensity = 
     81                UsabilitySmellIntensity.getIntensity(entry.getValue(), entry.getKey(), taskModel); 
     82 
     83            if (intensity != null) { 
    8484                Map<String, Object> parameters = new HashMap<String, Object>(); 
    8585 
     
    8888                long cummulatedWaitingTime = 0; 
    8989                int numberOfAdditionalClicks = 0; 
    90                  
    91                 System.out.println("\n\n#################################"); 
    9290                 
    9391                Event exampleEvent = null; 
     
    10199                        for (List<Event> subsequence : clicksOnIdenticalButton) { 
    102100                            exampleEvent = subsequence.get(0); 
    103                             System.out.println(exampleEvent.getTimestamp()); 
    104101                             
    105102                            Event endEvent = subsequence.get(subsequence.size() - 1); 
     
    123120                parameters.put("task", entry.getKey()); 
    124121                 
    125                 results.addDefect 
    126                     (severity, UsabilityDefectDescription.MISSING_FEEDBACK, parameters); 
     122                results.addSmell(entry.getKey(), intensity, 
     123                                 UsabilitySmellDescription.MISSING_FEEDBACK, parameters); 
    127124            } 
    128125        } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRule.java

    r1493 r1918  
    6767            int ratio = (int) (1000 * stats.getMean()); 
    6868 
    69             UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    70                 (ratio, 500, 300, 200, 100, entry.getKey(), taskModel); 
     69            UsabilitySmellIntensity severity = 
     70                UsabilitySmellIntensity.getIntensity(ratio, entry.getKey(), taskModel); 
    7171 
    7272            if (severity != null) { 
     
    7575                parameters.put("ratio", (ratio / 10)); 
    7676 
    77                 results.addDefect 
    78                     (severity, UsabilityDefectDescription.INEFFICIENT_ACTIONS, parameters); 
     77                results.addSmell(entry.getKey(), severity, 
     78                                 UsabilitySmellDescription.INEFFICIENT_ACTIONS, parameters); 
    7979            } 
    8080        } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/TargetDistanceRule.java

    r1493 r1918  
    136136            // for HTML: 600 means not on the same page 
    137137            // for HTML: 501 means in average not on the same page 
    138             UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    139                 (ratio, 800, 600, 501, 501, task, taskModel); 
     138            UsabilitySmellIntensity severity = 
     139                UsabilitySmellIntensity.getIntensity(ratio, task, taskModel); 
    140140 
    141141            if (severity != null) { 
     
    148148                parameters.put("distance", ((double) ratio / 1000)); 
    149149 
    150                 results.addDefect 
    151                     (severity, UsabilityDefectDescription.HIGH_TARGET_DISTANCE, parameters); 
     150                results.addSmell 
     151                    (task, severity, UsabilitySmellDescription.HIGH_TARGET_DISTANCE, parameters); 
    152152            } 
    153153        } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/TaskCooccurrenceRule.java

    r1493 r1918  
    6262                int index2 = 1; 
    6363                List<ITask> children = sequence.getChildren(); 
     64                ITaskInfo infoSequence = taskModel.getTaskInfo(sequence); 
     65                int countSequence = infoSequence.getMeasureValue(TaskMetric.COUNT); 
    6466                 
    6567                while (index2 < children.size()) { 
     
    6971                    ITaskInfo info2 = taskModel.getTaskInfo(task2); 
    7072                     
    71                     int ratioTask1 = 1000 * info1.getMeasureValue(TaskMetric.COUNT, sequence) / 
    72                         info1.getMeasureValue(TaskMetric.COUNT); 
    73                     int ratioTask2 = 1000 * info2.getMeasureValue(TaskMetric.COUNT, sequence) / 
    74                             info2.getMeasureValue(TaskMetric.COUNT); 
     73                    int ratioTask1 = 1000 * countSequence / info1.getMeasureValue(TaskMetric.COUNT); 
     74                    int ratioTask2 = 1000 * countSequence / info2.getMeasureValue(TaskMetric.COUNT); 
    7575                     
    76                     createSucceededDefectIfRequired(ratioTask1, task1, task2, results, taskModel); 
    77                     createPrecededDefectIfRequired(ratioTask2, task1, task2, results, taskModel); 
     76                    createSucceededSmellIfRequired(ratioTask1, task1, task2, results, taskModel); 
     77                    createPrecededSmellIfRequired(ratioTask2, task1, task2, results, taskModel); 
    7878                     
    7979                    index1 = index2; 
     
    8787     * 
    8888     */ 
    89     private void createSucceededDefectIfRequired(int                       ratio, 
    90                                                  ITask                     task1, 
    91                                                  ITask                     task2, 
    92                                                  UsabilityEvaluationResult results, 
    93                                                  ITaskModel                taskModel) 
     89    private void createSucceededSmellIfRequired(int                       ratio, 
     90                                                ITask                     task1, 
     91                                                ITask                     task2, 
     92                                                UsabilityEvaluationResult results, 
     93                                                ITaskModel                taskModel) 
    9494    { 
    9595        //TODO document magic numbers 
    96         UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    97             (ratio, 900, 700, 500, 300, task1, taskModel); 
     96        UsabilitySmellIntensity severity = 
     97            UsabilitySmellIntensity.getIntensity(ratio, task1, taskModel); 
    9898 
    9999        if (!isScroll(task1) && !isScroll(task2) && (severity != null)) { 
     
    103103            parameters.put("ratio", (ratio / 10)); 
    104104 
    105             results.addDefect(severity, UsabilityDefectDescription.COOCCURENCE_SUCCEED, parameters); 
     105            results.addSmell 
     106                (task1, severity, UsabilitySmellDescription.COOCCURENCE_SUCCEED, parameters); 
    106107        } 
    107108    } 
     
    110111     * 
    111112     */ 
    112     private void createPrecededDefectIfRequired(int                       ratio, 
    113                                                 ITask                     task1, 
    114                                                 ITask                     task2, 
    115                                                 UsabilityEvaluationResult results, 
    116                                                 ITaskModel                taskModel) 
     113    private void createPrecededSmellIfRequired(int                       ratio, 
     114                                               ITask                     task1, 
     115                                               ITask                     task2, 
     116                                               UsabilityEvaluationResult results, 
     117                                               ITaskModel                taskModel) 
    117118    { 
    118119        //TODO document magic numbers 
    119         UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    120             (ratio, 900, 700, 500, 300, task2, taskModel); 
     120        UsabilitySmellIntensity severity = 
     121            UsabilitySmellIntensity.getIntensity(ratio, task2, taskModel); 
    121122 
    122123        if (!isScroll(task1) && !isScroll(task2) && (severity != null)) { 
     
    126127            parameters.put("ratio", (ratio / 10)); 
    127128 
    128             results.addDefect(severity, UsabilityDefectDescription.COOCCURENCE_PRECED, parameters); 
     129            results.addSmell 
     130                (task1, severity, UsabilitySmellDescription.COOCCURENCE_PRECED, parameters); 
    129131        } 
    130132    } 
     
    140142    private boolean isScroll(ITask task) { 
    141143        if (task instanceof IEventTask) { 
    142             return ((IEventTaskInstance) ((IEventTask) task).getInstances().iterator().next()).getEvent().getType() instanceof Scroll; 
     144            return ((IEventTaskInstance) ((IEventTask) task).getInstances().iterator().next()) 
     145                .getEvent().getType() instanceof Scroll; 
    143146        } 
    144147        else if (task instanceof IIteration) { 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/TaskTreeTestRule.java

    r1493 r1918  
    1515package de.ugoe.cs.autoquest.usability; 
    1616 
     17import java.util.ArrayList; 
     18import java.util.HashSet; 
     19import java.util.List; 
     20import java.util.Set; 
     21 
    1722import de.ugoe.cs.autoquest.eventcore.Event; 
    1823import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskInstanceTraversingVisitor; 
     24import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskTraversingVisitor; 
     25import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
    1926import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 
     27import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
     28import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
     29import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 
     30import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     31import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInfo; 
    2032import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
    2133import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceVisitor; 
     
    4153 
    4254        checkTimestamps(taskModel); 
     55        checkTaskInfos(taskModel); 
     56        checkEventTaskInstances(taskModel); 
     57        checkTraversal(taskModel); 
    4358 
    4459        return results; 
     60    } 
     61 
     62    /** 
     63     * <p> 
     64     * TODO: comment 
     65     * </p> 
     66     * 
     67     * @param taskModel 
     68     */ 
     69    private void checkEventTaskInstances(ITaskModel taskModel) { 
     70        Set<IEventTaskInstance> instancesInModel = new HashSet<>(); 
     71         
     72        for (ITask task : taskModel.getTasks()) { 
     73            if (task instanceof IEventTask) { 
     74                for (ITaskInstance instance : task.getInstances()) { 
     75                    instancesInModel.add((IEventTaskInstance) instance); 
     76                } 
     77            } 
     78        } 
     79         
     80        final Set<IEventTaskInstance> instancesInSessions = new HashSet<>(); 
     81         
     82        for (IUserSession session : taskModel.getUserSessions()) { 
     83            for (ITaskInstance rootInstance : session) { 
     84                rootInstance.accept(new DefaultTaskInstanceTraversingVisitor() { 
     85                    @Override 
     86                    public void visit(IEventTaskInstance eventTaskInstance) { 
     87                        instancesInSessions.add(eventTaskInstance); 
     88                    } 
     89                }); 
     90            } 
     91        } 
     92         
     93        if (instancesInModel.size() != instancesInSessions.size()) { 
     94            throw new RuntimeException("instances not equal"); 
     95        } 
     96        else { 
     97            for (IEventTaskInstance instance : instancesInModel) { 
     98                if (!instancesInSessions.contains(instance)) { 
     99                    throw new RuntimeException("instance of model not contained in sessions"); 
     100                } 
     101            } 
     102             
     103            for (IEventTaskInstance instance : instancesInSessions) { 
     104                if (!instancesInModel.contains(instance)) { 
     105                    throw new RuntimeException("instance of sessions not contained in model"); 
     106                } 
     107            } 
     108        } 
     109    } 
     110 
     111    /** 
     112     * <p> 
     113     * TODO: comment 
     114     * </p> 
     115     * 
     116     * @param taskModel 
     117     */ 
     118    private void checkTraversal(ITaskModel taskModel) { 
     119        for (ITask task : taskModel.getTasks()) { 
     120            final List<ITask> traversal1 = new ArrayList<>(); 
     121             
     122            task.accept(new DefaultTaskTraversingVisitor() { 
     123                @Override 
     124                public void visit(IEventTask eventTask) { 
     125                    traversal1.add(eventTask); 
     126                    super.visit(eventTask); 
     127                } 
     128 
     129                @Override 
     130                public void visit(IStructuringTemporalRelationship relationship) { 
     131                    traversal1.add(relationship); 
     132                    super.visit(relationship); 
     133                } 
     134                 
     135            }); 
     136             
     137            final List<ITask> traversal2 = new ArrayList<>(); 
     138             
     139            task.accept(new DefaultTaskTraversingVisitor() { 
     140                @Override 
     141                public void visit(IEventTask eventTask) { 
     142                    traversal2.add(eventTask); 
     143                    super.visit(eventTask); 
     144                } 
     145 
     146                @Override 
     147                public void visit(ISelection selection) { 
     148                    traversal2.add(selection); 
     149                    super.visit(selection); 
     150                } 
     151 
     152                @Override 
     153                public void visit(ISequence sequence) { 
     154                    traversal2.add(sequence); 
     155                    super.visit(sequence); 
     156                } 
     157            }); 
     158             
     159            if (traversal1.size() != traversal2.size()) { 
     160                throw new RuntimeException("traversals not equal"); 
     161            } 
     162            else { 
     163                for (int i = 0; i < traversal1.size(); i++) { 
     164                    if (!traversal1.get(i).equals(traversal2.get(i))) { 
     165                        throw new RuntimeException("traversals not equal at position " + i); 
     166                    } 
     167                } 
     168            } 
     169        } 
    45170    } 
    46171 
     
    78203         
    79204    } 
     205 
     206    /** 
     207     * <p> 
     208     * TODO: comment 
     209     * </p> 
     210     * 
     211     * @param taskModel 
     212     */ 
     213    private void checkTaskInfos(ITaskModel taskModel) { 
     214        for (ITask task : taskModel.getTasks()) { 
     215            ITaskInfo taskInfo = taskModel.getTaskInfo(task); 
     216            if (taskInfo == null) { 
     217                System.out.println("task " + task + " has no associated task infos"); 
     218            } 
     219        } 
     220    } 
    80221} 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/TextInputStatisticsRule.java

    r1493 r1918  
    8484        int ratio = 1000 * allTextFieldInputs / statistics.getNoOfAllEvents(); 
    8585 
    86         // TODO comment magic numbers 
    87         UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    88             (ratio, 900, 700, 500, 300); 
     86        UsabilitySmellIntensity severity = UsabilitySmellIntensity.getIntensity(ratio); 
    8987         
    9088        if (severity != null) { 
     
    9290            parameters.put("textInputRatio", (ratio / 10)); 
    9391 
    94             results.addDefect 
    95                 (severity, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO, parameters); 
     92            results.addSmell 
     93                (severity, UsabilitySmellDescription.TEXT_FIELD_INPUT_RATIO, parameters); 
    9694        } 
    9795    } 
     
    117115                1000 * noOfUsagesOfTextField1WithSameTextInTextField2 / noOfUsagesOfTextField2; 
    118116 
    119             createTextFieldEntryRepetitionDefect(ratioTextField1, entry.textField1, 
     117            createTextFieldEntryRepetitionSmell(ratioTextField1, entry.textField1, 
    120118                                                 entry.textField2, results); 
    121119             
    122             createTextFieldEntryRepetitionDefect(ratioTextField2, entry.textField2, 
     120            createTextFieldEntryRepetitionSmell(ratioTextField2, entry.textField2, 
    123121                                                 entry.textField1, results); 
    124122             
     
    129127     * 
    130128     */ 
    131     private void createTextFieldEntryRepetitionDefect(int                       ratioOfEqualEntries, 
     129    private void createTextFieldEntryRepetitionSmell(int                       ratioOfEqualEntries, 
    132130                                                      ITextField                textField1, 
    133131                                                      ITextField                textField2, 
    134132                                                      UsabilityEvaluationResult results) 
    135133    { 
    136         // TODO comment magic numbers 
    137         UsabilityDefectSeverity severity = UsabilityDefectSeverity.getSeverity 
    138             (ratioOfEqualEntries, 900, 500, 200, 100); 
     134        UsabilitySmellIntensity severity = 
     135            UsabilitySmellIntensity.getIntensity(ratioOfEqualEntries); 
    139136         
    140137        if (severity != null) { 
     
    144141            parameters.put("textField2", textField2); 
    145142 
    146             results.addDefect 
    147                 (severity, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS, parameters); 
     143            results.addSmell 
     144                (severity, UsabilitySmellDescription.TEXT_FIELD_INPUT_REPETITIONS, parameters); 
    148145        } 
    149146    } 
     
    172169            int ratio = 1000 * noLetterOrDigitCount / allCharactersCount; 
    173170 
    174             UsabilityDefectSeverity severity = 
    175                 UsabilityDefectSeverity.getSeverity(ratio, 
    176                                                     100, // every 10th sign 
    177                                                     50, // every 20th sign 
    178                                                     20, // every 50th sign 
    179                                                     10 // every 100th sign 
    180                                                     ); 
     171            UsabilitySmellIntensity severity = UsabilitySmellIntensity.getIntensity(ratio); 
    181172 
    182173            if (severity != null) { 
     
    185176                parameters.put("noLetterOrDigitRatio", (ratio / 10)); 
    186177 
    187                 results.addDefect 
    188                     (severity, UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO, 
     178                results.addSmell 
     179                    (severity, UsabilitySmellDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO, 
    189180                     parameters); 
    190181            } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UnusedGUIElementsRule.java

    r1493 r1918  
    7878        int ratio = 1000 * unusedGUIElements.size() / allGUIElements.size(); 
    7979         
    80         UsabilityDefectSeverity severity = 
    81             UsabilityDefectSeverity.getSeverity(ratio, 200, 100, 50, 25); 
     80        UsabilitySmellIntensity severity = UsabilitySmellIntensity.getIntensity(ratio); 
    8281 
    8382        if (severity != null) { 
     
    8988            parameters.put("unusedGuiElements", unusedGUIElements); 
    9089             
    91             results.addDefect 
    92                 (severity, UsabilityDefectDescription.UNUSED_GUI_ELEMENTS, parameters); 
     90            results.addSmell 
     91                (severity, UsabilitySmellDescription.UNUSED_GUI_ELEMENTS, parameters); 
    9392        } 
    9493     } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationManager.java

    r1493 r1918  
    4848     */ 
    4949    private void init() { 
    50         //rules.add(new TextInputStatisticsRule()); 
    51         rules.add(new MissingFeedbackRule()); 
    52         rules.add(new EventCoverageRatioRule()); 
    53         rules.add(new RequiredInefficientActionsRule()); 
    54         //rules.add(new TaskCooccurrenceRule()); 
    55         rules.add(new TargetDistanceRule()); 
    56         //rules.add(new UnusedGUIElementsRule()); 
    57         //rules.add(new TaskTreeTestRule()); 
     50        rules.add(new TaskTreeTestRule()); 
     51//        rules.add(new TextInputStatisticsRule()); 
     52//        rules.add(new MissingFeedbackRule()); 
     53//        rules.add(new EventCoverageRatioRule()); 
     54//        rules.add(new TargetDistanceRule()); 
     55//        rules.add(new RequiredInefficientActionsRule()); 
     56//        rules.add(new DataEntryMethodChangeRule()); 
     57        rules.add(new DefaultValueRule()); 
     58//        rules.add(new CheckBoxMultipleSelectionRule()); 
     59//        rules.add(new CommonTaskRateRule()); 
     60//        rules.add(new MisleadingClickCueRule()); 
     61//        rules.add(new DefaultCursorPositioningRule()); 
     62//        rules.add(new UnusedGUIElementsRule()); 
     63//        rules.add(new TaskCooccurrenceRule()); 
    5864    } 
    5965 
     
    7076            UsabilityEvaluationResult result = rule.evaluate(taskModel); 
    7177            interimResults.add(result); 
    72             Console.traceln(Level.INFO, "the rule found " + result.getAllDefects().size() + 
    73                             " usability defects, of which " + result.getSevereDefects().size() + 
    74                             " are severe."); 
     78            Console.traceln(Level.INFO, "the rule found " + result.getAllSmells().size() + 
     79                            " usability smells."); 
    7580             
    76             if ((rule instanceof EventCoverageRatioRule) || 
    77                 (rule instanceof RequiredInefficientActionsRule) || 
    78                 (rule instanceof TargetDistanceRule)) 
    79             { 
    80                 ITask[] referredTasks = new ITask[result.getAllDefects().size()]; 
     81            List<ITask> referredTasks = new ArrayList<ITask>(); 
    8182 
    82                 for (int i = 0; i < result.getAllDefects().size(); i++) { 
    83                     referredTasks[i] = 
    84                         (ITask) result.getAllDefects().get(i).getDescriptionFragments().get(1); 
     83            for (UsabilitySmell smell : result.getAllSmells()) { 
     84                if (smell.getSmellingTask() != null) { 
     85                    referredTasks.add(smell.getSmellingTask()); 
    8586                } 
     87            } 
    8688                 
    87                 int counter = 0; 
    88                 for (int i = 0; i < referredTasks.length; i++) { 
    89                     for (int j = 0; j < referredTasks.length; j++) { 
    90                         if (isChildOf(referredTasks[i], referredTasks[j])) { 
    91                             counter++; 
    92                             break; 
    93                         } 
     89            int counter = 0; 
     90            for (int i = 0; i < referredTasks.size(); i++) { 
     91                for (int j = 0; j < referredTasks.size(); j++) { 
     92                    if (isChildOf(referredTasks.get(i), referredTasks.get(j))) { 
     93                        counter++; 
     94                        break; 
    9495                    } 
    9596                } 
     97            } 
    9698                 
    97                 if (counter > 0) { 
    98                     Console.traceln(Level.INFO, counter + " of the findings are duplicates in " + 
    99                                     "that they refer to tasks whose parent tasks are also " + 
    100                                     "referred by the findings"); 
    101                 } 
     99            if (counter > 0) { 
     100                Console.traceln(Level.INFO, counter + " of the findings are duplicates in " + 
     101                                "that they refer to tasks whose parent tasks are also " + 
     102                                "referred by the findings"); 
    102103            } 
    103104        } 
    104105 
    105106        UsabilityEvaluationResult result = new UsabilityEvaluationResult(taskModel, interimResults); 
    106         Console.println("the evaluation result contains " + result.getAllDefects().size() + 
    107                         " defects, of which " + result.getSevereDefects().size() + " are severe."); 
     107        Console.println("the evaluation result contains " + result.getAllSmells().size() + 
     108                        " smells."); 
    108109 
    109110        return result; 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationResult.java

    r1493 r1918  
    1919import java.util.Map; 
    2020 
     21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    2122import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2223 
     
    3334     
    3435    /** */ 
    35     private List<UsabilityDefect> defects = new ArrayList<UsabilityDefect>(); 
     36    private List<UsabilitySmell> smells = new ArrayList<UsabilitySmell>(); 
    3637 
    3738    /** 
     
    5051        this.taskModel = taskModel; 
    5152        for (UsabilityEvaluationResult result : results) { 
    52             for (UsabilityDefect defect : result.getAllDefects()) { 
    53                 defects.add(defect); 
     53            for (UsabilitySmell smell : result.getAllSmells()) { 
     54                smells.add(smell); 
    5455            } 
    5556        } 
     
    5960     * 
    6061     */ 
    61     public void addDefect(UsabilityDefectSeverity    severity, 
    62                           UsabilityDefectDescription description, 
    63                           Map<String, Object>        parameters) 
     62    public void addSmell(UsabilitySmellIntensity   intensity, 
     63                         UsabilitySmellDescription description, 
     64                         Map<String, Object>       parameters) 
    6465    { 
    65         defects.add(new UsabilityDefect(severity, description, parameters)); 
     66        addSmell(null, intensity, description, parameters); 
    6667    } 
    6768 
     
    6970     * 
    7071     */ 
    71     public List<UsabilityDefect> getAllDefects() { 
    72         return defects; 
     72    public void addSmell(ITask                     smellingTask, 
     73                         UsabilitySmellIntensity   intensity, 
     74                         UsabilitySmellDescription description, 
     75                         Map<String, Object>       parameters) 
     76    { 
     77        smells.add(new UsabilitySmell(smellingTask, intensity, description, parameters)); 
    7378    } 
    7479 
     
    7681     * 
    7782     */ 
    78     public List<UsabilityDefect> getSevereDefects() { 
    79         List<UsabilityDefect> severeDefects = new ArrayList<UsabilityDefect>(); 
    80  
    81         for (UsabilityDefect defect : defects) { 
    82             if (defect.getSeverity() == UsabilityDefectSeverity.HIGH) { 
    83                 severeDefects.add(defect); 
    84             } 
    85         } 
    86  
    87         return severeDefects; 
     83    public List<UsabilitySmell> getAllSmells() { 
     84        return smells; 
    8885    } 
    8986 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilitySmell.java

    r1493 r1918  
    1818import java.util.Map; 
    1919 
     20import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     21 
    2022/** 
    2123 * TODO comment 
     
    2426 * @author 2012, last modified by $Author: pharms$ 
    2527 */ 
    26 public class UsabilityDefect { 
     28public class UsabilitySmell { 
    2729 
    2830    /** */ 
    29     private UsabilityDefectSeverity severity; 
     31    private ITask smellingTask; 
     32     
     33    /** */ 
     34    private UsabilitySmellIntensity intensity; 
    3035 
    3136    /** */ 
    32     private UsabilityDefectDescription description; 
     37    private UsabilitySmellDescription description; 
    3338 
    3439    /** */ 
     
    3843     * 
    3944     */ 
    40     UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) { 
    41         this(severity, description, null); 
     45    UsabilitySmell(UsabilitySmellIntensity intensity, UsabilitySmellDescription description) { 
     46        this(intensity, description, null); 
     47    } 
     48     
     49    /** 
     50     * 
     51     */ 
     52    UsabilitySmell(ITask                     smellingTask, 
     53                   UsabilitySmellIntensity   intensity, 
     54                   UsabilitySmellDescription description) 
     55    { 
     56        this(intensity, description, null); 
    4257    } 
    4358 
     
    4560     * 
    4661     */ 
    47     UsabilityDefect(UsabilityDefectSeverity    severity, 
    48                     UsabilityDefectDescription description, 
    49                     Map<String, Object>        parameters) 
     62    UsabilitySmell(UsabilitySmellIntensity   intensity, 
     63                   UsabilitySmellDescription description, 
     64                   Map<String, Object>       parameters) 
    5065    { 
    51         this.severity = severity; 
     66        this(null, intensity, description, parameters); 
     67    } 
     68 
     69    /** 
     70     * 
     71     */ 
     72    UsabilitySmell(ITask                     smellingTask, 
     73                   UsabilitySmellIntensity   intensity, 
     74                   UsabilitySmellDescription description, 
     75                   Map<String, Object>       parameters) 
     76    { 
     77        this.smellingTask = smellingTask; 
     78        this.intensity = intensity; 
    5279        this.description = description; 
    5380        this.descriptionParameters = parameters; 
     
    5784     *  
    5885     */ 
    59     public UsabilityDefectSeverity getSeverity() { 
    60         return severity; 
     86    public ITask getSmellingTask() { 
     87        return smellingTask; 
     88    } 
     89 
     90    /** 
     91     *  
     92     */ 
     93    public UsabilitySmellIntensity getIntensity() { 
     94        return intensity; 
    6195    } 
    6296 
     
    6498     * 
    6599     */ 
    66     public void setSeverity(UsabilityDefectSeverity severity) { 
    67         this.severity = severity; 
     100    public void setIntensity(UsabilitySmellIntensity intensity) { 
     101        this.intensity = intensity; 
    68102    } 
    69103 
     
    71105     * 
    72106     */ 
    73     public void setDescription(UsabilityDefectDescription description) { 
     107    public void setDescription(UsabilitySmellDescription description) { 
    74108        this.description = description; 
    75109    } 
     
    102136    @Override 
    103137    public boolean equals(Object obj) { 
    104         if (obj instanceof UsabilityDefect) { 
    105             return 
    106                 (severity == ((UsabilityDefect) obj).severity) && 
    107                 (description == ((UsabilityDefect) obj).description); 
     138        if (obj instanceof UsabilitySmell) { 
     139            return description.equals(((UsabilitySmell) obj).description); 
    108140        } 
    109141        else { 
     
    119151    @Override 
    120152    public int hashCode() { 
    121         return severity.hashCode() + description.hashCode(); 
     153        return description.hashCode(); 
    122154    } 
    123155 
     
    129161    @Override 
    130162    public String toString() { 
    131         return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")"; 
     163        if (smellingTask == null) { 
     164            return "UsabilitySmell(" + intensity + ", " + description.name() + ")"; 
     165        } 
     166        else { 
     167            return "UsabilitySmell(" + smellingTask + ", " + intensity + ", " + 
     168                description.name() + ")"; 
     169        } 
    132170    } 
    133171 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilitySmellDescription.java

    r1493 r1918  
    3232 * @author 2012, last modified by $Author: pharms$ 
    3333 */ 
    34 public enum UsabilityDefectDescription { 
     34public enum UsabilitySmellDescription { 
    3535     
    3636    INEFFICIENT_ACTIONS, 
     
    4343    HIGH_TARGET_DISTANCE, 
    4444    MISSING_FEEDBACK, 
    45     UNUSED_GUI_ELEMENTS; 
     45    UNUSED_GUI_ELEMENTS, 
     46    DATA_ENTRY_METHOD_CHANGE, 
     47    GOOD_DEFAULTS, 
     48    CHECK_BOX_SINGLE_SELECTION, 
     49    COMMON_TASK_RATE, 
     50    MISLEADING_CLICK_CUE, 
     51    MOST_OFTEN_DONE_FIRST; 
    4652 
    4753    /** */ 
    48     private static final String DEFAULT_MESSAGES_FILE = "defectDescriptions_en.xml"; 
     54    private static final String DEFAULT_MESSAGES_FILE = "smellDescriptions_en.xml"; 
    4955 
    5056    /** */ 
    51     private static DefectDescriptions sDefectDescriptions; 
     57    private static SmellDescriptions sSmellDescriptions; 
    5258 
    5359    /** */ 
    54     private DefectDescription defectDescription; 
     60    private SmellDescription smellDescription; 
    5561 
    5662    /** 
    5763     * 
    5864     */ 
    59     private UsabilityDefectDescription() { 
     65    private UsabilitySmellDescription() { 
    6066        init(); 
    6167    } 
     
    6773    private void init() { 
    6874        synchronized (this.getClass()) { 
    69             if (sDefectDescriptions == null) { 
     75            if (sSmellDescriptions == null) { 
    7076                InputStream inputStream = 
    7177                    ClassLoader.getSystemResourceAsStream(DEFAULT_MESSAGES_FILE); 
    7278 
    7379                try { 
    74                     String packageName = DefectDescriptions.class.getPackage().getName(); 
     80                    String packageName = SmellDescriptions.class.getPackage().getName(); 
    7581                    JAXBContext jaxbContext = JAXBContext.newInstance(packageName); 
    7682                    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); 
    7783 
    78                     sDefectDescriptions = 
    79                         ((JAXBElement<DefectDescriptions>) unmarshaller.unmarshal(inputStream)) 
     84                    sSmellDescriptions = 
     85                        ((JAXBElement<SmellDescriptions>) unmarshaller.unmarshal(inputStream)) 
    8086                            .getValue(); 
    8187                } 
    8288                catch (Exception e) { 
    8389                    throw new RuntimeException 
    84                         ("error while initializing usability defect descriptions", e); 
     90                        ("error while initializing usability smell descriptions", e); 
    8591                } 
    8692                finally { 
     
    97103        } 
    98104 
    99         for (DefectDescription description : sDefectDescriptions.getDefectDescription()) { 
    100             if (this.name().equals(description.getDefectId())) { 
    101                 defectDescription = description; 
     105        for (SmellDescription description : sSmellDescriptions.getSmellDescription()) { 
     106            if (this.name().equals(description.getSmellId())) { 
     107                smellDescription = description; 
    102108                break; 
    103109            } 
    104110        } 
    105111 
    106         if (defectDescription == null) { 
     112        if (smellDescription == null) { 
    107113            throw new RuntimeException 
    108                 ("error while initializing usability defect descriptions. No " + 
     114                ("error while initializing usability smell descriptions. No " + 
    109115                 "description text available for description " + this.name()); 
    110116        } 
     
    117123        List<String> parameters = new ArrayList<String>(); 
    118124 
    119         for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
     125        for (Object fragment : smellDescription.getTextFragmentOrParameterFragment()) { 
    120126            if (fragment instanceof ParameterFragment) { 
    121127                parameters.add(((ParameterFragment) fragment).getParameterName()); 
     
    132138        StringBuffer result = new StringBuffer(); 
    133139 
    134         for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
     140        for (Object fragment : smellDescription.getTextFragmentOrParameterFragment()) { 
    135141            if (result.length() > 0) { 
    136142                result.append(" "); 
     
    161167                        ("required parameter \"" + 
    162168                         ((ParameterFragment) fragment).getParameterName() + 
    163                          "\" for usability defect description " + this.name() + " not provided"); 
     169                         "\" for usability smell description " + this.name() + " not provided"); 
    164170                } 
    165171            } 
     
    180186        List<Object> result = new ArrayList<Object>(); 
    181187 
    182         for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
     188        for (Object fragment : smellDescription.getTextFragmentOrParameterFragment()) { 
    183189            if (fragment instanceof ParameterFragment) { 
    184190                Object value = null; 
     
    194200                        ("required parameter \"" + 
    195201                         ((ParameterFragment) fragment).getParameterName() + 
    196                          "\" for usability defect description " + this.name() + " not provided"); 
     202                         "\" for usability smell description " + this.name() + " not provided"); 
    197203                } 
    198204            } 
     
    209215     */ 
    210216    public String getBriefDescription() { 
    211         return defectDescription.briefText; 
     217        return smellDescription.briefText; 
    212218    } 
    213219 
     
    222228 
    223229        int paramCount = 1; 
    224         for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
     230        for (Object fragment : smellDescription.getTextFragmentOrParameterFragment()) { 
    225231            if (result.length() > 0) { 
    226232                result.append(" "); 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilitySmellIntensity.java

    r1493 r1918  
    2626 * @author 2012, last modified by $Author: pharms$ 
    2727 */ 
    28 public enum UsabilityDefectSeverity { 
    29      
    30     INFO, LOW, MEDIUM, HIGH; 
     28public class UsabilitySmellIntensity { 
    3129     
    3230    /** */ 
    33     static int defaultCoverageQuantile = 950; 
     31    private int ratio; 
     32     
     33    /** */ 
     34    private int eventCoverage; 
     35     
     36    /** */ 
     37    private int eventCoverageQuantile; 
    3438 
    3539    /** 
    3640     *  
    3741     */ 
    38     static UsabilityDefectSeverity getSeverity(int ratio, 
    39                                                int highRatioLevel, 
    40                                                int mediumRatioLevel, 
    41                                                int lowRatioLevel, 
    42                                                int infoRatioLevel) 
     42    static UsabilitySmellIntensity getIntensity(int        ratio, 
     43                                                ITask      taskWithSmell, 
     44                                                ITaskModel wholeTaskModel) 
    4345    { 
    44         return getSeverity(ratio, highRatioLevel, mediumRatioLevel, lowRatioLevel, infoRatioLevel, 
    45                            defaultCoverageQuantile); 
     46        ITaskInfo taskInfo = wholeTaskModel.getTaskInfo(taskWithSmell); 
     47        int eventCoverage = taskInfo.getMeasureValue(TaskMetric.EVENT_COVERAGE); 
     48        int eventCoverageQuantile = taskInfo.getMeasureValue(TaskMetric.EVENT_COVERAGE_QUANTILE); 
     49        return getIntensity(ratio, eventCoverage, eventCoverageQuantile); 
    4650    } 
    4751 
     
    4953     *  
    5054     */ 
    51     static UsabilityDefectSeverity getSeverity(int        ratio, 
    52                                                int        highRatioLevel, 
    53                                                int        mediumRatioLevel, 
    54                                                int        lowRatioLevel, 
    55                                                int        infoRatioLevel, 
    56                                                ITask      taskWithDefect, 
    57                                                ITaskModel wholeTaskModel) 
    58     { 
    59         ITaskInfo taskInfo = wholeTaskModel.getTaskInfo(taskWithDefect); 
    60         int eventCoverageQuantile = taskInfo.getMeasureValue(TaskMetric.EVENT_COVERAGE_QUANTILE); 
    61         return getSeverity(ratio, highRatioLevel, mediumRatioLevel, lowRatioLevel, infoRatioLevel, 
    62                            eventCoverageQuantile); 
     55    static UsabilitySmellIntensity getIntensity(int ratio) { 
     56        return getIntensity(ratio, -1, -1); 
    6357    } 
    6458 
     
    6660     *  
    6761     */ 
    68     static UsabilityDefectSeverity getSeverity(int ratio, 
    69                                                int highRatioLevel, 
    70                                                int mediumRatioLevel, 
    71                                                int lowRatioLevel, 
    72                                                int infoRatioLevel, 
    73                                                int coverageQuantile) 
     62    static UsabilitySmellIntensity getIntensity(int ratio, 
     63                                                int eventCoverage, 
     64                                                int eventCoverageQuantile) 
    7465    { 
    75         int effectiveRatio = ratio; 
    76          
    77         // event coverage ratio is in per mille. The more executed events a task covers, the more 
    78         // important a related usability defect. 
    79         /*if (eventCoverageRatio < 1) { 
    80             // one per mille, so one of thousand events is covered 
    81             effectiveRatio *= 0.2; 
     66        if ((ratio > 0) && ((eventCoverageQuantile == -1) || (eventCoverageQuantile > 0))) { 
     67            return new UsabilitySmellIntensity(ratio, eventCoverage, eventCoverageQuantile); 
    8268        } 
    83         else if (eventCoverageRatio < 5) { 
    84             // 5 per mille, so one of 250 events is covered 
    85             effectiveRatio *= 0.4; 
     69        else { 
     70            return null; 
    8671        } 
    87         else if (eventCoverageRatio < 10) { 
    88             // 1 percent, so one of 100 events is covered 
    89             effectiveRatio *= 0.5; 
    90         } 
    91         else if (eventCoverageRatio < 20) { 
    92             // 2 percent, so one of 50 events is covered 
    93             effectiveRatio *= 0.6; 
    94         } 
    95         else if (eventCoverageRatio < 30) { 
    96             // 3 percent, so one of 33 events is covered 
    97             effectiveRatio *= 0.7; 
    98         } 
    99         else if (eventCoverageRatio < 40) { 
    100             // 4 percent, so one of 28 events is covered 
    101             effectiveRatio *= 0.8; 
    102         } 
    103         else if (eventCoverageRatio < 50) { 
    104             // 5 percent, so one of 25 events is covered 
    105             effectiveRatio *= 0.9; 
    106         }*/ 
    107         //else { 
    108             // more than 5 percent, so 1 of 20 events, do not change ratio 
    109         //} 
    110         if (coverageQuantile >= defaultCoverageQuantile) { 
    111             if (effectiveRatio >= highRatioLevel) { 
    112                 return UsabilityDefectSeverity.HIGH; 
    113             } 
    114             else if (effectiveRatio >= mediumRatioLevel) { 
    115                 return UsabilityDefectSeverity.MEDIUM; 
    116             } 
    117             else if (effectiveRatio >= lowRatioLevel) { 
    118                 return UsabilityDefectSeverity.LOW; 
    119             } 
    120             else if (effectiveRatio >= infoRatioLevel) { 
    121                 return UsabilityDefectSeverity.INFO; 
    122             } 
    123         } 
    124          
    125         return null; 
    12672    } 
     73 
     74    /** 
     75     * <p> 
     76     * TODO: comment 
     77     * </p> 
     78     * 
     79     * @param ratio 
     80     * @param eventCoverage 
     81     * @param eventCoverageQuantile 
     82     */ 
     83    private UsabilitySmellIntensity(int ratio, int eventCoverage, int eventCoverageQuantile) { 
     84        super(); 
     85        this.ratio = ratio; 
     86        this.eventCoverage = eventCoverage; 
     87        this.eventCoverageQuantile = eventCoverageQuantile; 
     88    } 
     89 
     90    /** 
     91     * @return the ratio 
     92     */ 
     93    public int getRatio() { 
     94        return ratio; 
     95    } 
     96 
     97    /** 
     98     * @return the eventCoverage 
     99     */ 
     100    public int getEventCoverage() { 
     101        return eventCoverage; 
     102    } 
     103 
     104    /** 
     105     * @return the eventCoverageQuantile 
     106     */ 
     107    public int getEventCoverageQuantile() { 
     108        return eventCoverageQuantile; 
     109    } 
     110 
     111    /* (non-Javadoc) 
     112     * @see java.lang.Object#toString() 
     113     */ 
     114    @Override 
     115    public String toString() { 
     116        return Integer.toString(ratio); 
     117    } 
     118     
    127119} 
  • trunk/autoquest-core-usability/src/main/resources/smellDescriptions.xsd

    r1493 r1918  
    88  elementFormDefault="qualified"> 
    99   
    10   <xsd:element name="defectDescriptions" type="tns:DefectDescriptions" /> 
     10  <xsd:element name="smellDescriptions" type="tns:SmellDescriptions" /> 
    1111 
    12   <xsd:complexType name="DefectDescriptions"> 
     12  <xsd:complexType name="SmellDescriptions"> 
    1313    <xsd:sequence> 
    14       <xsd:element name="defectDescription" type="tns:DefectDescription" maxOccurs="unbounded" /> 
     14      <xsd:element name="smellDescription" type="tns:SmellDescription" maxOccurs="unbounded" /> 
    1515    </xsd:sequence> 
    1616  </xsd:complexType> 
    1717 
    18   <xsd:complexType name="DefectDescription"> 
     18  <xsd:complexType name="SmellDescription"> 
    1919    <xsd:choice maxOccurs="unbounded"> 
    2020      <xsd:element name="textFragment" type="tns:SimpleFragment" /> 
    2121      <xsd:element name="parameterFragment" type="tns:ParameterFragment" /> 
    2222    </xsd:choice> 
    23     <xsd:attribute name="defectId" type="xsd:string" use="required" /> 
     23    <xsd:attribute name="smellId" type="xsd:string" use="required" /> 
    2424    <xsd:attribute name="briefText" type="xsd:string" use="required" /> 
    2525  </xsd:complexType> 
  • trunk/autoquest-core-usability/src/main/resources/smellDescriptions_en.xml

    r1493 r1918  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <defectDescriptions 
     2<smellDescriptions 
    33  xmlns="http://autoquest.informatik.uni-goettingen.de" 
    44  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    5   xsi:schemaLocation="http://autoquest.informatik.uni-goettingen.de defectDescriptions.xsd"> 
    6    
    7   <defectDescription defectId="TEXT_FIELD_INPUT_RATIO" briefText="many text inputs"> 
     5  xsi:schemaLocation="http://autoquest.informatik.uni-goettingen.de smellDescriptions.xsd"> 
     6   
     7  <smellDescription smellId="TEXT_FIELD_INPUT_RATIO" briefText="many text inputs"> 
    88    <textFragment> 
    99      The ratio of interactions that enter text into text fields is relatively high in comparison 
     
    1515      or combo boxes in the case predefined values must be entered. 
    1616    </textFragment> 
    17   </defectDescription> 
    18    
    19   <defectDescription defectId="TEXT_FIELD_INPUT_REPETITIONS" briefText="many text repetitions"> 
     17  </smellDescription> 
     18   
     19  <smellDescription smellId="TEXT_FIELD_INPUT_REPETITIONS" briefText="many text repetitions"> 
    2020    <textFragment> 
    2121      In 
     
    3434      reenter the same text several times into different text fields. 
    3535    </textFragment> 
    36   </defectDescription> 
    37    
    38   <defectDescription defectId="TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO" briefText="many special signs"> 
     36  </smellDescription> 
     37   
     38  <smellDescription smellId="TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO" briefText="many special signs"> 
    3939    <parameterFragment parameterName="noLetterOrDigitRatio" /> 
    4040    <textFragment> 
     
    4848      included at the right positions. 
    4949    </textFragment> 
    50   </defectDescription> 
    51    
    52   <defectDescription defectId="HIGH_EVENT_COVERAGE" briefText="often executed"> 
     50  </smellDescription> 
     51   
     52  <smellDescription smellId="HIGH_EVENT_COVERAGE" briefText="often executed"> 
    5353    <textFragment> 
    5454      The task 
     
    6464      be executed by users for fulfilling this task. 
    6565    </textFragment> 
    66   </defectDescription> 
    67    
    68   <defectDescription defectId="INEFFICIENT_ACTIONS" briefText="inefficient actions"> 
     66  </smellDescription> 
     67   
     68  <smellDescription smellId="INEFFICIENT_ACTIONS" briefText="inefficient actions"> 
    6969    <textFragment> 
    7070      For executing task 
     
    8181      them: scrolling. 
    8282    </textFragment> 
    83   </defectDescription> 
    84    
    85   <defectDescription defectId="COOCCURENCE_SUCCEED" briefText="usual cooccurrence"> 
     83  </smellDescription> 
     84   
     85  <smellDescription smellId="COOCCURENCE_SUCCEED" briefText="usual cooccurrence"> 
    8686    <textFragment> 
    8787      In 
     
    101101      reduce the number of actions to be performed by the user. 
    102102    </textFragment> 
    103   </defectDescription> 
    104    
    105   <defectDescription defectId="COOCCURENCE_PRECED" briefText="usual cooccurrence"> 
     103  </smellDescription> 
     104   
     105  <smellDescription smellId="COOCCURENCE_PRECED" briefText="usual cooccurrence"> 
    106106    <textFragment> 
    107107      In 
     
    121121      reduce the number of actions to be performed by the user. 
    122122    </textFragment> 
    123   </defectDescription> 
    124    
    125   <defectDescription defectId="HIGH_TARGET_DISTANCE" briefText="long way to go"> 
     123  </smellDescription> 
     124   
     125  <smellDescription smellId="HIGH_TARGET_DISTANCE" briefText="long way to go"> 
    126126    <textFragment> 
    127127      For executing the task 
     
    139139      on average ), they should be more colocated to ease the execution of the task for the user. 
    140140    </textFragment> 
    141   </defectDescription> 
    142    
    143   <defectDescription defectId="MISSING_FEEDBACK" briefText="missing feedback"> 
     141  </smellDescription> 
     142   
     143  <smellDescription smellId="MISSING_FEEDBACK" briefText="missing feedback"> 
    144144    <textFragment> 
    145145      A click on the button 
     
    163163      actions. Please consider showing the user some progress after he performed the 
    164164      first click. This is especially important if the operation triggered with the click usually 
    165       takes longer than one second. This defect was observed based on task 
     165      takes longer than one second. This smell was observed based on task 
    166166    </textFragment> 
    167167    <parameterFragment parameterName="task" /> 
     
    169169      . 
    170170    </textFragment> 
    171   </defectDescription> 
    172    
    173   <defectDescription defectId="UNUSED_GUI_ELEMENTS" briefText="unused GUI elements"> 
     171  </smellDescription> 
     172   
     173  <smellDescription smellId="UNUSED_GUI_ELEMENTS" briefText="unused GUI elements"> 
    174174    <parameterFragment parameterName="ratio" /> 
    175175    <textFragment> 
     
    189189    </textFragment> 
    190190    <parameterFragment parameterName="unusedGuiElements" /> 
    191   </defectDescription> 
    192 </defectDescriptions> 
     191  </smellDescription> 
     192   
     193  <smellDescription smellId="DATA_ENTRY_METHOD_CHANGE" briefText="data entry method change"> 
     194    <textFragment> 
     195      When executing task 
     196    </textFragment> 
     197    <parameterFragment parameterName="task" /> 
     198    <textFragment> 
     199      , the users have to switch between keyboard and mouse in 
     200    </textFragment> 
     201    <parameterFragment parameterName="ratio" /> 
     202    <textFragment> 
     203      % on average between two subsequently executed actions. Frequently changing between mouse and 
     204      keyboard causes users to become slow when utilizing a GUI. Hence, these should be minimized to 
     205      optimize the users performance. 
     206    </textFragment> 
     207  </smellDescription> 
     208   
     209  <smellDescription smellId="GOOD_DEFAULTS" briefText="good defaults"> 
     210    <textFragment> 
     211      When using GUI element 
     212    </textFragment> 
     213    <parameterFragment parameterName="guiElement" /> 
     214    <textFragment> 
     215      in view 
     216    </textFragment> 
     217    <parameterFragment parameterName="view" /> 
     218    <textFragment> 
     219      , the values selected by the users are not equally distributed. Hence, it may be useful to 
     220      have a good default value. The users entered the following values with their respective 
     221      frequency in brackets most often (only the five most important entries listed): 
     222    </textFragment> 
     223    <parameterFragment parameterName="selectedValues" /> 
     224  </smellDescription> 
     225   
     226  <smellDescription smellId="CHECK_BOX_SINGLE_SELECTION" briefText="check box single selection"> 
     227    <textFragment> 
     228      Found a group of check boxes of which only one is usually selected. In this case, radio 
     229      buttons should be used instead, if the alternatives are mutually exclusive. The check boxes 
     230      belonging to the group are: 
     231    </textFragment> 
     232    <parameterFragment parameterName="radioButtons" /> 
     233  </smellDescription> 
     234   
     235  <smellDescription smellId="COMMON_TASK_RATE" briefText="common task rate"> 
     236    <textFragment> 
     237      The user sessions show only a few commonalities. On average, ten subsequently executed 
     238      actions need to be described by 
     239    </textFragment> 
     240    <parameterFragment parameterName="ratio" /> 
     241    <textFragment> 
     242      different determined tasks. In the worst case, each action is its own task. In the best case, 
     243      all actions are described by the same tasks. This indicates, that the users act relatively 
     244      different as otherwise, all their actions would be described by only a few tasks. Hence, 
     245      users seem to be missing guidance, as otherwise, they would behave similar resulting in less 
     246      generated task which still cover many recorded actions. 
     247    </textFragment> 
     248  </smellDescription> 
     249   
     250  <smellDescription smellId="MISLEADING_CLICK_CUE" briefText="misleading cue to click"> 
     251    <textFragment> 
     252      In the 
     253    </textFragment> 
     254    <parameterFragment parameterName="noOfViewDisplays" /> 
     255    <textFragment> 
     256      times the view 
     257    </textFragment> 
     258    <parameterFragment parameterName="view" /> 
     259    <textFragment> 
     260      has been displayed, the element 
     261    </textFragment> 
     262    <parameterFragment parameterName="element" /> 
     263    <textFragment> 
     264      has been clicked 
     265    </textFragment> 
     266    <parameterFragment parameterName="uselessClicks" /> 
     267    <textFragment> 
     268      times although it may not be clickable (it is no, e.g., button). If the element is not 
     269      clickable, then the element seems to give a cue that it was clickable although it is not. 
     270      Hence, it should be considered to change the appearance of the element to prevent it from 
     271      looking clickable.  
     272    </textFragment> 
     273  </smellDescription> 
     274   
     275  <smellDescription smellId="MOST_OFTEN_DONE_FIRST" briefText="most often done first in view"> 
     276    <textFragment> 
     277      When opening the view 
     278    </textFragment> 
     279    <parameterFragment parameterName="view" /> 
     280    <textFragment> 
     281      , users most often position the cursor into the text field 
     282    </textFragment> 
     283    <parameterFragment parameterName="textfield" /> 
     284    <textFragment> 
     285      (in  
     286    </textFragment> 
     287    <parameterFragment parameterName="ratio" /> 
     288    <textFragment> 
     289      % of cases when the view is opened). This should be automated to remove one action required 
     290      for users. 
     291    </textFragment> 
     292  </smellDescription> 
     293</smellDescriptions> 
Note: See TracChangeset for help on using the changeset viewer.