Test Automation & Quality Assurance
What Mendix Tools Are Available for Test Automation & Quality Assurance?
The Mendix Platform provides development teams with an extensive toolset and extension points to set up quality assurance via efficient test automation.
Mendix apps are built from standard components that are already pre-tested by Mendix. The internal consistency of a custom application model that a development team builds on top of these components is continuously checked by Mendix Studio Pro. The goal of this is to catch common modeling mistakes and issues early in development. For more details, see How Does Mendix Ensure the Quality of My Apps? below.
During development, Mendix Quality and Security Management (QSM) provides insight into the quality of the application models that you are building. Dashboards provide high-level details and allow you to drill down at the microflow level. For more details, see the section What Tools Are Available for Quality-Monitoring Mendix Apps? in Quality Monitoring.
With standard components, you can develop complex business logic as part of your applications. To test the business logic in your application, you can use a combination of unit tests and automated functional acceptance tests to create an end-to-end test suite for your apps. For more information, see How Can I Unit Test My Mendix Apps? and What Tools Does Mendix Offer for Functional Testing? below.
Developers can also use third-party test tools and services with Mendix. For details, see How Does Mendix Support Third-Party Testing Tools? below.
All the testing tools provided by Mendix integrate easily into CI/CD pipelines. Read more in the CI/CD chapter.
How Does Mendix Ensure the Quality of My Apps?
In Mendix, application functionality is defined at a higher level of abstraction than that of most other software development platforms and languages. This reduces the likelihood of defects and required testing efforts, because the Mendix Platform can perform many automated checks for you.
Mendix helps you in three main ways:
- Enforcing consistency within your application model
- Applying best practice validations during development
- Deploying your application data structures consistently
- Providing tested standard Mendix components
There are more ways in which the Mendix Platform reduces the likelihood of defects and costly mistakes, but the main ways Mendix makes your testing life easier should help you get a better understanding of what to test and what not to test.
These three main ways are explained below in detail.
Enforcing Consistency Within Your Application Model
Mendix Studio Pro continuously monitors whether the entirety of the application model is internally consistent. For example, the microflow activities and page elements you define need to be consistent with the domain model. Mendix Studio Pro will show an error and prevent the deployment of an application that does not pass the consistency checks.
For more information, see Model Consistency.
Applying Best Practice Validations During Development
Mendix Studio Pro provides a best practice bot that helps you improve your app by inspecting your app model against Mendix development best practice. The Maia Best Practices Recommender is an intelligent virtual co-developer that detects anti-patterns during the design and development, pinpoints you to these anti-patterns, suggests you how to resolve it, and in some cases can automatically fix these issues.
For more information, see Maia Best Practices Recommender.
Deploying Your Application Data Structures Consistently
When an application is started, the Mendix Platform ensures that the underlying database structure matches the domain model defined within your application model. Since consistency within your domain model is also guaranteed (see above), the database structure that is deployed is consistent with all the data usage of your application, including data retrievals, commits and deletions.
For example, a text box in your application not only has a corresponding string attribute in the data model, but also a corresponding string (-equivalent) field in the underlying SQL database.
The implication for testing is that it is not necessary to test whether data committed in a Mendix application actually ends up correctly in the underlying SQL database.
Providing Tested Standard Mendix Components
If you envision Mendix as a toolkit with which you build your own apps, you can rest assured that your tools will work as advertised. Our internal quality assurance team rigorously tests whether standard Mendix components work as intended and continue to do so across platform releases.
For example, a text box connected to a string attribute of a certain maximum length will never accept a value that exceeds this length.
The implication for testing is that you can be assured your testing is scoped towards your own app specific logic, not validating Mendix components. In this sense, you do not need to test the toolset, only the house you have chosen to build with it.
How Do I Apply Test Automation to My Apps
How Can I Unit-Test My Mendix Apps?
The Mendix Platform supports the implementation of unit tests for microflow logic. Application logic built in custom java actions can be tested using JUnit. These tests are built and run using free platform supported UnitTesting module available from the Mendix Marketplace. Tests are run either every time there is a new build of the application or at a scheduled time.
What Tools Does Mendix Offer for Functional Testing?
With the Mendix Platform, you can automate your functional tests for the user stories you are developing and reduce the overall cost of testing to less than 10% of your project budget. The Menditect Test Automation (MTA) offers a no-code, visual suite of automated test tools for embedding unit, component, process and API testing in your application lifecycle.
How Do I Load Test My Application?
Load testing of web applications can be done by using third party tools such as JMeter, BlazeMeter, LoadRunner, etc. With these tools, it is possible to record interactions with the web application and play back the interactions while simulating thousands of users and logging performance metrics.
How Do I Monitor the Performance of My Application?
Mendix provides basic performance monitoring within its platform. The Metrics page displays detailed graphs about your app and its environment. This page enables you to monitor your app’s performance and health. For instance, you can track the usage growth of your app or debug performance problems. Advanced performance testing involves capturing and logging performance metrics in relevant Microflows. These logs and metrics can be captured and visualized using third-party application performance monitoring tool such as DataDog, App Dynamics, DynaTrace, New Relic. Mendix provides out-of-the-box configuration to use Datadog, AppDynamics, Dynatrace, Splunk Cloud Platform, and New Relic to provide additional monitoring for your Mendix Apps running on Mendix Cloud.
How Does Mendix Support Third-Party Testing Tools?
The Mendix Platform provides an open and extensible toolset, which can be extended to support any number of third-party testing tools. Java code in your Mendix application can be tested using the JUnit framework. Mendix customers have also built testing suites using other third-party testing tools. It is possible to use standard test tools for UI testing, such as Selenium or Tosca. Because Mendix widgets have unique identifiers in the document object model (DOM), these tools can easily leverage these IDs to create readable and robust test scripts.
How Can I Link My User Stories to Model Revisions?
When committing changes to an application, developers can select the user stories that are covered in that specific revision. This information is then stored with the revision and held in Team Server for future use in audit processes. This helps in the functional testing process too.
Menditect Test Automation (MTA) provides direct link sharing capabilities on specific test suites, test cases and test runs. These links can be used to link to specific tests in user story details, for traceability.
For more information on the traceability of changes to application models against the requirements captured in user stories, see the section How Do I Cross-Reference User Stories and Application Change Commits? in Version Control and Multi-User Development.