web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unit Test Tool

(0) ShareShare
ReportReport
Posted on by 700

I would like to hear experiences on practical usage of the Unit Test Tool in AX4 and AX2009.

We're considering using it for AX2009 but are worried about

1.the cost-benefit of doing it.

2.especially how much resources it requires to maintain the data required for the testing, and

3. how difficult it is to create Unit Tests when modifying functionality in standard classes.

 

TIA

 

Kind regards,
Morten Jes Lehrmann

Technical Architect

Danske Bank

*This post is locked for comments

I have the same question (0)
  • Kaspar Bomholtz Profile Picture
    100 on at

    Hi Morten

    I think Unit Test of AX is very difficult, because it is hard to isolate the area to test. You will properly be looking at performing Integration Test instead. Here you test different flows instead of testing that a specific method on a class performs as expected.

    If the lifetime of the application is long and will include a significant amount of maintenance, automated tests will in general make it cheaper to maintain.

    My experience with Unit test is that they can easily increase development time with 50-100%, if you want good coverage or are using Test Driven Development, but you can properly implement Integration Test with 20% increase.

    Have you thought about using the Unit Testing functionality of Visual Studio? In the new Visual Studio 2010 you will even be able to create User Interface testing easily.

    Regards

    Kaspar Bomholtz, ProISV

  • Morten Jes Lehrmann Profile Picture
    700 on at
    Hi Kaspar, Thanks a lot for your answer. I'm not quite sure what you mean by Integration tests - but it's nothing you can automate, is it? We're doing a lot of testing besides the planned automatic one that's why I ask particularly for the automatic testing.  We're not planning on doing automatic user interface testing - we do not expect it to be word the cost. Then we can’t use Visual Studio for testing X++ code, can we? Kind regards,Morten Jes Lehrmann 

     

  • Kaspar Bomholtz Profile Picture
    100 on at

    Hi Morten

    In Unit Test you try to test very small parts of a component as isolated as possible. You will often use mocking or other isolation technologies to archive that.

    With Integration Test you will more often test a bigger part of a workflow involving several components. This can like Unit Test be automated.

    Since there is not really any possibility to use isolation technologies in AX, you can only really execute Integration Tests.

    You can use the Business Connector to access your Dynamics AX logic and thereby create automated tests for AX in Visual Studio. I believe the support for automated tests are better in Visual Studio. It is not the standard way of doing it, but could be interesting. It's just at thought.

    Best Regards
    Kaspar Bomholtz, ProISV

  • Johan Veldhuizen Profile Picture
    on at

    Hi,

    To share some experience with you about unit testing. We spent a lot of time on the unit tests. We as an ISV have to cover a certain percentage of our code by unit tests. As Kaspar suggested there are two types which can be applied.

    1. Unit test
    2. Integration test

    We did a lot of investment on the Unit test framework and created our own framework on top of it to add extra functionality. E.g. we added some functionality to add isolation for a test. Class, class with TTS, Feature level, method isolation, table isolation etc. It's a small addition on top of the standard.

    Based on my experience the unit tests are helping us on upgrades and when code is changed, it will find API issues. But to find more "functional" bugs we are investing in integration tests.

    Ít is really time consuming to develop integration tests. Therefore we started another investment for this. What we try to achieve with this is recorded tests. We extended the task recorder to replay steps recorded by the task recorder. So you can record the opening of forms, adding or changing data, checking results to see if it's ok.

    Another thing is that this should be automated on product builds. This automation will execute the unit tests and recorded tests for a product or application (with more products in it).

    Maybe you want to do everything yourself, then you can use this suggestion for integrated tests. If you don't want to spent time on the development of this, you can ask me for more information.

    Kind regards,

    Johan van Veldhuizen (To-Increase)

    2009 Microsoft Dynamics Outstanding ISV of the Year, Inner Circle & President's Club Member

  • Morten Jes Lehrmann Profile Picture
    700 on at

    Thanks a lot for all answers. They are very helpful.

     Our project requires us to use standard solutions to a very high degree, so - although the solutions you provide seems viable - I do not believe I can have it accepted within the project.

     I will, however, see to that management should know that these possibilities exist.

    Kind regards,

    Morten Jes Lehrmann

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans