You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sébastien Brisard <se...@m4x.org> on 2012/05/30 07:24:25 UTC
[math] Duplicate code in ArrayRealVectorTest, RealVectorTest, SparseRealVectorTest
Dear all,
while working on MATH-792 [1], I've noticed that the above mentioned
tests contain a lot of duplicate code. Besides, some of the unit tests
are no longer (in my opinion) unit tests, since they test many
different functionalities.
I would be tempted to refactor these tests. I've recently implemented
RealVectorAbstractTest for testing the various implementations of the
visitor pattern. That's probably the place where the code should be
factored out.
Besides readability, the benefit would be use of implementation of
other kinds of vector. The immediate benefit for me would be for the
implementation of views of vectors (which have been discussed some
time ago on the ML): testing would be almost trivial (I hope). I think
this refactoring would also lead to a natural resolution of MATH-625
[2].
It could be argued that this is counter-productive, as I would be
doing again what has already been done (and works!). I do not know if
we intend to release 3.1 soon, in which case this proposal might be
postponed.
What do you think?
Best regards,
Sébastien
[1] https://issues.apache.org/jira/browse/MATH-792
[2] https://issues.apache.org/jira/browse/MATH-625
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] Duplicate code in ArrayRealVectorTest, RealVectorTest,
SparseRealVectorTest
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 31/05/2012 07:56, Sébastien Brisard a écrit :
> Hello,
> assuming that no answer meant no (strong) opposition, I took the
> liberty to create MATH-795 [1]. This refactoring has already revealed
> a problem (see r1344570 and r1344571).
Fine, thanks
Luc
>
> Best regards,
>
> Sébastien
>
> [1] https://issues.apache.org/jira/browse/MATH-795
>
> 2012/5/30 Sébastien Brisard <se...@m4x.org>:
>> Dear all,
>> while working on MATH-792 [1], I've noticed that the above mentioned
>> tests contain a lot of duplicate code. Besides, some of the unit tests
>> are no longer (in my opinion) unit tests, since they test many
>> different functionalities.
>> I would be tempted to refactor these tests. I've recently implemented
>> RealVectorAbstractTest for testing the various implementations of the
>> visitor pattern. That's probably the place where the code should be
>> factored out.
>> Besides readability, the benefit would be use of implementation of
>> other kinds of vector. The immediate benefit for me would be for the
>> implementation of views of vectors (which have been discussed some
>> time ago on the ML): testing would be almost trivial (I hope). I think
>> this refactoring would also lead to a natural resolution of MATH-625
>> [2].
>>
>> It could be argued that this is counter-productive, as I would be
>> doing again what has already been done (and works!). I do not know if
>> we intend to release 3.1 soon, in which case this proposal might be
>> postponed.
>>
>> What do you think?
>>
>> Best regards,
>> Sébastien
>>
>> [1] https://issues.apache.org/jira/browse/MATH-792
>> [2] https://issues.apache.org/jira/browse/MATH-625
>
>
> ---------------------------------------------------------------------
> 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
Re: [math] Duplicate code in ArrayRealVectorTest, RealVectorTest, SparseRealVectorTest
Posted by Sébastien Brisard <se...@m4x.org>.
Hello,
assuming that no answer meant no (strong) opposition, I took the
liberty to create MATH-795 [1]. This refactoring has already revealed
a problem (see r1344570 and r1344571).
Best regards,
Sébastien
[1] https://issues.apache.org/jira/browse/MATH-795
2012/5/30 Sébastien Brisard <se...@m4x.org>:
> Dear all,
> while working on MATH-792 [1], I've noticed that the above mentioned
> tests contain a lot of duplicate code. Besides, some of the unit tests
> are no longer (in my opinion) unit tests, since they test many
> different functionalities.
> I would be tempted to refactor these tests. I've recently implemented
> RealVectorAbstractTest for testing the various implementations of the
> visitor pattern. That's probably the place where the code should be
> factored out.
> Besides readability, the benefit would be use of implementation of
> other kinds of vector. The immediate benefit for me would be for the
> implementation of views of vectors (which have been discussed some
> time ago on the ML): testing would be almost trivial (I hope). I think
> this refactoring would also lead to a natural resolution of MATH-625
> [2].
>
> It could be argued that this is counter-productive, as I would be
> doing again what has already been done (and works!). I do not know if
> we intend to release 3.1 soon, in which case this proposal might be
> postponed.
>
> What do you think?
>
> Best regards,
> Sébastien
>
> [1] https://issues.apache.org/jira/browse/MATH-792
> [2] https://issues.apache.org/jira/browse/MATH-625
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org