Waldo already wrote a blogpost on this : http://dynamicsuser.net/blogs/waldo/archive/2010/05/21/directions-emea-2010-testing-your-functionality.aspx. But don’t worry, I’ll give some more info.
*agenda
-test features in NAV2009SP1 -test development?
-application test toolset for NAV. Build by Microsoft on top of test features.
*NAV2009SP1 test features
-target functional test through C/AL
-ensure no UI interaction is required
-classic vs RTC (test both)
-enable test of error handling
*Now codeunits have a new property with these properties : Normal, Test, Test Runner
The Test-codeunit contains all tests to be done. The functions have a new property with these options: Normal, Test, UI Handler.
There is also a new global option : “Show C/AL testability”. I missed what it exactly does.
*demo time
-Claus created a blank Test-codeunit (the new codeunit-property), saved it and run it. a message came up saying something as “Run Succeeded”.
-Each function of type test (the new function-property) will be run by the codeunit WITHOUT writing some code to run the function.
-Functions of type Normal can be used as ‘normal’ functions to be used in the different test-functions. The will NOT be run automatically but need to be called by other functions.
-If there is some error, it will be displayed at the end of the test-codeunit.
-When testing something, it is possible we WANT an error (e.g. when inserting an existing record we should have an error to consider the test to succeed). How to do that:
ASSERTERROR BEGIN
Create some error; // By using ASSERTERROR, this will result as Success.
END;
-CONFIRM: If you have a confirm in your code, it will popup as normal. In the example, TRUE must go on without error and FALSE must generate an error. So we need to create a testcase (=a test-function) for BOTH options. How to do that? We need a function of the new function-type “Confirm Handler” (there are also other options). You need to create the function with 2 parameters (the message and the reply).
-with code coverage running while running your test-codeunit, you can check if 100% of the code is run in the object(s) you want to test.
-all the testfunctions are run in their own transaction, so you have a transaction per testfunction and not 1 big transaction
*codeunit of type testrunner
-is ‘almost’ like a normal codeunit and serves to run the test codeunits.
-the message at the end of each test codeunit will not appear, but will be intercepted by the testrunner codeunit.
-has 2 triggers : “OnBeforeTestRun” and “OnAfterTestRun” (here you get the results of the execution of a test-codeunit
-unexpected UI wil be reported as failure.
*establish test process
-when should test be developed?
–vertical:test suite for vertical solution
–customer:test suite of customer defined user acceptance test
-when should test be executed?
–vertical:test pass, release HF, upgrade, merge, …
–customer:test pass, release HF, upgrade, enhancements
-who is responsible for process?
developers and testers
*application test toolset
-At the time of the session, it wasn’t available yet. But it should be available shortly on partnersource. NAV team blog (http://blogs.msdn.com/b/nav/) will blog it when it comes out.-both on classic (code is run on client) and RTC (code is run on servicetier)
Filed under: C/AL, DirectionsEMEA2010, NAVISION, RTC | Make a Comment »