Testability Framework in Dynamics NAV


This afternoon (May 2nd 2017) we are hosting a webinar with NAV-Skills about the Testability Framework. Luc van Vugt will be the presenter and I will do an attempt to moderate.

The testability framework has been with us for a long time and was introduced in one of the last versions of the classic client. Even though it has been with us that long it never got widely adopted either internally by Microsoft and the partner channel.

Until now.

With NAV2017 Microsoft seems to have found a formula that works to ship their tests (18.000+) and partners are looking at how to implement them into their own solution.

This week there was some discussion on Twitter on the testabilty framework. Let’s look at some of them.

So there seems to be a general consensus on the value of the framework.

How to start

One of the questions I hope Luc will answer today is how to get started. What surprised me a little at start was that most of the MVPs seem to have started with the Microsoft tests while I started to write my own test not looking at what Microsoft did and it made me question my approach.

I think the answer can be found in what type of solution you have. Are you making changes to the existing NAV code or are you programming sollely on top of the application.

Recently I’ve created the ForNAV Navision part and I created a test codeunit to verify if the code works and this test codeunit saved my ass a few times already. But for this app I did not touch any of the standard code or influence the standard flow.

What I advise to partners, when they ask me, is to run the standard Microsoft test but not to make changes to it. Once you start changing the Microsoft test codeunits you have to maintain your changes.

I hope after the webinar this afternoon that this was good advise. 😉

If you write your own code as isolated units you can write your own tests against it which is why it is called unit testing. The standard Microsoft code is not written in a modern way but written tightly integrated like everyone did in the 1990ies with ERP applications. This is why the Microsoft test codeunits are sometimes hard to understand. The engineers who created the tests did a great job but their lives would have been easier when the standard code was more componetized.

The standard Microsoft tests should just work and are not to be touched. Write your own unit tests for your own units.

So I am looking forward to this afternoons webinar to see if it will change the way I think about the approach I have been following so far.

Advertisements
This entry was posted in Dynamics NAV. Bookmark the permalink.

8 Responses to Testability Framework in Dynamics NAV

  1. waldo1001 says:

    Just ask yourself: “is my code working with the Copy Doc functionality” or “Is my code working with the Sales-Post functionality”. While doing this – you could just have pressed the “play” button on the Test Suite and find out. 😉
    Any error, it’s you that caused it, and should be handled consciously .. .

    Liked by 1 person

    • Mark Brummel says:

      I completely agree. My question to you would be if you made any changes to the Microsoft test code?

      Like

      • waldo1001 says:

        Of course!
        It obviously depends on the case: “did I introduce a bug” (I’ll have to fix my code) or “did I break the test” (no bug, the test just expected different results – I’ll have to fix the test code).

        Liked by 1 person

      • Mark Brummel says:

        If you break the test you should seriously reconsider what you did to NAV. IMHO. Do you have any real-life examples of that?

        Like

  2. waldo1001 says:

    A simple confirm-box or message already breaks the test. Like a message after the sales-post that messages the posted doc no …

    Like

  3. Hello, I also create my test code and I was very interested in your webinar, how can I get acquainted with its program?

    Like

  4. Bastian says:

    is there anywhere a recording of this Webinar available?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s