diff --git a/src/main/java/fr/spoonlabs/flacoco/localization/spectrum/formulas/OchiaiFormula.java b/src/main/java/fr/spoonlabs/flacoco/localization/spectrum/formulas/OchiaiFormula.java index 438d3562..798535f5 100644 --- a/src/main/java/fr/spoonlabs/flacoco/localization/spectrum/formulas/OchiaiFormula.java +++ b/src/main/java/fr/spoonlabs/flacoco/localization/spectrum/formulas/OchiaiFormula.java @@ -8,11 +8,28 @@ public OchiaiFormula() { public double compute(int nPassingNotExecuting, int nFailingNotExecuting, int nPassingExecuting, int nFailingExecuting) { - if ((nFailingExecuting + nPassingExecuting == 0) || (nFailingExecuting + nFailingNotExecuting == 0)) { +// if ((nFailingExecuting + nPassingExecuting == 0) || (nFailingExecuting + nFailingNotExecuting == 0)) { +// return 0; +// } + + if ((nFailingExecuting + nFailingNotExecuting == 0) || (nPassingExecuting+nPassingNotExecuting ==0) || ((nFailingExecuting/(nFailingExecuting+nFailingNotExecuting)) + (nPassingExecuting/(nPassingExecuting+nPassingNotExecuting))) == 0) { return 0; } - return nFailingExecuting - / (Math.sqrt((nFailingExecuting + nFailingNotExecuting) * (nFailingExecuting + nPassingExecuting))); + +// if (( nPassingExecuting + ((nFailingExecuting+nFailingNotExecuting)-(nFailingExecuting))) == 0) { +// return 0; +// } + +// return nFailingExecuting +// / (Math.sqrt((nFailingExecuting + nFailingNotExecuting) * (nFailingExecuting + nPassingExecuting))); + + return ((nFailingExecuting/(nFailingExecuting+nFailingNotExecuting)) + / ((nFailingExecuting/(nFailingExecuting+nFailingNotExecuting)) + (nPassingExecuting/(nPassingExecuting+nPassingNotExecuting)))); + + + +// return (nFailingExecuting / ( nPassingExecuting + ((nFailingExecuting+nFailingNotExecuting)-(nFailingExecuting)))); + } }