As you probably know, since NAV 2009, there is some kind of framework built in the C/SIDE environment that can deal with application testing. Usually referred to as “Testing Framework” or “Test codeunits” or “Test Toolset” or “probably-some-kind-of-other-description-I-don’t-think-of-at-this-moment-but-deals-with-testing-the-functionality-of-your-(customized)-NAV-solution”.
As we (iFacto) are rebuilding our internal solution for NAV2013, I have to include the Test Toolset of NAV2013 as well .. so why not just write a small blog post of how I did it.. .
Step 1: Download the Test Toolkit
You can download the “Application Test Toolset for Microsoft Dynamics NAV 2013” from partnersource. I know I know .. but don’t panic! After I figured out that it was called “toolset” and not “toolkit” (by reading my own blog :-/) .. I found it quite quickly on partnersource (use the “Search”, Luke!). To make it easier on you: You can find it here.
I must say, I’m writing this blog while I’m implementing the toolset .. and one thing is not yet clear to me though .. . The webpage mentions “This supplement is an updated version of the Microsoft Dynamics NAV 2009 Test Toolset“. What do they mean with “supplement” .. and upgraded from NAV2009 means there is no testing for (for example) Assembly and all other kinds of new functionality? – I hope I can find out!
Step 2: Unzip the files, close the SLT word document, and import the objects!
For Belgium, the current release hasn’t got a localized toolset .. so I went for the W1 version.. . I know I’m going to regret this, because the BE-version of NAV has got quite some changes .. . But anyway. I asked Microsoft when (if ever) we can expect the BE version…
The toolset contains quite an amount of objects (469). Luckily all new ones in the 130000-range. So all I had to do .. is importing the fob. When you look at the count of the objects, you see where it’s going:
- 10 tables
- 9 pages
- 7 xml ports
- 443 codeunits
And that’s understandable, isn’t it? The testing framework is based on the testing capabilities of a special type of codeunit: a test codeunit!
Step 3: Test the Test Toolset
As you can see .. There is no Menu changed or added .. so I expect starting the testing by searching a menu item in the Departments .. Is going to lead to nothing.
But there are only 9 pages, right? AND there is still the “Notes.txt” and the help files that comes with the package.
I went for the “Notes.txt”, which contains this info:
To run all tests:
- From C/SIDE launch the ‘Test Tool’ page (130021)
- From the ‘Test Tool’ page click ‘Get Test Codeunits’
- Select option ‘All Test Codeunits’
- From the ‘Test Tool’ page click ‘Run’
- Select option ‘All’
Seems like it’s a description to start running the tests.. Isn’t it? In fact, I read the file (and please, do so yourself) and there were interesting things you can do with the toolset. Some stuff:
- Page 130021 is definitely the page to start your tests
- You can run tests based on your modification: the tool will look at the modified flag for that. Beware of that!
- It contains a code coverage tool! :-). Sure .. You have to use a test codeunit for it .. But that can easily be managed right? At least I think so .. be sure to test this out! I know I will – and there might be following a blog in the future..
So that’s it?
That’s it .. . The default “Test Toolkit” is implemented .. and I believe (and hope) this is step 1 to start writing your own test codeunits for your own products. A MUST for every ISV. Just by looking and analyzing on how the codeunits were written, what they do and how they do it .. it’s fairly easy to base your own testing codeunits on .. and so extend the Test framework.
And what about NAV2013 functionality?
Well, that’s somewhat difficult to say. I’m not too functional to say whether “everything” (what is “everything”?) is going to be tested by the default toolset already. But a few basic tests tells me that there is indeed quite some NAV2013 stuff included. For example, when you filter on “7”:
- 134230 ERM – Dimensions 7.0 Test
- 137008 V7 Planning Options
- 137060 7.0 – Inventory
- 137061 7.0 – Purchases & Payables
- 137062 7.0 – Sales & Receivables
- 137064 7.0 – Warehouse Management
Or when searching for specific functionalities like “Cost Accounting” or “Assembly”, it does give some results. Like:
- 131340 Library – Cost Accounting
- 134392 ERM Cost Accounting Rep – Test
- 134810 ERM Cost Accounting Setup
- 134813 ERM Cost Acc. Allocations
- 137925 Test Assembly Reservation
So, let’s conclude (unofficially) that indeed the new NAV2013 functionality is included .. And that the sentence “this supplement is an updated version of the Microsoft Dynamics NAV 2009 Test Toolset” only reflects on the toolset itself (and not on the test codeunits).. .
Support by Microsoft
Well .. It is important to know that Microsoft is not going to support you in this.. . It states quite clearly in the Notes.txt-file that comes with the tool:
“This release is provided as-is, and may contain bugs. Microsoft does not, in anyway, support this release.
We recommend taking a SQL backup of the database before importing and running tests.”
If you want to read up on this (and I strongly recommend you to do so), here is a good place to start: http://msdn.microsoft.com/en-us/library/ee414224.aspx. By the way, I know also Luc Van Vugt is quite enthusiastic about the framework .. and has been blogging about it. You can find his posts about “Testing the application” here:
And of course .. I shouldn’t forget (I actually did ..) the blogpost of my colleague, who followed Plataan‘s Bootcamp about NAV 2013 and which contains quite some useful sidenotes!
I am indeed enthusiastic about the framework. Unfortunately I haven’t been in the position lately to really dive into the NAV 2013 Test Toolset, so I am glad you brought it up here and triggeired me that I really should be ding that very soon. 😉
Compared to NAV 2009 (SP1) the Test Toolset has been extended tremendously, not in the least due to local(ized) tests (see also Simone Esjings post on mibuso which I had replicated here http://dynamicsuser.net/blogs/vanvugt/archive/2012/11/06/application-test-toolset-for-microsoft-dynamics-nav-2013-available-now.aspx).
BTW: MS really is interested in all feedback from partners. See also Mostafa Balat’s post on mibuso: http://www.mibuso.com/forum/viewtopic.php?f=32&t=56935&p=274272#p274272.
Thanks for you comment, Luc. And for the extra links! 🙂
Am I the only one getting compile errors on the testtool objects when importing them into NAV 2013 R2 (W1) ?