Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 98016 invoked from network); 9 May 2004 00:39:56 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 May 2004 00:39:56 -0000 Received: (qmail 38886 invoked by uid 500); 9 May 2004 00:39:38 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 38515 invoked by uid 500); 9 May 2004 00:39:35 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 38438 invoked from network); 9 May 2004 00:39:35 -0000 Received: from unknown (HELO web41310.mail.yahoo.com) (66.218.93.59) by daedalus.apache.org with SMTP; 9 May 2004 00:39:35 -0000 Message-ID: <20040509003943.79252.qmail@web41310.mail.yahoo.com> Received: from [68.164.185.157] by web41310.mail.yahoo.com via HTTP; Sat, 08 May 2004 17:39:43 PDT Date: Sat, 8 May 2004 17:39:43 -0700 (PDT) From: Al Chou Subject: Re: [math] Distributions tests To: Jakarta Commons Developers List In-Reply-To: <409CFF26.5090309@steitz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --- Phil Steitz wrote: > To close out BZ #28829, I need to add some degenerate test cases to > BinomialDistributionTest. As I started to do this, I realized that adding > more test points would be easier and we could eliminate duplication of > code across test classes in the distributions package if we defined > abstract test classes for discrete and continuous distributions that > provided generic verification methods. The setup for the discrete case > looks like this: > > Abstract base class for {@link DiscreteDistribution} tests. >

> To create a concrete test class for a discrete 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(). >

> makeDensityTestPoints() -- arguments used to test probability density > calculation > makeDensityTestValues() -- expected probability densities > makeCumulativeTestPoints() -- arguments used to test cumulative probabilities > makeCumulativeTestValues() -- expected cumulative probabilites > makeInverseCumulativeTestPoints() -- arguments used to test inverse cdf > evaluation > makeInverseCumulativeTestValues() -- expected inverse cdf values > > Then one default method for each type of test runs through the test points > / expected values and checks the test instance. To support tests using > multiple instances, setXxx methods would also be provided for the instance > and test data arrays. Similar setup for continuous. This will make it > easier to add more test cases (including adding missing tests for discrete > pdf calculations) and simplify development of new distribution test > classes. Any objections? > > Phil Sounds very reasonable to me. Al __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org