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/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability
Files:
3 added
4 edited
1 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 
Note: See TracChangeset for help on using the changeset viewer.