SEARCH
TOOLBOX
LANGUAGES
SofaVerification

SofaVerification

From SOFAWiki

Jump to: navigation, search
Instructions to verify the good behavior of Sofa

We provide with Sofa a way to test its good behavior so that you can make sure that any modification you do will not have unexpected damage on other parts of Sofa. This is called 'SofaVerification

Contents

SofaVerification

The goal of this project is to create a dashboard for Sofa, not testing the result of the compilation, but the behavior of Sofa after the different commits. But, of course you can use it on your own.

Steps

  1. Compile the project sofaVerification: it is located in $SOFA/applications/projects/sofaVerification.
    • Just run qmake; make;
    • A new binary has been created called sofaVerification and placed in $SOFA/bin/ directory.
  2. Create a file containing the list of the scenes you will use to run the tests. You can find one example $SOFA/applications/projects/sofaVerification/verification.ini
  3. Record the reference files: Use a stable version of Sofa, the behavior of the simulation will be used as reference to monitor the evolution of your Sofa.
    • Launch './runVerification.sh -f myfile.ini' -r  :
      • -f myfile.ini means use the set of files myfile.ini to create reference files
      • -r means reseting the reference files
    • in $SOFA/applications/projects/sofaVerification/simulation should appear gun-zipped files with name like: chainHybrid.scn_0_default2_mstate.txt.gz. They contain the Position and velocity of all the MechanicalStates present in the scene, even the mapped one, in order to test the Mapping components: You are ready to do some verifications!
  4. Launch now ./runVerification.sh -f myfile.ini
    • for each scene of the set myfile.ini, we do the simulation, and at each time step, we compare the positions and velocities stored in the reference files, to the current positions and velocities:
    • as output you should get something like: | Error: 0 | Time: 43.9 | File: Demos/chainHybrid.scn.
      • The quadratic error averaged on the number of particles simulated and number of Mechanical States, the time spent to run the simulation+comparison and the name of the scene tested.
    • if you get something like: | SegFault File: Demos/chainHybrid.scn, it means that a crash occured during the simulation.

DashBoard

Currently sofaVerification is used in our dashboard with linux gcc-4.3. The log shows the output of sofaVerification running with our set of tests.

TODO

  • Erik Pernod has adapted sofaVerification to test topological modifications: [1].
    • We could add a parameter in the .ini file to specify if the test is related to Topology
    • We could run one sofaVerification on the MechanicalStates, and another to test the Topology changes.
  • François Jourdes made a first attempt to get a better visualization of the results: [2]
  • Automatize the addition of new scenes to be tested:
    1. For each commit we run a short list of test (using a small .ini file), this way, we have a quick look to the effect of the last commit on Sofa Behavior
    2. A Script could find all the .scn files inside a given directlory, $SOFA/examples/Components/, and if we can't find reference files for a given scene, we initialize it with the option -r of sofaVerification