Documentation

From victor
Jump to: navigation, search

This page is dedicated to developers of new tools and people involved in the Victor maintenance. Victor standard users can skip this section and directly visit the Introduction, Tutorial and Features pages.

For an operative example about how to create you own project please visit the corresponding section in the tutorial.

Doxygen

The Doxygen documentation provides a comprehensive view of the Victor package. Is possible to navigate the class hierarchy, search for specific functions and their detailed description. For an overview of the implemented algorithms and methods visit the Introduction, Features and Reference pages. The current Doxygen documentation is available at:

Victor Doxygen Documentation


Unit test

Victor come along with a Unit Test suite providing an effective tool for testing core classes and the most important functions. These functions are commonly implemented in well engineered software, and are helpful for the maintenance of code. The typical case scenario is the introduction of a new feature in the Victor library: what happen to the overall project if we change a core class like “AminoAcids”? Is is still working as before? By just executing the unit tests, many Victor functions will be executed in parallel, and the results compared with the expected one. If no difference is observed, than the new AminoAcid feature will have no damage with respect to previous functionalities. Otherwise, a careful review of the code changes should be performed. The implemented tests have been organized by package (Align2, Biopool, Energy and Lobo). Each test has its own executable that will became available in bin/ after compiling:

  • TestAlign2
  • TestBiopool
  • TestEnergy
  • TestLobo

To obtain the test executable files you need the third party Cpp Unit library and to compile Victor with a special flag. In Ubuntu this library (Cpp Unit) is available in the libcppunit-dev package. To install the library do:

sudo apt-get install libcppunit-dev

After that, compile Victor itself and then compile the Victor tests, so:

make
make test=1

This will generate executables in the bin directory. When executed, i.e. bin/TestEnergy, the software will produce this output:

Creating Test Suites for Energy:
Running the unit tests.
.......
OK (7 tests)

In this case, all the 7 unit tests for the Energy library succeeded. No further output is shown. In situation of failure, the program will highlight the execution outcome, and shows the function that failed:

!!!FAILURES!!!
Test Results:
Run:  7   Failures: 1   Errors: 0
1) test: Test3 - energy propensity difference have to be positive. (F) line: 111 ./TestSolvationPotential.h
assertion failed
- Expression: increasingEnergy

A description of the failure is provided by defaults, together with the line of code involved. When someone is doing maintenance, there are many reasons that could lead to code failure, like introduction of new bugs or changes of the predictor's parameters. Unit tests therefore need to be updated accordingly, as they should reflect the current version of the library.