Project without NameMapping
Hey,
We write a project for an application written in Delphi which is a monolith. The application has been developed for over 20 years and its size is huge.
In the project we are using NameMapping which already at the beginning of the work is causing me a lot of problems and I have concerns about the size of the NameMapping file in the future.
My questions:
1) If the NameMapping file grows to a large size, is it a performance problem? By "large size" I mean about 60% coverage of our application. We have over a thousand menu items available and if I map these formats to NameMapping then won't my project work very slowly?
2) Why use NameMapping? Example:
a) without NameMapping
functionUnit1() {\pos(192,210)}functionUnit1()
var Edit = Sys.Process("pulse").VCLObject("LogOnForm").VCLObject("GroupBox").VCLObject("UsernameEdit");
Edit.Keys("YYYYYYYYY");
}
b) with NameMapping
functionUnit1() {\pos(192,210)}functionUnit1()
var Edit = Aliases.impuls.wndLogOnForm.Panel.Edit;
Edit.Keys("YYYYYYYYY");
}
Does NameMapping have any greater use than just storing the names of mapped objects? Because without NameMapping you can easily create your own variables with objects and the code becomes very readable.
3) What do you think about writing a project for such a large application without NameMapping?
4) How do you store NameMapping in the repository? SVN, GIT working in a few people with such a dynamic file is not possible in my opinion.
5) Referring to point 4 I made an attempt to divide one Project into smaller ones. I cut the project for fear that when I create one big project with a huge NameMapping file, the performance of working with this file for TestComplete will be very poor.
Example:
1) Project A -> NameMapping A
2) Project B -> NameMapping B
I find that I cannot use NameMapping A in project B. You have to connect NameMapping files and this again leads to the problem of the big NameMapping file.
Smaller projects must use elements from other projects because this is a test scenario requirement, for example: the production process module requires an index from the warehouse and the production is Project A and the warehouse is Project B.
I am currently planning to work with only one large project without NameMapping. What do you think?
Hi,
To add to what was said by Lino:
> SVN, GIT working in a few people
Only script unit files can be merged with the reasonable risk level. Though even this is not recommended. All other project files must not be merged by any means. Thus one of the most important tasks for you will be to split test code between different script units and assign tasks to people in a way that minimizes concurrent changes. Merging is a price that is paid for distributed development and must be avoided as much as possible.
> Why use NameMapping?
Strictly speaking, you should use not NameMapping, but Aliases. NameMapping is just a translation table between the physical objects layout of your tested application and logical organization of same objects convenient for your test code.
> Example:
> a) without NameMapping
> var Edit = Sys.Process("pulse").VCLObject("LogOnForm").VCLObject("GroupBox").VCLObject("UsernameEdit");
> b) with NameMapping
> var Edit = Aliases.impuls.wndLogOnForm.Panel.Edit;More correct example would be:
For version A of tested application:
a) without NameMapping
var Edit = Sys.Process("pulse").VCLObject("LogOnForm").VCLObject("GroupBox").VCLObject("UsernameEdit");
b) Your test code with Aliases:
var Edit = Aliases.impuls.wndLogOnForm.UserName; // intermediate panel was excluded as it does not matter for test codeNow for version B of tested application:
a) without NameMapping
var Edit = Sys.Process("pulse").VCLObject("LogOnForm").VCLObject("LoginUsingADGroupBox").VCLObject("GroupBox").VCLObject("LoginCredentials").DevExpressObject("UserLogin");
b) with Aliases:
var Edit = Aliases.impuls.wndLogOnForm.UserName; // <== Aliased name remained not changed because only NameMapping translation table had to be adjusted for the new objects structure.From the above example it should be obvious that with Aliases (and proper configurations of NameMapping)test code can remain the same for different versions of tested application.
> If the NameMapping file grows to a large size, is it a performance problem?
Yes it is. Thus not everything must be mapped. Best practice is to create a 'sceleton' map of your tested application and use created mapped objects as anchors for dynamic objects search via .FindXXX() methods.