Refactoring is not only useful for source code of implementations, but as well for test specifications. The open source TRex tool automates the application of refactorings and the detection of refactoring opportunities for test suites that are specified using the standardised Testing and Test Control Notation (TTCN-3). Depending on the refactoring, the behaviour preserving transformations may include syntax tree transformations and direct modification of the source code; for suggesting refactorings, metrics are calculated and code smell patterns are detected.