Package org.cishell.testing.convertertester.core.tester2

Examples of org.cishell.testing.convertertester.core.tester2.TestConfigData


    for (int ii = 0; ii < crs.length; ii++) {
      ConvResult cr = crs[ii];
     
      ChanceAtFault[] cafs = cr.getAllChanceAtFaults();
      for (int jj = 0; jj < cafs.length; jj++) {
        ChanceAtFault caf = cafs[jj];
       
        String expln = caf.getExplanation();
       
        if(explnToCafs.get(expln) != null) {
          ((List)explnToCafs.get(expln)).add(caf);
        }
        else {
View Full Code Here


 
  //Map<test, Map<pass, List<cafs>>>
  private Map categorizeByTestAndPass(List cafList) {
    Map testToPassesToCafs = new HashMap();
    for (int ii = 0; ii < cafList.size(); ii++) {
      ChanceAtFault caf = (ChanceAtFault) cafList.get(ii)
      FilePassResult pass = caf.getFailedFilePass();
      TestResult test = pass.getParent();
     
      Map passToCafs;
      List cafs;
     
View Full Code Here

 
  public ChanceAtFault getCafAssociatedWithProvidedConverter(
      List cafs, Converter conv) {
    Iterator cafIter = cafs.iterator();
    while (cafIter.hasNext()) {
      ChanceAtFault caf = (ChanceAtFault) cafIter.next();
     
      if (caf.getConverter() == conv) {
        return caf;
      }
    }
   
    return null;
View Full Code Here

   
    Iterator iter = this.failedInvolvedPasses.iterator();
    while (iter.hasNext()) {
      FilePassFailure failFP = (FilePassFailure) iter.next();
     
      ChanceAtFault chanceAtFault =
        failFP.getChanceAtFaultFor(this.conv);
     
      //add to list for all involved chance at faults
      this.chanceAtFaults.add(chanceAtFault);
     
      /*
       * potentially add to list for chance at faults with unique
       *  explanations.
       */
     
      String explanation = chanceAtFault.getExplanation();
     
      boolean unique =
        ! containsChanceAtFaultWithExpln(
            this.uniqueExplnChanceAtFaults, explanation);
     
View Full Code Here

    if (wasTested()) {
      float chanceCorrectSoFar = 1.0f;
   
      Iterator iter = this.uniqueExplnChanceAtFaults.iterator();
      while (iter.hasNext()) {
        ChanceAtFault uniqueExplnCAF = (ChanceAtFault) iter.next();
     
        float chanceCorrectForThisError =
          uniqueExplnCAF.getChanceNotAtFault();
     
        chanceCorrectSoFar *= chanceCorrectForThisError;
     
      }
   
View Full Code Here

 
  private boolean containsChanceAtFaultWithExpln(List chanceAtFaultList,
      String explanation) {
    Iterator iter = chanceAtFaultList.iterator();
    while (iter.hasNext()) {
      ChanceAtFault caf = (ChanceAtFault) iter.next();
     
      if (explanation.equals(caf.getExplanation())) {
        return true;
      }
    }
   
    return false;
View Full Code Here

 
  private ChanceAtFault[] removeDuplicateConverters(List cafs) {
    List newCafs = new ArrayList();
    List newCafConvs = new ArrayList();
    for (int ii = 0; ii < cafs.size(); ii++) {
      ChanceAtFault caf  = (ChanceAtFault) cafs.get(ii);
      if (! newCafConvs.contains(caf.getConverter())) {
        newCafs.add(caf);
        newCafConvs.add(caf.getConverter());
      }
    }
   
    return (ChanceAtFault[]) newCafs.toArray(new ChanceAtFault[0]);
  }
View Full Code Here

        //set potential culprits to be intersection of
        //new potential culprits and old.
        List newPCs = new ArrayList();

        for (int ii = 0; ii < this.pcs.size(); ii++) {
          ChanceAtFault pc = (ChanceAtFault) this.pcs.get(ii);

          for (int jj = 0; jj < otherPCs.length; jj++) {
            ChanceAtFault otherPC = otherPCs[jj];

            if (pc.getConverter() == otherPC.getConverter()
                && otherPC.getChanceAtFault() > 0.0f) {

              ChanceAtFault newPC = new ChanceAtFault(pc
                  .getFailedFilePass(), pc.getConverter(), pc
                  .getChanceAtFault()
                  + otherPC.getChanceAtFault());

              newPCs.add(pc);

              break;
            }
          }
        }

        this.pcs = newPCs;

      } else {
        //add all chance at faults > 0.0f to potential culprit list
        List newPCs = new ArrayList();
        for (int ii = 0; ii < otherPCs.length; ii++) {
          ChanceAtFault pc = (ChanceAtFault) otherPCs[ii];
         
          if (pc.getChanceAtFault() > 0.0f) {
            newPCs.add(pc);
          }
        }
       
        this.pcs = newPCs;
View Full Code Here

   
    public ChanceAtFault[] getCulprits() {
      //normalize chance at faults
      float totalChanceAtFaults = 0.0f;
      for (int ii = 0; ii <  pcs.size(); ii++) {
        ChanceAtFault pc = (ChanceAtFault) pcs.get(ii);
       
        totalChanceAtFaults += pc.getChanceAtFault();
      }
     
      ChanceAtFault[] uniqueCafs =
        removeDuplicateConverters(this.pcs);
     
      List uniqueNormalizedCafs = new ArrayList();
      for (int ii = 0; ii < uniqueCafs.length; ii++) {
        ChanceAtFault pc = uniqueCafs[ii];
       
        ChanceAtFault normPC = new ChanceAtFault(
            pc.getFailedFilePass(),
            pc.getConverter(),
            pc.getChanceAtFault() / totalChanceAtFaults);
       
        uniqueNormalizedCafs.add(normPC);
View Full Code Here

   
    //analyze the test results to extract more useful info
   
    Converter[] allConverters = converterGraph.getAllConverters();
   
    ChanceAtFaultHeuristic faultHeuristic =
      new ErrorProximityHeuristic();
    AllConvsResult allConvertersResult =
      ConvResultMaker.generate(allTestsResult, allConverters,
          faultHeuristic);
   
View Full Code Here

TOP

Related Classes of org.cishell.testing.convertertester.core.tester2.TestConfigData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.