The last two phases of an Alight modernization are devoted to obtaining a functional replica of the original application in a newer technology. The first of these two aims at preparing the source code for the new platform: the optimization phase.
During optimization Alight performs a set of formal modifications to the intermediate model representation of the code, enabling a correct generation in the targeted infrastructure. For example, before generating Java code the tool must ensure that there are no GOTO statements in the original source code. This process is also used to optimize the generation result in a concrete technology. For example, transforming a Visual Basic application to HTML5 + CSS implies modifications to be done to the user interface to make the target application responsive.
Optimization is tightly coupled to generation, and also to the characteristics of the selected target platform.