GAPVelocity.ai
Having a tool like the VB6 AI Migrator, a compiling VB6 code and a source environment set is not all that is needed to ensure success in a migration project from VB6 code to .NET. This entry will describe a list of thing that SHOULD NOT be done during the project.
The green-code is the direct output generated by the VB6 AI Migrator tool after converting VB6 code to .NET without any manual change.
The quality of this code and the way specific patterns or components are migrated rely on the configuration of the source environment, the completeness of the source code and the Upgrade Options (settings) indicated on the VB6 AI Migrator.
If the code to be migrated consists of different VB6 projects, then, configure a single Upgrade Solution that include all projects required to be migrated. In this way you'll make sure to select the same Upgrade Options for the entire code.
Avoid performing different migrations for different portions of the source code.
NOTE: If you still need to do that, make sure the same Upgrade Options are used in every migration.
Important: The green code should be consistent. If you fail to have a consistent green code this will increase the effort needed to stabilize the code which implied more costs (more time and more money).
Avoid making more changes to the application before getting the converted code to functional equivalence (FE).
Making changes before FE introduces risk and reduces the changes of success.
Once your converted application has reached functional equivalence it will be a better time to start thinking about major changes.
If there is still a need to introduce some changes or re-architecture then:
In most of the migrated projects manual effort is needed to get the code to functional equivalence. Make sure to follow some rules before modifying the code:
The above questions require the person to introduce changes to have great abstraction capabilities.
When the above rules are not accomplished, different errors can be committed to the code. Avoid them:
x = <recordset>(EnumType.enumMember)Note: EnumType.EnumMember is an enumGreen Code C#x= <recordsethelper>[EnumType.EnumMember];The <recordsethelper> indexer property can be either a column-index or a column-name, so casting is needed in the above case. Given EnumType.EnumMember is an enum value, then the casting to int is needed.Wrong fixx= <recordsethelper>[EnumType.EnumMember.ToString()];Correct fixx= <recordsethelper>[Convert.ToInt32(EnumType.EnumMember)];x= <recordsethelper>[(int)EnumType.EnumMember];if (Convert.ToString(iteration_row["Name"]) != "" &&
!Convert.IsDBNull(iteration_row["Name"])) if (Convert.ToString(iteration_row["Name"]) != "" &&
!DBNull.Value.Equals(iteration_row["Name"]))
The former is generated by the VB6 AI Migrator and the latter is a manual modification of that line: An irrelevant change that only increases the number of manual changes and does not provide any gain to the code.
For instance, the migrated code has the following if-condition:
if (!rs.EOF)
and a manual change modifies the condition to:
if (rs.EOF)
Before starting a migration project, read and understand the GAPVelocity AI migration methodology is a key part of the project. Make sure to follow the suggested steps and avoid start making manual changes in your migrated code without understanding how and why the .NET code was generated.