Extract calculation of convergence rate in tests.py

* Separate function so that we can use it in parse.py
In parse add option to plot convergence rate