← Back to team overview

yade-dev team mailing list archive

Re: stability & compatibility between newer and older versions of yade

 

Thanks for raising this major issue. It would be great to populate unit
tests indeed.

I recently [1] introduced a regression test for the utils module and I
would like to advertise it here. It is testing only one function from utils
currently.
It needs volunteers to expand it (which can be done simply by reproducing
the logic of testUserCreatedInteraction() in more functions). If nobody is
going to add tests systematically - the ideal case - I would suggest at
least that:
*when a bug is fixed a unit test is added simultaneously*.
Fixing a bug usually gives a fresh vision of the behavior, which makes
writing a unit test easier.
Ultimately we could even collectively agree that a bug is not fixed if
there is no test proving it.

About 1: would be great provided that it doesn't end-up in simply removing
examples which do not work.
Classifying examples is also an important point and I would discourage the
previous approach of moving failing scripts to a special
"examples/not-working" folder since it breaks the classification in
subfolders. Better rename them (something like *.py.fail) while keeping
them in their original location.
It is less clear if/how you intend to implement the "all examples must
work" policy. It is difficult to automatize testing of examples since they
are very heterogeneous. For instance some examples don't have a O.run() as
user is supposed to click "play" instead.
If the error happens after playing the error will not be detected. I
suspect many other special situations like this one.

About 2. I support the idea of investigating new techniques yet I don't
understand the suggestion very well. My impression is that all plugins are
already eligible for unit tests. For instance, testing a function from
utils in [1] did not need any change to the utils module itslef. All it
needs is to effectively design and write the unit tests for each other
function of each other class/module. That's indeed hundreds - if not
thousands - of tests.

Cheers
Bruno

[1]
https://github.com/yade/trunk/commit/b5fbefc6463294f580296cb5727dbbfd733fa8a0



On Sat, 5 Jan 2019 at 15:24, Janek Kozicki <janek_listy@xxxxx> wrote:

> I'd like to touch the issue of compatibility between newer and older
> versions of yade. Some people prefer not to upgrade :)
>
> I would like to tackle this in two steps:
>
> 1. I would create a branch "fixing-examples" with the aim to go
> meticulously through all the examples and make sure that they all
> work. Once they work merge them into develop, then master. And keep
> policy that in master all examples must work.
>
> 2. introduce more detailed unit tests in same way as plugins are declared
> via macro.
> The goal would be that every declared plugin would simultaneously be
> declared as eligible for unit testing. That's hundreds of unit tests
> to be written. But I guess that's the only way to go ensure stability.
> I want to investigate this approach, perhaps use boost::unit_test for that.
> Once each plugin has unit test for each of its methods we would reach 100%
> test coverage :)
>
> thoughts?
> --
> Janek Kozicki
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References