Using automated unit tests

DAX2009 has built-in unit testing tools. I have used unit testing in many other environments, and it has always stood me in good stead, despite the effort involved (which pays back pretty quickly anyway). However, DAX is a slightly different kettle of fish, due to the unclear separation/implementation of the MVC pattern, and the fact that all unit tests need to run in a specifically engineered test company.

Has anybody actually every used these unit testing tools? If yes, I’d really appreciate a frank and honest appraisal of them. What’s good and what’s not so good? Where are the pitfalls to beware of? Are there any special efforts required to get started? And so on…

To follow the DRY principle, I’ll give you a link rather then writing it again. See my reaction under this blog post.

To add something to it, I do not use unit tests that depend on any data in database - they’re always truly independent. That limits what I’m able to test, but it allows me not to depend on other people to prepare the data. I’ve pretty bad code coverage, but I try to cover the most critical and complex algorithms.

Unfortunately I haven’t seen any AX team so far actively using unit testing (despite of that some claimed so), therefore I’m used to write unit tests only if they simplify my development and I don’t expect anybody to maintain them.

If I didn’t discourage you (I hope not), my advice is - use unit testing, of course, but don’t care to much about coverage. If something is worth to test, extract it from forms or other objects to classes designed with testing in mind.