I'm facing some challenges with unittesting. Our project involves numerous complex microflows, resulting in a substantial number of unittesting test cases. The issue goes beyond huge app volume; updates to one microflow can heavily impact others.
I came across a blog post suggesting that we don't need to test 'all' the microflows. I'm curious about how this approach ensures system integrity and accuracy.
Could you kindly share your approach to unittesting in your projects? Any advice for tackling unit tests in a large-scale project would be greatly appreciated.
Unit testing can be a daunting task, man. Especially when you have large complex microflows. And I don’t know if you were looking for an answer from a dev’s perspective, but that’s what I have to give. Some of the best advice I’ve received that has helped me improve as a developer and helps with approaching unit tests is:
As far as your question goes about not testing ‘all’ of the microflows, there are some microflows that are simple and straight forward enough they may not require regular execution of unit tests. Some of these flows may be things like validation microflows or microflows meant to fetch a set of data. You are asserting some things with these microflows, like the entity you’re validating hasn’t had required fields added to it, or the data required has been loaded into the system. By testing these once to ensure they’re performing the action they’re expected to, but not necessarily going through the full process of writing a complete unit test, you can save yourself time and allow yourself to focus on more complex functionality.
I hope these bits of advice help. For reference, here is the unit test module I tend to use for development tests: https://marketplace.mendix.com/link/component/390
I hope some part of this helps and wish you all the best,