SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
How to estimate the process of 64-bit
migration of C/C++ applications?
Author: Evgeniy Ryzhkov

Date: 21.09.2009


Abstract
The article is devoted to the issue of estimating complexity and cost of migration of applications to 64-
bit platforms. Such aspects as availability of various components of an application, libraries and
development tools are considered. An example of using PVS-Studio program tool for estimating
migration is given. Although the mentioned PVS-Studio product is oriented on C and C++ applications in
Windows system, Unix-developers (and developers working in other systems) will find the article useful
too.


Introduction
With the phrase "near at hand is the day when all the developers will have to release 64-bit versions of
their applications" I begin many articles since 2006, although now, when I am writing this article, 2009 is
coming to end. Life has shown that I was wrong. That day is not so close. So many companies have not
yet released 64-bit versions of their products. Partly it is due to the policy of Microsoft company that
makes money equally well at selling 32-bit versions of Windows and 64-bit ones. And partly it is because
far not all applications actually need the 64-bit versions.

But thanks to my experience of communicating with people responsible for decisions of developing
applications' 64-bit versions, I understood that the main constraint is very simple. Many people simply
do not know how to estimate time and value of the process of migrating an application to a 64-bit
architecture. So, this ignorance makes them postpone the process of porting code as far as possible.

In this article I am going to tell you about one of the methods to estimate this process before migration.
For it is possible to exactly tell how much time migration of a particular application takes only when this
migration is over.

The article is based on the experience of OOO "Program Verification Systems" company's workers, both
in porting various applications to 64-bit systems and using PVS-Studio code analyzer.


"Houston, Houston. Can we take off?"
This article is devoted to estimate of the migration process, but not the migration process itself. That's
why I would refer those who want to examine the issue in detail to the article "Seven steps of migrating
a program to a 64-bit system" [2]. Nevertheless, I will use some theses from that article here. Before we
estimate the peculiarities of migration, we must have clear answers to the following questions:

    1. Do we need to perform the very migration of code to 64-bit systems or is it enough just to make
       sure that a 32-bit application works on a 64-bit system?
    2. Does the development tool used in the project support generation of 64-bit code?
3. Are there 64-bit versions of all the components and libraries used in the project?

If you answer "yes" to all these questions you face the main question put in the title of the article.


"Well, how to estimate the process of 64-bit migration?"
So, you have some (or some tens of) MBs of source code ready for migration. There is no configuration
for building 64-bit code, and consequently no module compiled in 64-bit mode. But after reading the
article "20 issues of porting C++ code on the 64-bit platform" [4] you understand that the process of
searching all the hidden errors in the code will be difficult.

To understand how difficult the search of all the errors will be you can use static code analysis. There
are various code analyzers (comparison of code analyzers, [3]) that you may use when searching
problems in 64-bit code, but in this article I will stick to PVS-Studio code analyzer for it is this tool our
company develops.

So, in PVS-Studio 3.30, you have a new ability of detecting problems relating to 64-bit code even in 32-
bit projects. It is this ability that allows you to estimate complexity of migration BEFORE the step of
creating the 64-bit configuration of the project. Earlier, PVS-Studio analyzer allowed testing projects
only in the 64-bit configuration.

I would like to pay your attention to the mechanism of code testing in 32-bit mode. First of all, you
should understand that of course this testing cannot be considered full, and correction of even all the
detected problems cannot guarantee code's operability in 64-bit mode. For in the code of any serious
application there will be fragments like this:

#ifdef WIN64

...

#endif

Of course, when testing the code in 32-bit mode, a fragment like this will be skipped. Or, more exactly:
at the moment when there is no 64-bit configuration, there can be no fragment similar to this in the
code. And when it does appear, the analyzer will "forget" to test it.

Another important point is that depending on the project's configuration data types are naturally
different. That's why testing in 32-bit and 64-bit modes will nearly always give different results.

But how much will these results differ? Proceeding from the results of the experiments undertaken by
our company, we give you the following data. The lists of diagnostic warnings generated by PVS-Studio
code analyzer coincide 95-97% when testing projects both in 32-bit and 64-bit modes! This means that
not more than 5% of diagnostic warnings differ. These results have been received in this way: we took
the codes of real projects, tested them in 32-bit mode and saved the list of the problems detected. Then
we tested the codes of the same projects in 64-bit mode and saved the list of the problems detected.
After that we compared the two lists and estimated how many per cents of diagnostic warnings had
coincided. For the whole procedure was performed in automated mode, the number of the projects
tested was rather large (more than 20 projects, each several MBs in size). So, you can trust these results.
Of course you should not hurry to correct the detected potential errors in the 32-bit configuration - you
should wait for the 64-bit configuration. But you can estimate how much time it will take to look
through the code analyzer's warnings.

To get a time estimate I recommend that you do the following:

     1. Perform analysis of the 32-bit configuration of the project with the help of PVS-Studio.
     2. Ask a programmer who understands issues of 64-bit code to look through the warnings of the
        code analyzer for one day and decide whether this or that error is relevant to the project.
     3. The general number of the code analyzer's warnings is divided into the number of the warnings
        examined by the programmer during one day.
     4. The number you get is the number of man-hours necessary to migrate the code of the
        application to a 64-bit platform.

Of course there is a weak point in this algorithm of estimating the migration process - the programmer
who will look through the warnings during a day. That's why I recommend that you take it seriously
when choosing a person responsible for the estimate.

Here you are some recommendations on choosing such a programmer:

     1. He must be a programmer with experience of not less than three years and, if possible, be
        familiar with the particular project to be tested.
     2. He must be familiar with the issues of 64-bit code. The article "20 issues of porting C++ code on
        the 64-bit platform" [4] mentioned above is a good source of information on this topic.
     3. It is desirable that he understand the principles of operating static code analyzers. This is not an
        obligatory requirement but understanding of the code static analysis technology makes
        estimate of the migration process more adequate.

Following these recommendations will allow you to get an adequate estimate of value and time of 64-
bit migration of applications.


Conclusion
To better understand this article you should consider some points:

     1. No tool (including PVS-Studio) can give any final estimate. It is always a person who gives an
        estimate. Sometimes using tools, sometimes without them.
     2. PVS-Studio code analyzer is not intended for estimating the process of 64-bit migration; it does
        not give an estimate in hours (days, months). This is a tool detecting potential errors in 64-bit
        code. But proceeding from this information (when testing a 32-bit project) one can estimate
        man-hours needed for the project's port.
     3. The quality of estimate depends on a person.

I wish you successful estimate of 64-bit migration of code and hope that PVS-Studio tool will help you in
it.


References
1.       Code analyzer PVS-Studio. http://www.viva64.com/pvs-studio/ .
2.   Andrey Karpov. Seven Steps of Migrating a Program to a 64-bit System.
     http://www.viva64.com/art-1-2-850243650.html
3.   Andrey Karpov. Comparison of analyzers' diagnostic possibilities at checking 64-bit code.
     http://www.viva64.com/art-1-2-914146540.html
4.   Andrey Karpov, Evgeniy Ryzhkov. 20 issues of porting C++ code on the 64-bit platform.
     http://www.viva64.com/art-1-2-599168895.html

Más contenido relacionado

Más de Andrey Karpov

Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...
Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...
Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...Andrey Karpov
 
Best Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesBest Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesAndrey Karpov
 
Does static analysis need machine learning?
Does static analysis need machine learning?Does static analysis need machine learning?
Does static analysis need machine learning?Andrey Karpov
 
Typical errors in code on the example of C++, C#, and Java
Typical errors in code on the example of C++, C#, and JavaTypical errors in code on the example of C++, C#, and Java
Typical errors in code on the example of C++, C#, and JavaAndrey Karpov
 
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)Andrey Karpov
 
Game Engine Code Quality: Is Everything Really That Bad?
Game Engine Code Quality: Is Everything Really That Bad?Game Engine Code Quality: Is Everything Really That Bad?
Game Engine Code Quality: Is Everything Really That Bad?Andrey Karpov
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerAndrey Karpov
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareAndrey Karpov
 
Static Code Analysis for Projects, Built on Unreal Engine
Static Code Analysis for Projects, Built on Unreal EngineStatic Code Analysis for Projects, Built on Unreal Engine
Static Code Analysis for Projects, Built on Unreal EngineAndrey Karpov
 
Safety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
Safety on the Max: How to Write Reliable C/C++ Code for Embedded SystemsSafety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
Safety on the Max: How to Write Reliable C/C++ Code for Embedded SystemsAndrey Karpov
 
The Great and Mighty C++
The Great and Mighty C++The Great and Mighty C++
The Great and Mighty C++Andrey Karpov
 
Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?Andrey Karpov
 
Zero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youZero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youAndrey Karpov
 
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsAndrey Karpov
 
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...Andrey Karpov
 
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Andrey Karpov
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIAndrey Karpov
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsAndrey Karpov
 
Errors that static code analysis does not find because it is not used
Errors that static code analysis does not find because it is not usedErrors that static code analysis does not find because it is not used
Errors that static code analysis does not find because it is not usedAndrey Karpov
 
Machine Learning in Static Analysis of Program Source Code
Machine Learning in Static Analysis of Program Source CodeMachine Learning in Static Analysis of Program Source Code
Machine Learning in Static Analysis of Program Source CodeAndrey Karpov
 

Más de Andrey Karpov (20)

Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...
Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...
Make Your and Other Programmer’s Life Easier with Static Analysis (Unreal Eng...
 
Best Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesBest Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' Mistakes
 
Does static analysis need machine learning?
Does static analysis need machine learning?Does static analysis need machine learning?
Does static analysis need machine learning?
 
Typical errors in code on the example of C++, C#, and Java
Typical errors in code on the example of C++, C#, and JavaTypical errors in code on the example of C++, C#, and Java
Typical errors in code on the example of C++, C#, and Java
 
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)
How to Fix Hundreds of Bugs in Legacy Code and Not Die (Unreal Engine 4)
 
Game Engine Code Quality: Is Everything Really That Bad?
Game Engine Code Quality: Is Everything Really That Bad?Game Engine Code Quality: Is Everything Really That Bad?
Game Engine Code Quality: Is Everything Really That Bad?
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
 
Static Code Analysis for Projects, Built on Unreal Engine
Static Code Analysis for Projects, Built on Unreal EngineStatic Code Analysis for Projects, Built on Unreal Engine
Static Code Analysis for Projects, Built on Unreal Engine
 
Safety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
Safety on the Max: How to Write Reliable C/C++ Code for Embedded SystemsSafety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
Safety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
 
The Great and Mighty C++
The Great and Mighty C++The Great and Mighty C++
The Great and Mighty C++
 
Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?
 
Zero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youZero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for you
 
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
 
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...
PVS-Studio Static Analyzer as a Tool for Protection against Zero-Day Vulnerab...
 
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCI
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
 
Errors that static code analysis does not find because it is not used
Errors that static code analysis does not find because it is not usedErrors that static code analysis does not find because it is not used
Errors that static code analysis does not find because it is not used
 
Machine Learning in Static Analysis of Program Source Code
Machine Learning in Static Analysis of Program Source CodeMachine Learning in Static Analysis of Program Source Code
Machine Learning in Static Analysis of Program Source Code
 

Último

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

How to estimate the process of 64-bit migration of C/C++ applications?

  • 1. How to estimate the process of 64-bit migration of C/C++ applications? Author: Evgeniy Ryzhkov Date: 21.09.2009 Abstract The article is devoted to the issue of estimating complexity and cost of migration of applications to 64- bit platforms. Such aspects as availability of various components of an application, libraries and development tools are considered. An example of using PVS-Studio program tool for estimating migration is given. Although the mentioned PVS-Studio product is oriented on C and C++ applications in Windows system, Unix-developers (and developers working in other systems) will find the article useful too. Introduction With the phrase "near at hand is the day when all the developers will have to release 64-bit versions of their applications" I begin many articles since 2006, although now, when I am writing this article, 2009 is coming to end. Life has shown that I was wrong. That day is not so close. So many companies have not yet released 64-bit versions of their products. Partly it is due to the policy of Microsoft company that makes money equally well at selling 32-bit versions of Windows and 64-bit ones. And partly it is because far not all applications actually need the 64-bit versions. But thanks to my experience of communicating with people responsible for decisions of developing applications' 64-bit versions, I understood that the main constraint is very simple. Many people simply do not know how to estimate time and value of the process of migrating an application to a 64-bit architecture. So, this ignorance makes them postpone the process of porting code as far as possible. In this article I am going to tell you about one of the methods to estimate this process before migration. For it is possible to exactly tell how much time migration of a particular application takes only when this migration is over. The article is based on the experience of OOO "Program Verification Systems" company's workers, both in porting various applications to 64-bit systems and using PVS-Studio code analyzer. "Houston, Houston. Can we take off?" This article is devoted to estimate of the migration process, but not the migration process itself. That's why I would refer those who want to examine the issue in detail to the article "Seven steps of migrating a program to a 64-bit system" [2]. Nevertheless, I will use some theses from that article here. Before we estimate the peculiarities of migration, we must have clear answers to the following questions: 1. Do we need to perform the very migration of code to 64-bit systems or is it enough just to make sure that a 32-bit application works on a 64-bit system? 2. Does the development tool used in the project support generation of 64-bit code?
  • 2. 3. Are there 64-bit versions of all the components and libraries used in the project? If you answer "yes" to all these questions you face the main question put in the title of the article. "Well, how to estimate the process of 64-bit migration?" So, you have some (or some tens of) MBs of source code ready for migration. There is no configuration for building 64-bit code, and consequently no module compiled in 64-bit mode. But after reading the article "20 issues of porting C++ code on the 64-bit platform" [4] you understand that the process of searching all the hidden errors in the code will be difficult. To understand how difficult the search of all the errors will be you can use static code analysis. There are various code analyzers (comparison of code analyzers, [3]) that you may use when searching problems in 64-bit code, but in this article I will stick to PVS-Studio code analyzer for it is this tool our company develops. So, in PVS-Studio 3.30, you have a new ability of detecting problems relating to 64-bit code even in 32- bit projects. It is this ability that allows you to estimate complexity of migration BEFORE the step of creating the 64-bit configuration of the project. Earlier, PVS-Studio analyzer allowed testing projects only in the 64-bit configuration. I would like to pay your attention to the mechanism of code testing in 32-bit mode. First of all, you should understand that of course this testing cannot be considered full, and correction of even all the detected problems cannot guarantee code's operability in 64-bit mode. For in the code of any serious application there will be fragments like this: #ifdef WIN64 ... #endif Of course, when testing the code in 32-bit mode, a fragment like this will be skipped. Or, more exactly: at the moment when there is no 64-bit configuration, there can be no fragment similar to this in the code. And when it does appear, the analyzer will "forget" to test it. Another important point is that depending on the project's configuration data types are naturally different. That's why testing in 32-bit and 64-bit modes will nearly always give different results. But how much will these results differ? Proceeding from the results of the experiments undertaken by our company, we give you the following data. The lists of diagnostic warnings generated by PVS-Studio code analyzer coincide 95-97% when testing projects both in 32-bit and 64-bit modes! This means that not more than 5% of diagnostic warnings differ. These results have been received in this way: we took the codes of real projects, tested them in 32-bit mode and saved the list of the problems detected. Then we tested the codes of the same projects in 64-bit mode and saved the list of the problems detected. After that we compared the two lists and estimated how many per cents of diagnostic warnings had coincided. For the whole procedure was performed in automated mode, the number of the projects tested was rather large (more than 20 projects, each several MBs in size). So, you can trust these results.
  • 3. Of course you should not hurry to correct the detected potential errors in the 32-bit configuration - you should wait for the 64-bit configuration. But you can estimate how much time it will take to look through the code analyzer's warnings. To get a time estimate I recommend that you do the following: 1. Perform analysis of the 32-bit configuration of the project with the help of PVS-Studio. 2. Ask a programmer who understands issues of 64-bit code to look through the warnings of the code analyzer for one day and decide whether this or that error is relevant to the project. 3. The general number of the code analyzer's warnings is divided into the number of the warnings examined by the programmer during one day. 4. The number you get is the number of man-hours necessary to migrate the code of the application to a 64-bit platform. Of course there is a weak point in this algorithm of estimating the migration process - the programmer who will look through the warnings during a day. That's why I recommend that you take it seriously when choosing a person responsible for the estimate. Here you are some recommendations on choosing such a programmer: 1. He must be a programmer with experience of not less than three years and, if possible, be familiar with the particular project to be tested. 2. He must be familiar with the issues of 64-bit code. The article "20 issues of porting C++ code on the 64-bit platform" [4] mentioned above is a good source of information on this topic. 3. It is desirable that he understand the principles of operating static code analyzers. This is not an obligatory requirement but understanding of the code static analysis technology makes estimate of the migration process more adequate. Following these recommendations will allow you to get an adequate estimate of value and time of 64- bit migration of applications. Conclusion To better understand this article you should consider some points: 1. No tool (including PVS-Studio) can give any final estimate. It is always a person who gives an estimate. Sometimes using tools, sometimes without them. 2. PVS-Studio code analyzer is not intended for estimating the process of 64-bit migration; it does not give an estimate in hours (days, months). This is a tool detecting potential errors in 64-bit code. But proceeding from this information (when testing a 32-bit project) one can estimate man-hours needed for the project's port. 3. The quality of estimate depends on a person. I wish you successful estimate of 64-bit migration of code and hope that PVS-Studio tool will help you in it. References 1. Code analyzer PVS-Studio. http://www.viva64.com/pvs-studio/ .
  • 4. 2. Andrey Karpov. Seven Steps of Migrating a Program to a 64-bit System. http://www.viva64.com/art-1-2-850243650.html 3. Andrey Karpov. Comparison of analyzers' diagnostic possibilities at checking 64-bit code. http://www.viva64.com/art-1-2-914146540.html 4. Andrey Karpov, Evgeniy Ryzhkov. 20 issues of porting C++ code on the 64-bit platform. http://www.viva64.com/art-1-2-599168895.html