mailRe: unit tests vs... the current test_suite


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on October 30, 2006 - 17:02:
Oh, for files such 'specific_fns/model_free.py' which is ~5600 lines
long, it might be better to have multiple unit files corresponding to
the single file.

Edward



On 10/30/06, Gary S. Thompson <garyt@xxxxxxxxxxxxxxx> wrote:
Andrew Perry wrote:

> Hopefully not too off topic, but this little article really hammered
> home how useful unit tests could be for relax.
>
> http://wwmm.ch.cam.ac.uk/blogs/murrayrust/?p=142
>
> I noticed there has been a bit of discussion, but what is the current
> state/plans for unit tests in relax ?
>
> I think the standard python unittest framework would be a bit cleaner
> than the style of the current test_suite ... but thats coming from
> someone who hasn't attempted to write any tests under the existing
> relax test_suite yet.
>
> Despite the initial work involved, a robust set of unittests would
> probably prevent breakage in unexpected places in the future, and
> provide extra confidence that the results calculated from relax are
> very reliable.
>
> Andrew
>
>------------------------------------------------------------------------
>
>_______________________________________________
>relax (http://nmr-relax.com)
>
>This is the relax-devel mailing list
>relax-devel@xxxxxxx
>
>To unsubscribe from this list, get a password
>reminder, or change your subscription options,
>visit the list information page at
>https://mail.gna.org/listinfo/relax-devel
>
>

Hi Andrew
    Unit tests have been on my radar as well as I have used them under
java. As ususal having done things the wrong way round I am now
implementing unit tests for the ieee float functions. Here is my suggestion:

0. use unittest, it is a tried and tested methodology
1. if you have a file fred.py it should be accompanied by a unit test
files test_fred.py with the correct main function
2. if you have test data to go with fred.py it should be in  a directory
test_data_fred
3.  modify the relax test suite to scan the source directories for files
with the correct names and apply the tests...

as a general note you ought to write the unit tests first  ;-) before
coding if you want to stick to the 'true philosophy' of this methodology

so the idea is
1. suggest feature
2. define relevant unit tests
3. code unit tests
4. code feature
5. check / correct / add more unit tests as needed

regards
gary
--
-------------------------------------------------------------------
Dr Gary Thompson
Astbury Centre for Structural Molecular Biology,
University of Leeds, Astbury Building,
Leeds, LS2 9JT, West-Yorkshire, UK Tel. +44-113-3433024
email: garyt@xxxxxxxxxxxxxxx Fax +44-113-2331407
-------------------------------------------------------------------


_______________________________________________ relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel




Related Messages


Powered by MHonArc, Updated Tue Oct 31 12:02:48 2006