Ignore:
Timestamp:
06/28/16 12:01:39 (8 years ago)
Author:
sherbold
Message:
  • rather intrusive and large change to correctly evaluate AUCEC in case metrics are modified. The effort is now stored directly with a software version and it is the duty of the loader to specify the review effort for each instance. This required changes to the execution strategiey, data loading, and evaluation process.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/loader/AbstractFolderLoader.java

    r86 r132  
    1616 
    1717import java.io.File; 
     18import java.util.ArrayList; 
    1819import java.util.LinkedList; 
    1920import java.util.List; 
    2021 
     22import weka.core.Attribute; 
    2123import weka.core.Instances; 
    2224 
     
    6668                            Instances data = instancesLoader.load(versionFile); 
    6769                            String versionName = data.relationName(); 
    68                             versions.add(new SoftwareVersion(projectName, versionName, data)); 
     70                            List<Double> efforts = getEfforts(data);  
     71                            versions.add(new SoftwareVersion(projectName, versionName, data, efforts)); 
    6972                        } 
    7073                    } 
     
    7376        } 
    7477        return versions; 
     78    } 
     79     
     80    private List<Double> getEfforts(Instances data) { 
     81        // attribute in the JURECZKO data and default 
     82        Attribute effortAtt = data.attribute("loc"); 
     83        if (effortAtt == null) { 
     84            // attribute in the NASA/SOFTMINE/MDP data 
     85            effortAtt = data.attribute("LOC_EXECUTABLE"); 
     86        } 
     87        if (effortAtt == null) { 
     88            // attribute in the AEEEM data 
     89            effortAtt = data.attribute("numberOfLinesOfCode"); 
     90        } 
     91        if (effortAtt == null) { 
     92            // attribute in the RELINK data 
     93            effortAtt = data.attribute("CountLineCodeExe"); 
     94        } 
     95        if( effortAtt == null ) { 
     96            return null; 
     97        } 
     98        List<Double> efforts = new ArrayList<>(data.size()); 
     99        for( int i=0; i<data.size(); i++ ) { 
     100            efforts.add(data.get(i).value(effortAtt)); 
     101        } 
     102        return efforts; 
    75103    } 
    76104 
Note: See TracChangeset for help on using the changeset viewer.