Book Image

.Automated Testing in Microsoft Dynamics 365 Business Central

By : Luc van Vugt
Book Image

.Automated Testing in Microsoft Dynamics 365 Business Central

By: Luc van Vugt

Overview of this book

Dynamics 365 Business Central is the new cloud-based SaaS ERP proposition from Microsoft. It’s not as simple as it used to be way back when it was called Navigator, Navision Financials, or Microsoft Business Solutions-Navision. Our development practices are becoming more formal, and with this, the call for test automation is pressing on us. This book will teach you to leverage testing tools available with Dynamics 365 Business Central to perform automated testing. We’ll begin with a quick introduction to automated testing, followed by an overview of test automation in Dynamics 365 Business Central. Then you’ll learn to design and build automated tests and we’ll go through some efficient methods to get from requirements to application and testing code. Lastly, you’ll learn to incorporate your own and Microsoft tests into your daily development practice. By the end of the book, you’ll be able to write your own automated tests for Dynamics 365 Business Central.
Table of Contents (17 chapters)
Free Chapter
1
Section 1: Automated Testing - A General Overview
3
Section 2: Automated Testing in Microsoft Dynamics 365 Business Central
6
Section 3: Designing and Building Automated Tests for Microsoft Dynamics 365 Business Central
11
Section 4: Integrating Automated Tests in Your Daily Development Practice

Introduction to Automated Testing

I did finally get an agreement on writing a book on application test automation—one I had wanted to write for years already, as automated testing doesn't appear to be a love at first sight topic for many. And, like testing in general, in many implementations, it tends to be subordinate to requirements specifications and application coding, be it a project or a product. And, hell, who really loves testing? It is not typically what the average developer gets enthusiastic about. When raising the question during many of my workshops on automated testing, it often even takes a while for functional consultants to raise their hand.

Inevitably, I did pose the question to myself: do I love testing? And I answered it with a yes. A big YES. This subsequently led to additional questions, such as: what makes me love testing? Did I always love testing? Why do I love it while the rest of the world seems not to? Questions with answers that makes me go around the world evangelizing test automation, stubbornly sharing my findings, and pushing Microsoft to improve their tests to make them better and reusable. And all because I reckon that it is fun—big fun!

Having been an app tester in the former Dynamics NAV Global Development Localization (GDL) team at Microsoft, I surely got exposed to the testing virus. You could say that I had to learn to do the testing job, as I was paid for it. But it also suited me well, with me apparently having this specific DNA kind of thing that makes testers what testers are. Having a pride in breaking the thing and, meanwhile, loving to prove, hopefully, its robustness. And, not in the least, daring to break it, running the risk that your developer will no longer like you.

One afternoon at Microsoft, my developer team member walked into our office and stopped next to my desk. Him being very tall and me sitting, I had to turn my head up to look at him.
"What's up?" I asked.
"Don't you like me anymore?" he responded.
Me: ?
Him: "Don't you like me anymore?"
Me: "Nope, still like you. Why?"
Him: "You rejected my code; don't you like me anymore?"
Me: "Dude, I still like you, but concerning your code, my tests show it somehow useless."

Testing is not rocket science. Nor is automated testing. It's just another learnable skill. From a developer's perspective, however, it requires a change of mindset to write code with a totally different purpose than you are used to. And we all know that change is often not the easiest thing to achieve. Because of this, it's not unusual for attendees at my workshops to get to a certain level of frustration.

Application testing is a mindset and it needs a big dose of discipline too—the discipline to do what needs to be done: to verify that the feature was built right; to verify that the feature under test meets the requirements—and the discipline when bugs are reported and fixed to execute the whole test run again, and again, with any new bug, to ensure that the verification is complete.

I tend to see myself as a disciplined professional. I have been quite a disciplined tester, with a high rate of bug reporting. But, did I always love testing? You know, in those days, all our tests were executed manually, and with each bug I found my discipline was challenged in some way. Imagine my mind running when executing the fifth test run after another bug fix. It's 4:00 PM and I am almost done. At breakfast, I promised my wife that I would be home on time for whatever reason. Let's pick a random one: our wedding anniversary. So, me being a disciplined tester, my promise to be home on time, 4:00 PM, and … I … hit … another … bug. Knowing that fixing it and re-running the tests will take at least a couple hours; how do you think my mind is running? Right: binary.

I had two options:

  • Reporting the bug would keep me at work and make my wife highly disappointed, to say the least
  • Not reporting the bug would get me home on time and save a lot of hassle at home

Had automated tests been in place, the choice would have been quite simple: the first option, resulting in no hassle at home and no hassle at work.

In this chapter, we will discuss the following topics:

  • Why automated testing?
  • When to use automated testing.
  • What is automated testing?
If you prefer to read the what first, you might first want to jump to What is automated testing?