commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <benerit...@googlemail.com>
Subject Re: [Math] How to use a class from the "test" source tree?
Date Wed, 13 Jun 2012 13:32:39 GMT
Hi again,

2012/6/13 Gilles Sadowski <gilles@harfang.homelinux.org>:
> On Wed, Jun 13, 2012 at 12:34:51PM +0200, Benedikt Ritter wrote:
>> Hi,
>>
>> 2012/6/13 Gilles Sadowski <gilles@harfang.homelinux.org>:
>> > Hi.
>> >
>> >> >
>> >> > Is there a way for an application to depend on the classes defined
in the
>> >> > "test" subtree of the code repository?
>> >>
>> >> If the component releases the test jar, then it should be possible.
>> >
>> > It seems that it's not released as a JAR (probably only in the zip/tar
>> > and source archive).
>> >
>> >>
>> >> But if the test code is more generally useful, perhaps it should be
>> >> moved to the java subtree.
>> >
>> > I'd like to make it easy to use "PerfTestUtils" outside of the CM
>> > development environment.
>> >
>> > Is it OK to move it to "main"? Before doing so, I also expected that more
>> > people would have a look at it, and agree on the "methodology" (or suggest
>> > ways to improve it) and API.
>> >
>> > When I move it, should it go to the top-level package "o.a.c.m"? Or maybe
>> > into "util"? Or even a new "util/perf" subpackage (to separate utilities
>> > used by the CM code from utilities used to test the code's performance?
>> >
>>
>> I don't know, to me it feels rather strange to add a TestPerfUtil to
>> the public API of a mathematical library.
>
> I agree.
> [That's why I put the class where it is.]
>
>> OTOH TestPerfUtils looks to
>> specific to be used outside the context of CM (it uses classes defined
>> in CM).
>
> I don't understand that. It's a (mini-)benchmarking tool; it can be used to
> time any code, not just CM routines.
>

PerfTestUtils defines imports:
import org.apache.commons.math3.stat.descriptive.SummaryStatistics;
import org.apache.commons.math3.stat.descriptive.StatisticalSummary;
import org.apache.commons.math3.exception.MathIllegalStateException;

it can not be used without having CM on the classpath. That's what i meant ;-)

>> I see two solutions:
>> 1. if you need it just for one project, you could simply copy the
>> class to that project in the test tree
>
> No. The purpose is to provide a tool to anyone who claims that "changing
> X in the CM code will improve performance", so that the claim is backed by
> actual numbers.
>

In this case one will have to check out the hole CM anyway, I guess?

>> 2. if you need it for several projects and there are additional useful
>> classes in the test tree that are concerned with tests in context of
>> CM, a new component could be created that defines a dependency to CM.
>> This dependency (commons-math-testutils ?!) could then be added to
>> what ever project in the test scope.
>
> A clean solution, but I don't think that there is enough code to be worth
> the burden of a separate project.
>
> A third solution is to indeed publish a JAR composed of the classes in the
> "test" subtree of the repository, as hinted at by Sebb.
> If it's OK, could someone please make the necessary changes (both for
> producing official releases and for daily snapshots)?
>

I agree.

regards,
Benedikt

>
> Thanks,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message