We are now going to proceed with our AverageSpeed example and define equivalence classes for input factor duration.
Define a valid Equivalence Class
We are now going to proceed with our AverageSpeed example and define equivalence classes for input factor duration.
Change the name of an Equivalence Class
There are already two equivalence classes predefined per input factor. One valid equivalence class named “valid” and an invalid equivalence class named “invalid”. You probably want to change the name to something more meaningful.
You can change the name of an equivalence class in 3 different ways:
- Open the context menu next to the equivalence class and select “Rename”.
- Highlight the equivalence class row by clicking on it and press “F2”.
- Double click on the name on the equivalence class.
In our example we will change the name of the invalid equivalence class to “zero”

Add an Equivalence Class
Any equivalence class is either valid (highlighted in green) or invalid (highlighted in red).
You can add an equivalence class to an input factor in two different ways:
1. Open the context menu next to the input factor and select “Add Valid/Invalid Equivalence Class”.

2. Highlight the input factor row by clicking on it and press “Alt+C” for a valid equivalence class or “Alt+V” for an invalid equivalence class.
As you can see once you executed the command a new equivalence class has been added to the the input factor.
Change the type of an Equivalence Class
The type of an equivalence class can be changed from valid to invalid in two ways:
- Open the context menu of the equivalence class and select “Toggle Valid/Invalid”.
- Highlight the equivalence class row by clicking on it and press “Space”.

Move Equivalence Classes Up and Down
If you want to change the order of equivalence classes within your input factor you can move them up and down. Again you can do this in the following 2 ways:
- Open the context menu of the equivalence class and select “Move Up” or “Move Down”.
- Highlight the equivalence row by clicking on it and press “Alt+↑” or “Alt+↓”.
An equivalence class can only be moved within its input factor. So the command “Move Up” does not work on the first equivalence class under the input factor and the command “Move Down” does not work on the last equivalence class in an input factor. In addition, if a method is not static, the first input factor cannot be shifted.
Remove an Equivalence Class from the Test Model
Deleting an equivalence class from an input factor can be done in the following 2 ways:
- Open the context menu of the equivalence class and select “Remove”.
- Highlight the equivalence row by clicking on it and press “Del”.
If you delete an equivalence class whose representative was already selected in one or more test cases be aware that after the removal no representative for those test cases are chosen and you need to reselect another one again.