AI for Legacy Code

Mihir
01.19.24 12:39 PM - Comment(s)

Mihir Kavishwar

University of Southern California | MathWorks

January 20, 2024

Executive Summary

The article discusses the challenges associated with legacy code in large conglomerate companies and proposes solutions using Artificial Intelligence (AI). Conglomerates face significant issues due to the scale and age of their systems, which often mix old and new technologies. This results in complex maintenance and integration issues. The paper also points out similar, albeit less severe, challenges for medium-scale companies and notes that startups may eventually face these issues as they grow.

The financial impact of maintaining legacy code is substantial, with U.S. companies spending billions annually.

To address these challenges, the paper proposes using AI to summarize and present code infrastructure, dependencies, and APIs and recommends transitioning to new infrastructure while adhering to SOLID coding principles. The implementation plan involves analyzing legacy IT architecture, evaluating modernization approaches, building a business case, inventorying data, creating a modernization team, determining timelines and success metrics, supporting employees through change, and investing in a digital adoption platform.


Problem

The problem of legacy code is significant, especially in large conglomerate companies. These organizations often have long histories, during which they accumulate extensive codebases. These codebases can become outdated but remain crucial for the company's operations. Following is the gravity of this problem with different levels of industries.

Conglomerates > Medium-scale companies > Startups

How big is the problem?

The financial impact of legacy code on companies is quite significant. According to a report, companies typically incur around $361,000 of technical debt for every 100,000 lines of code in their software. This technical debt, if not addressed, can lead to substantial costs over time. In fact, U.S. companies are spending an estimated $85 billion annually on maintaining outdated technology. 1

A report from Dell highlights that more than 70% of software used by Fortune 5000 companies is over 20 years old, leading to high maintenance costs. In some cases, organizations allocate 60-80% of their IT budget to maintaining on-site hardware and legacy apps. This huge financial commitment to legacy systems limits the budget available for other initiatives. 1

Furthermore, the State of Software Happiness Report 2019 shows that over 50% of employees are unhappy at work due to the software tools they're using. This dissatisfaction can lead to high employee turnover, which incurs significant costs for companies. The average cost to hire a new employee in the U.S. lies between $4,000 and $8,000. Such turnover and dissatisfaction can have a profound impact on a company's productivity and bottom line. 2

1. Security Risks:

Unfortunately, specific figures relating to security risks posed by legacy systems are not readily available in the sources consulted. However, it is widely recognized in the industry that outdated hardware and software are more susceptible to cyber-attacks due to a lack of updates and modern security features.

2. Expensive Maintenance:

According to a report by the U.S. Government Accountability Office (GAO), the U.S. government planned to spend over $90 billion in 2019 on IT services, with a significant portion allocated to maintaining aging systems. 3

3. Inefficiency and Incompatibility:

Specific statistics regarding the inefficiency and incompatibility of legacy systems are not detailed in the sources. However, these challenges are frequently cited as major issues in the management of legacy systems, leading to operational delays and difficulties in integrating with modern technologies.

4. Data Silos:

The sources do not provide specific figures on the prevalence of data silos due to legacy systems. However, it is acknowledged that legacy systems often create data silos, making it challenging to effectively access and utilize data for decision-making. 5

5. Lack of Sufficient Skill Sets:

While exact figures are not available, the challenge of finding skilled personnel to maintain legacy systems is a well-documented issue in the IT industry. 3

6. Compliance Issues:

Again, specific statistics on compliance issues arising from legacy systems are not provided in the sources. Nevertheless, achieving compliance with modern regulations is often time-consuming and expensive for legacy systems.


Solution

AI can summarize and present code infrastructure, dependencies, and APIs that are used quickly. It can give recommendations and implement the transition to new infrastructure adhering to SOLID coding principles and documentation. It can also recommend the deletion of some obsolete components, which can be replaced by new libraries.

Implementation Plan

Transforming legacy code into new infrastructure is a multi-step process that requires careful planning and execution. Here's a breakdown of how it can be done more simply:

1. Analyze Your Legacy IT Architecture and Systems:

Start by evaluating your current legacy systems. Consider factors like business fit, value, agility; IT cost, application complexity, and security risks. This step helps identify the need for modernization and areas that need the most attention. 4

2. Evaluate Your Modernization Approach:

There are several strategies for modernization, like encapsulation, rehosting, re-platforming, refactoring, rearchitecting, rebuilding, and replacing. Each has its advantages and suitability depending on the specific legacy system and business requirements. 4

3. Build a Business Case:

Understanding why you need to modernize and what you hope to achieve is crucial. Assess where your legacy system performs well and where it does not, to build a comprehensive strategy. 4

4. Inventory Data and Map to Business Processes:

Make sure your important data remains accessible and protected throughout the modernization process. This step involves taking inventory of all data and assessing how it aligns with business processes.

5. Create a Modernization Implementation Team:

Designate a team responsible for overseeing the modernization efforts. This team should include IT professionals and relevant stakeholders from various departments.

6. Determine Timeline and Success Metrics:

Establish a realistic timeline for the modernization process, along with clear goals and metrics to measure success and track progress.

7. Support Employees with a Change Strategy:

Implement a change management strategy to help employees adapt to new systems. Training and support are vital to ensure the smooth adoption of new technologies.

8. Invest in a Digital Adoption Platform:

Consider using a digital adoption platform to facilitate the transition. These platforms can provide in-app guidance and support, making it easier for employees to adapt to new systems and processes.

Challenges

Implementing an AI-based solution for summarizing code architecture and finding solutions presents several challenges. Here's a look at some of these challenges and ways to tackle them:

1. Integration with Existing Tools and Workflows:

AI solutions need to be integrated seamlessly into existing development environments and workflows without causing disruptions.

- Solution: Design the AI tool to be compatible with popular development environments and platforms. Offer plugins or extensions for integration with existing tools. Gather feedback from end-users to make the integration as smooth as possible.

2. Quality and Availability of Training Data:

The effectiveness of AI largely depends on the quality and quantity of the training data.

- Solution: Use a diverse and extensive dataset for training the AI. This can include open-source projects, internal code repositories, and other available coding databases. Regularly update the training set to include new coding practices and technologies.

3. User Acceptance and Trust:

Convincing developers to rely on AI for code analysis and summarization can be challenging.

- Solution: Focus on user education and demonstrate the value and accuracy of the AI tool. Provide clear examples of how the AI can save time and improve code quality. Offer a user-friendly interface and responsive support to build trust.


Conclusion

Artificial Intelligence (AI) can be a viable solution to analyze, summarize, and modernize these complex systems. We look into a strategic approach for transitioning from legacy to modern infrastructure, balancing the need for innovation with operational stability. By adopting these strategies, businesses can enhance efficiency, reduce costs, and improve employee satisfaction, thereby ensuring their competitive edge in the rapidly evolving technological landscape.


References

vFunction. (n.d.). How much does it cost to maintain legacy software systems? Retrieved from

Userlane. (n.d.). Enterprise legacy systems. Retrieved from

Opidi, A. (2021). Why your legacy software is hard to maintain - and what to do about it. Retrieved from

Whatfix. (n.d.). Legacy application modernization. Retrieved from

Iterators. (n.d.). Cracking the problems with legacy tech, data, and code. Retrieved from


Mihir