GithubHelp home page GithubHelp logo

Unit testing about espressopp HOT 8 OPEN

espressopp avatar espressopp commented on May 8, 2024
Unit testing

from espressopp.

Comments (8)

niktre avatar niktre commented on May 8, 2024

maybe a straightforward thing, but I would say that the test should be reproducible (though it is not always possible)

from espressopp.

acfogarty avatar acfogarty commented on May 8, 2024

@niktre What do you mean by reproducible, exactly? If a unit test isn't reproducible, then it will always fail, right? And that will make it useless as a unit test.

from espressopp.

acfogarty avatar acfogarty commented on May 8, 2024

Some of the existing unit tests are pretty slow (pi_water and polymer_melt_tabulated are 30-40 seconds each). Moreover they don't seem to actually test for anything except "runs for N steps without crashing". Does anyone know if there's some reason they're written that way that I'm not understanding? If not I'll just reduce the number of steps.

from espressopp.

junghans avatar junghans commented on May 8, 2024

Most of the current tests were just examples, which I turned into regression tests, half of them compare against some reference data, but by no means are these unittests!

from espressopp.

acfogarty avatar acfogarty commented on May 8, 2024

When I first started writing unit tests for recent commits, my main confusion was that half the stuff in the testsuite didn't seem to actually BE unit tests... Now I get it!
I think @MrTheodor recent commits are good examples of unittests for us all to copy. What do you all think?

from espressopp.

junghans avatar junghans commented on May 8, 2024

Agreed! Long term, I would like to separate unit and regression tests, but for now mixed tests are better than no tests.

from espressopp.

niktre avatar niktre commented on May 8, 2024
  1. How short should the tests be? It there an upper limit? 1 sec?
  2. Should they test "physics" or not? An example: at the moment I have an LB test that runs small stochastic LB liquid and calculates after short run the average density and momentum. Then I compare them with the initial ones, so that I know, that there is no mass or momentum leak in the system. Is this test ok?

from espressopp.

jkrajniak avatar jkrajniak commented on May 8, 2024

@niktre Currently travis has a limit of 50min for build; but I wouldn't restrict time at this stage. We don't have problems with long tests but with missing tests.
Ad 2. I think that's important that the physics behind is correctly tested, this should be also the case of the interactions. As we deal with mixed environment and the tests run on Python level, we actually test the interface and the results of operations at that level.

from espressopp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.