Beginner Tutorial Testing Python Automated Tests Profiling Debugging

MeVisLab Tutorial Chapter VI

Testing, Profiling and Debugging in MeVisLab

The MeVisLab Integrated Development Environment (IDE) provides tools to write automated tests in Python, profile your network performance and to debug your Python code. All of these funtionalities will be addressed in this chapter.

Testing

The MeVisLab TestCenter is the starting point of your tests. Select [ File → Run TestCaseManager ] to open the user interface of the TestCaseManager.

MeVisLab TestCaseManager

MeVisLab TestCaseManager

Test Selection

The Test Selection allows you to define a selection of test cases to be executed. The list can be configured by defining a filter, manually selecting the packages (see Example 2.1: Package Creation) to be scanned for test cases. All test cases found in the selected packages are shown.

On the right side of the Test Selection tab, you can see a list of functions in the test case. Each list entry is related to a Python function. You can select the functions to be executed. If your test case contains a network, you can open the *.mlab file or edit the Python file in MATE.

Test Reports

The results of your tests are shown as a report after execution.

Test Creation

You can create your own test cases here. A package is necessary to store your network and Python file.

Configuration

Here you can configure details of your tests and reports. The filepath to the directory of your MeVisLab installation is configured automatically.

Profiling

Profiling allows you to get detailed information on the behavior of your modules and networks. You can add the profiling view via [ View → Views → Profiling ]. The Profiling will be displayed in the Views area of the MeVisLab IDE.

MeVisLab Profiling

MeVisLab Profiling

With enabled profiling, your currently opened network will be inspected and the CPU and memory usage and many more details of each module and function are logged.

Debugging

Debugging can be enabled whenever the integrated text editor MATE is opened. Having a Python file opened, you can enable debugging via [ Debug → Enable Debugging ]. You can define break points in Python, add variables to your watchlist and walk through your break points just like in other editors and debuggers.

MeVisLab Debugging

MeVisLab Debugging