Unit testing: Lessons learned
Unit testing: Lessons learned by Mitchel Mol - Blue Green Solutions

Unit testing: Lessons learned

This is the fifth newsletter in a series about unit testing. See the links at the bottom of this newsletter for the previous iterations. This will be the last of this series. More will likely follow in the future, as there is still much to share about the topic! Now, let’s reflect on the lessons learned over the last decade that I have been implementing unit tests in Mendix applications.

Convincing your team is 60% of the work

Getting started with unit testing is a difficult task. Not only do you need to learn how to efficiently build your code to make it unit-testable. You also need to learn how to create unit test microflows. But by far, my biggest challenge has always been convincing my team that unit testing is an essential part of the development process. It pleases me to learn that there are a lot of Mendix developers out there who are just as interested in the topic as I am. Need some extra help to convince yourself and your team to jump on the unit testing train? Read my newsletters, the Eternal debate and How to get started? for tips to back up your case!

The right tool does the trick

Of course, building your own test microflows directly by calling the microflows you would like to test and pushing a bunch of buttons to run those tests works. But is it way more efficient than testing your app manually? Only barely! The unit testing module that Mendix provides is a great start. But even this lacks several futures to make the developers' lives easier. I have taken care of this by extending the unit testing module (and rewriting parts of it), as I showcased in my newsletter: Improvements to the module! If you want to enjoy the benefits, message me, and I will share the module.?

Unit testing is a team effort

In Mendix teams, we often pride ourselves on being multidisciplinary teams with T-shaped team members. However, in most teams, there are still boundaries based on each team member’s specialisation. You have developers, testers, and, of course, a product owner. Those roles must contribute to a successful project and unit testing implementation. Some commercial products even make it possible to work together on this from a user interface instead of in Studio Pro.

A great unit test implementation starts during the user story refinement or investigation of a bug. With proper scenarios set, you can define your unit tests early on in the process and reuse them throughout the initial development and indefinitely after regression testing.

Managers still love numbers

Of course, implementing unit tests costs time, but so does manual testing, or even worse, no testing and deploying bad-quality code. To help your manager understand the cost/benefit ratio, keep track of the unit test coverage, the number of issues found before going live, and the decrease in the problems found after going live. Especially if you start from an existing application, report these numbers frequently to your managers. This way, you can convince them better of your great work by spending that extra time on unit testing the application.

Rapid delivery rate of development disappears without test automation

You can only bring in so many people to do manual testing and keep up with the rapid development. You might attempt UI-based test automation with Selenium or other tools. But in the end, you will hit limitations and have to slow down development or decrease the quality delivered, hoping you didn’t miss a critical bug. By making unit testing part of your development process, you can maintain your speed for longer and keep up with the delivered quality, even though you might be slightly slower at the start of the curve.

So, in conclusion, I would like to say Go Make It and Go Test It!

Previous unit testing newsletters

And while you are at it, look at the meetup recording about unit testing from January 2024.

#mendixignite #mendix #unittesting #lowcode

Marlin den Boer

Co?rdinator / RTE - RAD Mendix - Gemeente Rotterdam

11 个月
Loai Abu Khil ????

Application Engineer @ Avertra Corp | Mendix Certified, Low-Code Developer

11 个月

Thank you, Mitchel! Your hard work on this is really appreciated. Strong unit testing makes a huge difference in catching issues early on, saving time and effort in the long run.

Nina Morsa

B2B Marketer with a ?? for tech | Head of Marketing @ Blue Green Solutions

11 个月

Interessant, Mitchel!

要查看或添加评论,请登录

Mitchel Mol ????的更多文章

  • Google Maps on Steroids - Part 2

    Google Maps on Steroids - Part 2

    This newsletter continues where I left off during my last edition. In that edition, I showed you all the features and…

    1 条评论
  • Blue Green Mendix Speeddating - Google maps on Steroids recording

    Blue Green Mendix Speeddating - Google maps on Steroids recording

    It took some work to ensure the video was okay enough (we had three recordings from presenting this 3 times). For…

  • Google Maps on Steroids - Part 1

    Google Maps on Steroids - Part 1

    Mapping functionality is something I have been implementing since I started developing web applications 18 years ago…

    5 条评论
  • Versioning with Git

    Versioning with Git

    Mendix 9 introduced Git versioning as an alternative to Subversion (SVN) versioning. Since then, the Git implementation…

    7 条评论
  • 2024 Highlights and Lowlights

    2024 Highlights and Lowlights

    It's the end of the year, so it's time to review the highlights and lowlights. 2024 was a rollercoaster ride for my…

    6 条评论
  • Feature Flash Advent Calendar Recap

    Feature Flash Advent Calendar Recap

    Welcome to the recap of the Mendix Ignite Feature Flash Advent Calendar 2024. For 24 days, I have featured the…

    4 条评论
  • Nanoflow VS Microflow when to use which and why?

    Nanoflow VS Microflow when to use which and why?

    Nanoflows versus Microflows: when to use which and why? Or perhaps even a combination of the two. Mendix…

    16 条评论
  • Capture The Flag Lessons Learned

    Capture The Flag Lessons Learned

    Capture the Flag (CTF) at Mendix Headquarters was awesome. The vibe, the challenges, the organisation, and the lessons…

    6 条评论
  • Passwordless login

    Passwordless login

    Passwords are a necessary evil. They protect your applications and are half of a puzzle that authenticates us to access…

    9 条评论
  • Mendix branching strategies

    Mendix branching strategies

    Branching and how to go about it is a frequently asked question in every Mendix project I have participated in. Mendix…

    12 条评论

社区洞察

其他会员也浏览了