diff --git a/src/test/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java b/src/test/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java index 67acfa593..2b56953b6 100644 --- a/src/test/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java +++ b/src/test/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java @@ -21,22 +21,33 @@ import org.apache.commons.math.TestUtils; /** * Abstract base class for {@link ContinuousDistribution} tests. *
- * To create a concrete test class for a continuous distribution implementation, - * implement makeDistribution() to return a distribution instance to use in - * tests and each of the test data generation methods below. In each case, the - * test points and test values arrays returned represent parallel arrays of - * inputs and expected values for the distribution returned by makeDistribution(). - *
+ * To create a concrete test class for a continuous distribution + * implementation, first implement makeDistribution() to return a distribution + * instance to use in tests. Then implement each of the test data generation + * methods below. In each case, the test points and test values arrays + * returned represent parallel arrays of inputs and expected values for the + * distribution returned by makeDistribution(). Default implementations + * are provided for the makeInverseXxx methods that just invert the mapping + * defined by the arrays returned by the makeCumulativeXxx methods. + *
* makeCumulativeTestPoints() -- arguments used to test cumulative probabilities * makeCumulativeTestValues() -- expected cumulative probabilites - * makeInverseCumulativeTestPoints() -- arguments used to test inverse cdf evaluation + * makeInverseCumulativeTestPoints() -- arguments used to test inverse cdf * makeInverseCumulativeTestValues() -- expected inverse cdf values *
- * To implement additional test cases with different distribution instances and test data, - * use the setXxx methods for the instance data in test cases and call the verifyXxx methods - * to verify results. + * To implement additional test cases with different distribution instances and + * test data, use the setXxx methods for the instance data in test cases and + * call the verifyXxx methods to verify results. *
* Error tolerance can be overriden by implementing getTolerance(). + *
+ * Test data should be validated against reference tables or other packages + * where possible, and the source of the reference data and/or validation + * should be documented in the test cases. A framework for validating + * distribution data against R is included in the /src/R source tree. + *
+ * See {@link NormalDistributionTest} and {@link ChiSquareDistributionTest} + * for examples. * * @version $Revision$ $Date$ */ diff --git a/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java b/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java index 2bb3df5bf..970171c76 100644 --- a/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java +++ b/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java @@ -33,10 +33,6 @@ public class NormalDistributionTest extends ContinuousDistributionAbstractTest super(arg0); } - public static void main(String[] args) { - junit.swingui.TestRunner.run(NormalDistributionTest.class); - } - //-------------- Implementations for abstract methods ----------------------- /** Creates the default continuous distribution instance to use in tests. */