Ignore:
Timestamp:
03/12/15 15:50:28 (9 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    } 
Note: See TracChangeset for help on using the changeset viewer.