Best practices | Modules | Update vs. delete

A Module is the technical representation of a part of your application in Tosca. And as your application changes, so do your Modules. For example, if you have new screen elements you want to test. Or if your code has changed, and some of your identifiers no longer work. This topic explains important considerations for deleting and updating Modules.

General rule

As a general rule, don't just delete a Module that you use in your TestCases and then create a new one. Once you delete the original Module, you lose all references to the Module in the linked TestCases, which breaks them. And you'll need to invest a lot of time and effort into recreating your TestCases with the new Module.

Alternatives to deleting

Here's what you can do instead of just deleting a Module and starting from scratch:

  • Rescan the Module to add more controls, to change identifiers, or to update identifiers after a property change in the code. This keeps the links between your Module and its connected TestCases intact. All you need to do is update your tests if you've added controls.

  • Use the Properties pane in Tosca to make small adjustments to individual ModuleAttributes. For example, to add a wildcard to the property value of an identifier. This keeps all links intact, and there's no need to rework your TestCases.

Even if your application changes so much that a Module becomes almost unusable, we recommend that you keep the original Module for a bit longer. Create a new Module, and then follow this process to replace the existing Module with the new one. This keeps the TestCase links intact, and you just need to modify your tests. That's still less work than recreating them entirely. Once you've updated your TestCases, you can delete the old Module.

What's next

If you haven't yet, check out our other best practices articles.