Generate Test
Definition
This document describes how to make MTA generate a Microflow test, as opposed to creating one manually.
Generate Test using an AI assistant
Prerequisites
If you want to generate a Test using an AI assistant, you need to first choose what kind of test you want.
- Exploratory Testing: executing an in-memory Test Case directly on the MTA Plugin without storing the test design and results in MTA, or
- AI assisted Test Generation: creating a persisted Test Case inside an existing Test Configuration in MTA and executing it.
For option 1, read Setup Exploratory Testing.
For option 2, read Setup MTA MCP Server.
Choose AI assistant
Next, you need to choose if you want to use Mendix Maia or a standalone AI assistant like Cursor, Claude Code, GitHub Copilot, Cline, or Antigravity / Gemini.
Maia
If you are using Maia, make sure to use the latest Mendix 11 (or higher) LTS version, and check that the prerequisites are met. Open a new Chat window and optionally select the Microflow that you want to create a test for.
- For Exploratory testing, the prompt can be
Using the Menditect Agentic Test Skills module, execute an in-memory exploratory test via the MTA_plugin MCP Server for the selected microflow on my running app. Verify boundary conditions and check return values. - For AI assisted Test Generation, specify for example that you want to
Create a new Test Case inside MTA with Datavariation that tests the selected microflow and that covers all boundary values and asserts return values
Other
For Exploratory testing in other AI assistants, the prompts can be similar, but you need to specify the microflow name (preferably fully qualified).
Generate Test in MTA
This feature enables you to generate a test just like when inside a test suite, but for multiple microflows at once.
You can choose to generate based on random data, or to use from existing data from a database.
Steps:
- Navigate to "Microflows" after opening a Test Configuration.
- Select the microflow(s) to generate a Test Case for.
- Choose to either generate a Test Case with random data, or from database.
- When choosing from database, select the application instance.
- Optionally open and configure (one of) the test case(s) from here.
A few notes:
- Teststeps will be generated to fill any Object or List parameters of the microflow. Parameters can be filled using values from a database. Therefore it can be needed to select a running Application instance.
- Only when choosing from database, MTA will generate "Create object" teststeps for associations as well.
- If the object is nonpersistable, or if the database does not contain any objects of the necessary entity, MTA will use random values for the Object's attributes.
- Primitive microflow parameters will always be filled with random values.
Feedback?
Missing anything? Let us know!
Last updated 9 April 2024