Array
(
)

Shift left testing Mendix: how fast can you go?

Thursday December 22, 2022
Markus Travaille, Rolf Bolt

In earlier blogs we wrote about single microflow testing and process testing of Mendix apps. We also provided some insight on how to speed up app delivery in your organization.

In this blog we provide more insight in how the “shift left testing approach” can help you keep up high quality in combination with high delivery speed.

What is shift left testing

Below there are two definitions of shift left testing that are similar, but also emphasize different aspects of  shift left testing,

Shift left testing:

  • “Moves testing to the beginning of the development cycle. Testers are participating in crucial program stages while implementing this methodology. Shifting left method seeks to identify problems and minimize risks as early as possible by testing early and repeatedly” (https://research.aimultiple.com/shift-left-testing/)

shift left testing

  • “Calls for the testers to ‘Get Involved Early’, as early as possible and engage in the discussion and collaborate on ideas, requirements at every stage where the outcome of the stage has a bearing on the value of the final deliverable and also help the project to identify the risks and mitigate it in advance” (https://www.softwaretestinghelp.com/shift-left-testing-approach/)

Shift left testing Mendix is about changing your Mendix development process; moving test activities “to the left”. It is also about collaboration between testers and developers.

Mendix and Menditect

At its core “shift left testing” is, just like agile development and DevOps, about behavioral change. Changing the behavior of people is not easy. However, if the change process is supported by the right tools it can support this change process and make it easier.

Mendix-Menditect testing

Mendix provides the tools for a faster development process by bringing design and coding together. Menditect adds test automation to the Mendix platform and enables testers and developers to collaborate in one tool.

Benefits of shift left testing

Shift left testing:

  • Allows the team to detect  errors early. This saves (higher) repair cost later.
  • Improves code quality at marginal costs. It is relatively easy to improve code for testability when it is written, but it can be hard to adapt it later
  • Makes the creation of the right test data easier, because the developer and tester are aware of the data that is needed to test edge and happy flow cases
  • Makes writing tests easier because all the domain knowledge that is built up during the development of a feature is still present in the team
  • Good test cases makes code easier to understand and easier to transfer to others
  • Enforces a quality culture in the development process and allows testers to create value, instead of being perceived as a bottleneck to the release.

How to organize shift left testing

Shift left testing stimulates developers and testers to interact frequently and early in the development process. How could this work in a Mendix team? Below we describe three types of testing activities where developers and testers can work together during the development process.

Testing of single microflows (units):

  • In most cases the developer of a microflow builds the unit tests to test the microflow. Traditionally testers are not much involved in writing unit tests. However, in Mendix not all microflows are equally important and not all microflows behave as units. Therefore testers can play an important role in the risk assessment of microflows. Furthermore, if a microflow is too complex to test it with full coverage (unit testing is not possible), a test strategy is helpful to optimize the test cases for this microflow.
  • Testing complex single microflows is a topic where testers and developers could work together, provided that the tester is willing to understand the Mendix models at the microflow level.
  • Ideally, a single microflow test case is set up before or immediately after the microflow is being built. This ensures that the domain knowledge of the developer is optimally used to write the (unit) tests.

 

Test Data generation & maintenance:

  • The setup and maintenance of test data is a joint effort between testers and developers. Typically a tester maintains test data for shared test and acceptance environments and the developer takes care of his own local database(s). However, it is beneficial to involve developers in setting up the test data, because they know what data is needed to fully test the logic of the app they are building.
  • Generating test data with automated test scripts allows you to run tests on any Mendix environment. This saves time setting up the environment and makes it possible for each developer to use the test data, without the need for backing up and restoring databases.
  • Building up test data with automated scripts can be started as soon as the domain model is ready. The advantage of creating test data with scripts is that migrations can be executed by changing the scripts instead of by migrating the data in the database. Setting up test data with scripts can also support exploratory (manual) testing. The manual test is easier, faster and more reliable because the starting point is well defined.

Testing processes:

  • For testing of end-to-end processes it is necessary to define the right test scripts with the right datasets. This is typically done by testers. However, the automation of these scripts for Mendix apps can be done both by testers and developers.
  • Furthermore, developers can play an active role in determining the risks of the application, thereby helping the tester to design the most valuable test scripts.
  • Setting up automated process tests only makes sense after the process has been accepted by the business. A good starting point for an automated testing script is the acceptance test script.

Shift left testing technology

As described above, shift left testing is a joint effort between testers and developers and should be supported by test tool(s) that allow you to:

  • Test at multiple levels (single microflow, API, process) so that you can test all new types of functionality
  • Automate tests right after development, preferably executed on local developer or virtual test environments
  • Execute tests on demand or as part of scheduled tests in a CiCd pipeline.
  • Support collaboration between testers and developers with a joint test repository
  • Use a tool that fit the expertise of the Mendix team
  • Generate and maintain test data for the entire domain model, preferably without the need for database scripts and tools
  • Integrate with (existing) CiCd tools so that tests can be executed automatically (upon commit, nightly on the latest build,….)

MTA 2.0 is coming soon

With the upcoming release of MTA 2.0 in january, Menditect will make another step in supporting shift left testing of Mendix apps. It will provide the ability to test locally and on virtual machines and makes it easier for testers and developers to collaborate. Please follow our announcements on our website and LinkedIn for the latest information.

Markus Travaille

Contact the author

Enter your contact details

Menu