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