Refactoring
Refactoring is technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.
You may want to modify existing workflow steps to reflect changing business needs in due course. For example, you may want to:
- Rename a workflow step so that it reflects its business intent better.
- Add or remove parameters to workflows.
Refactoring, thus, is a powerful concept that helps you maintain your tests suites better.
Rephrase refactoring
Rephrase refactoring allows you to rename workflows and change the parameters that it accepts.
Consider the Workflow below:
Transfer
- transfer "1000" from account "1234" to "2345"
- destination account is credited
- Check destination account is credited to make it more readable.
- Check destination account "2345" is credited "1000" so that you can reuse the workflow step in other scenarios as it now accepts parameters.
Extract Concept
"Extract Concept" makes it possible to merge two or more related statements to create a more meaningful abstraction.
For example,
Login
- Open the application
- Login using username 'username' and password 'password'
Login
- Login as user 'username' using password 'password'