de.fzi.kadmos.evaluator.impl
Class PrecRecEvaluatorTest

java.lang.Object
  extended by de.fzi.kadmos.evaluator.impl.PrecRecEvaluatorTest

public class PrecRecEvaluatorTest
extends Object

Test class for the classical precision / recall evaluator PrecRecEvaluatorImpl.

Author:
Juergen Bock

Constructor Summary
PrecRecEvaluatorTest()
           
 
Method Summary
static void setUpBeforeClass()
           
 void testGetFMeasureAllWrong()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureContainsHalf()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetFMeasureEmptyAlignment()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureEmptyReferenceAlignment()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureEqualAlignmentAndReference()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureIncompatibleOntology1()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureIncompatibleOntology2()
          Test for PrecRecEvaluator.getFMeasure(Alignment).
 void testGetFMeasureNullReference()
          If a null reference is given as parameter for the PrecRecEvaluatorImpl.getFMeasure(Alignment) method, an IllegalArgumentException is expected.
 void testGetPrecisionAllCorrectButIncomplete()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionEmptyAlignment()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionEmptyReferenceAlignment()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionEqualAlignmentAndReference()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionIncompatibleOntology1()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionIncompatibleOntology2()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionNullReference()
          If a null reference is given as parameter for the PrecRecEvaluatorImpl.getPrecision(Alignment) method, an IllegalArgumentException is expected.
 void testGetPrecisionOneOfTwoCorrect()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetPrecisionTwoOfFourCorrect()
          Test for PrecRecEvaluator.getPrecision(Alignment).
 void testGetRecallContainsAllButMore()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallEmptyAlignment()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallEmptyReferenceAlignment()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallEqualAlignmentAndReference()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallFourOfEightContained()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallIncompatibleOntology1()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallIncompatibleOntology2()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testGetRecallNullReference()
          If a null reference is given as parameter for the PrecRecEvaluatorImpl.getRecall(Alignment) method, an IllegalArgumentException is expected.
 void testGetRecallOneOfTwoContained()
          Test for PrecRecEvaluator.getRecall(Alignment).
 void testInitNullReference()
          If a null reference is given as parameter for the PrecRecEvaluatorImpl.getInstance(Alignment) method, an IllegalArgumentException is expected.
 void testInstanceCaching()
          If two instances are requested using the same reference Alignment, the same PrecRecEvaluatorImpl instance is provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrecRecEvaluatorTest

public PrecRecEvaluatorTest()
Method Detail

setUpBeforeClass

public static void setUpBeforeClass()
                             throws Exception
Throws:
Exception

testInitNullReference

public final void testInitNullReference()
                                 throws Exception
If a null reference is given as parameter for the PrecRecEvaluatorImpl.getInstance(Alignment) method, an IllegalArgumentException is expected.

Throws:
Exception

testGetPrecisionNullReference

public final void testGetPrecisionNullReference()
                                         throws Exception
If a null reference is given as parameter for the PrecRecEvaluatorImpl.getPrecision(Alignment) method, an IllegalArgumentException is expected.

Throws:
Exception

testGetRecallNullReference

public final void testGetRecallNullReference()
                                      throws Exception
If a null reference is given as parameter for the PrecRecEvaluatorImpl.getRecall(Alignment) method, an IllegalArgumentException is expected.

Throws:
Exception

testGetFMeasureNullReference

public final void testGetFMeasureNullReference()
                                        throws Exception
If a null reference is given as parameter for the PrecRecEvaluatorImpl.getFMeasure(Alignment) method, an IllegalArgumentException is expected.

Throws:
Exception

testInstanceCaching

public final void testInstanceCaching()
                               throws Exception
If two instances are requested using the same reference Alignment, the same PrecRecEvaluatorImpl instance is provided. If different reference Alignments are used, different instances are provided.

Throws:
Exception

testGetPrecisionEmptyAlignment

public final void testGetPrecisionEmptyAlignment()
                                          throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). Empty alignment, non-empty reference alignment. Expected: NaN

Throws:
Exception

testGetPrecisionEmptyReferenceAlignment

public final void testGetPrecisionEmptyReferenceAlignment()
                                                   throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). Non-empty alignment, empty reference alignment. Expected: 0.0

Throws:
Exception

testGetPrecisionEqualAlignmentAndReference

public final void testGetPrecisionEqualAlignmentAndReference()
                                                      throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). Equal alignment and reference alignment. Expected: 1.0

Throws:
Exception

testGetPrecisionAllCorrectButIncomplete

public final void testGetPrecisionAllCorrectButIncomplete()
                                                   throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). All correct, but reference contains more. Expected: 1.0

Throws:
Exception

testGetPrecisionOneOfTwoCorrect

public final void testGetPrecisionOneOfTwoCorrect()
                                           throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). 1 of 2 correct. Expected: 0.5

Throws:
Exception

testGetPrecisionTwoOfFourCorrect

public final void testGetPrecisionTwoOfFourCorrect()
                                            throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). 2 of 4 correct. Expected: 0.5

Throws:
Exception

testGetPrecisionIncompatibleOntology1

public final void testGetPrecisionIncompatibleOntology1()
                                                 throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). Different ontology 1 in alignment reference. Expected: IncompatibleAlignmentsException

Throws:
Exception

testGetPrecisionIncompatibleOntology2

public final void testGetPrecisionIncompatibleOntology2()
                                                 throws Exception
Test for PrecRecEvaluator.getPrecision(Alignment). Different ontology 2 in alignment and reference. Expected: IncompatibleAlignmentsException

Throws:
Exception

testGetRecallEmptyAlignment

public final void testGetRecallEmptyAlignment()
                                       throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Empty alignment, non-empty reference alignment. Expected: 0.0

Throws:
Exception

testGetRecallEmptyReferenceAlignment

public final void testGetRecallEmptyReferenceAlignment()
                                                throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Non-empty alignment, empty reference alignment. Expected: NaN

Throws:
Exception

testGetRecallEqualAlignmentAndReference

public final void testGetRecallEqualAlignmentAndReference()
                                                   throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Equal alignment and reference alignment. Expected: 1.0

Throws:
Exception

testGetRecallContainsAllButMore

public final void testGetRecallContainsAllButMore()
                                           throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Contains all from reference, but also some more. Expected: 1.0

Throws:
Exception

testGetRecallOneOfTwoContained

public final void testGetRecallOneOfTwoContained()
                                          throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). 1 of 2 contained. Expected: 0.5

Throws:
Exception

testGetRecallFourOfEightContained

public final void testGetRecallFourOfEightContained()
                                             throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). 4 of 8 contained. Expected: 0.5

Throws:
Exception

testGetRecallIncompatibleOntology1

public final void testGetRecallIncompatibleOntology1()
                                              throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Different ontology 1 in alignment reference. Expected: IncompatibleAlignmentsException

Throws:
Exception

testGetRecallIncompatibleOntology2

public final void testGetRecallIncompatibleOntology2()
                                              throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Different ontology 2 in alignment and reference. Expected: IncompatibleAlignmentsException

Throws:
Exception

testGetFMeasureEmptyAlignment

public final void testGetFMeasureEmptyAlignment()
                                         throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). Empty alignment, non-empty reference alignment. Expected: NaN

Throws:
Exception

testGetFMeasureEmptyReferenceAlignment

public final void testGetFMeasureEmptyReferenceAlignment()
                                                  throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). Non-empty alignment, empty reference alignment. Expected: NaN

Throws:
Exception

testGetFMeasureEqualAlignmentAndReference

public final void testGetFMeasureEqualAlignmentAndReference()
                                                     throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). Equal alignment and reference alignment. Expected: 1.0

Throws:
Exception

testGetFMeasureContainsHalf

public final void testGetFMeasureContainsHalf()
                                       throws Exception
Test for PrecRecEvaluator.getRecall(Alignment). Contains half of the correspondences from reference. Expected: precision=0.5, recall=1.0, f-measure=2/3

Throws:
Exception

testGetFMeasureAllWrong

public final void testGetFMeasureAllWrong()
                                   throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). All wrong. Expected: 0.0

Throws:
Exception

testGetFMeasureIncompatibleOntology1

public final void testGetFMeasureIncompatibleOntology1()
                                                throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). Different ontology 1 in alignment reference. Expected: IncompatibleAlignmentsException

Throws:
Exception

testGetFMeasureIncompatibleOntology2

public final void testGetFMeasureIncompatibleOntology2()
                                                throws Exception
Test for PrecRecEvaluator.getFMeasure(Alignment). Different ontology 2 in alignment and reference. Expected: IncompatibleAlignmentsException

Throws:
Exception


Copyright © 2012. All Rights Reserved.