Skip to main content

How to do model-based testing

Model-based testing in Boozang lets you build a virtual representation of your application, and Boozang automatically generates tests from that model. It takes more upfront effort than recording, but once the model is in place you can significantly reduce test maintenance and scale automation coverage faster.

Step-by-step guide

1. Identify the application structure

Start by mapping out the key areas of your application — the pages, views, or screens that users interact with. Think of these as states in a state machine. For a project management app, this might be:

  • Dashboard
  • Project list
  • Project detail
  • Create project form
  • Settings

2. Create the AI module

In Boozang, create a dedicated module for your model. This is where you'll define the states and transitions that represent your application's behavior.

3. Define states and elements

For each state (page/view), identify the critical interactive elements:

  • Navigation elements — links and menus that move between states
  • Action elements — buttons that trigger operations (create, delete, edit)
  • Form elements — inputs that accept data
  • Validation elements — content that confirms an operation succeeded

Use Boozang's element picker to capture these elements. Give them clear, descriptive names — the model is only as good as its labels.

4. Define transitions

Transitions describe how users move between states. Each transition connects:

  • A source state (where the user starts)
  • An action (what the user does — click a button, submit a form)
  • A target state (where the user ends up)

For example: Project listClick "Create new project"Create project form

5. Add data dependencies

Forms and actions often require data. Capture these dependencies inside your model so that generated tests include realistic data. Boozang can bind test data to form fields automatically when the data keys match the form labels.

6. Generate and run tests

Once the model is complete, Boozang can generate test paths that traverse your application's states. These paths cover different combinations of transitions, giving you broad coverage without manually scripting each scenario.

7. Maintain the model

When your application changes, update the model rather than fixing individual tests. Change a state or transition in one place, and all generated tests reflect the update. This is where model-based testing pays off — maintenance effort scales with the model, not with the number of tests.