AI and the future of DevOps
Tags: devops, ai
Published: 2022-12-09 17:50:06

The release of [ChatGPT](https://chat.openai.com/chat) by [OpenAI](https://openai.com/) has caused quite the stir in the software industry, as it showcased the potential of AI in an easy to digest format for the everyday consumer.  With over [one million users within just five days](https://twitter.com/GRDecter/status/1599804597090279424?s=20&t=l8-saEFLpm5WgKp8gZo2TQ), ChatGPT has demonstrated growth that surpasses even the most popular social media platforms. This impressive adoption rate highlights the increasing demand for AI in today's world and its potential to disrupt many industries, including DevOps. However, even with such staggering growth and excitement, there is still a good amount of skepticism – these are early days, afterall.

As AI continues to evolve, we expect it to have a profound impact and practical applications in the DevOps world. AI has real potential to improve code quality, strengthen monitoring and alerting systems, enhance security measures, and increase engineering productivity.  

## Code quality

As AI tools like [GitHub’s Copilot](https://github.com/features/copilot) and [Replit’s Ghostwriter](https://replit.com/site/ghostwriter) continue to grow, we are already seeing more and more software written by artificial intelligence. This trend will only continue, with AI being used in DevOps to write configuration files, IAM policies, Infrastructure as Code (IaC), and more. 

Here is an example of ChatGPT [debugging an error with an AWS IAM policy](https://twitter.com/iangcarroll/status/1598171507062022148?s=20&t=C0jcISy0Eu-biy56lWfoCA).

AI will continue to play a significant role in code generation. While developers will still need to review and make adjustments to the code written by AI, the speed and accuracy of AI-generated code will likely surpass that of human-written code. This could shift how software is developed, with AI taking on a more central role in the process. However, the exact timeline for when this might happen is still unknown. It will likely depend on several factors, including the advancement of AI technology and the [willingness of developers to incorporate AI into their workflows](https://twitter.com/wesbos/status/1599851237821845504). It’s going to be interesting to see how quickly AI is embraced or kept at arm's length by developers.

## Code reviews

As AI technology advances, it will likely profoundly impact code reviews. This is already starting to happen with the development of tools such as [Amazon CodeGuru](https://aws.amazon.com/codeguru/) and [GitLab's ModelOps](https://about.gitlab.com/blog/2022/01/04/the-road-to-smarter-code-reviewer-recommendations/). These tools automate certain aspects of the code review process, such as identifying potential errors and suggesting improvements, saving developers time and effort while also helping to improve code quality. 

In the future, AI-powered code review tools may become even more sophisticated and comprehensive, taking on more complex tasks and providing more detailed feedback to developers. This could lead to more efficient and effective code review processes, helping to ensure that the code is of the highest possible quality.

AI will verify that the code is correct, test for security vulnerabilities, and ensure that it works properly. As the AI performs more and more code reviews, it will become more proficient at identifying issues and suggesting fixes. Over time, the AI will become increasingly knowledgeable about your application's code base, enabling it to make more accurate suggestions. Initially, developers will still need to review and approve any changes made by the AI, however, the need for human intervention will decrease over time.

## Testing

AI will revolutionize testing. The [shift-left testing](https://en.wikipedia.org/wiki/Shift-left_testing) approach, which focuses on identifying and fixing issues early in the development process, will be significantly impacted by AI. The [traditional testing pyramid](https://martinfowler.com/articles/practical-test-pyramid.html), which emphasizes the importance of different types of testing, will become obsolete as AI takes on a more significant role in the testing process. With AI, your application's code base can be thoroughly analyzed and tested at all levels, from i[ndividual units](https://www.diffblue.com/) to end-to-end user scenarios. In addition, AI will test for security vulnerabilities, performance issues, edge cases, and more.

In addition to performing comprehensive code reviews and thorough testing, AI will monitor your application in production and identify any issues that may arise. By continuously monitoring the application, AI will learn from these issues and adapt its testing strategies to prevent similar problems from occurring in the future. This ability to constantly learn and improve allows the AI to provide ongoing support and protection for your application, ensuring it remains stable. Additionally, by automating many tedious and time-consuming tasks involved in testing, AI can free up your development team to focus on more critical tasks and accelerate the overall development process.

## Monitoring and alerting

AI will [monitor](https://arize.com/) the performance of an application and automatically alert teams if any issues need to be addressed. This can help teams respond to problems quickly and prevent them from becoming more serious. We believe that an AI could soon replace most site reliability engineers (SRE’s) responsibilities. AI can analyze large amounts of data, such as [logs](https://www.dynatrace.com/platform/infrastructure-monitoring/), to identify [potential problems and trends](https://aws.amazon.com/devops-guru/) in real-time. Analyzing such large amounts of data will provide insights and recommendations that can help teams make more informed decisions. 

When a bug is found in your application, AI could deploy a working version of your app without interrupting its operation. After deploying a previously functioning version of the app, the AI could create a new PR and write the necessary code to fix the bug. 

AI could also identify inefficiencies in your cloud infrastructure and suggest ways to improve performance and reduce costs. This could include scaling resources up or down based on demand, consolidating underutilized resources, and more. The use of AI in cloud management and monitoring has the potential to improve efficiency, reduce costs, and prevent bugs.

## Security

AI technology will play a significant role in the [security of applications](https://www.dynatrace.com/platform/application-security/) and infrastructure. For instance, AI could automatically detect and block malicious attacks such as DDOS, XSS, and CSRF. It will also instantly identify potential security vulnerabilities during code reviews. Additionally, AI could surface any leaked or vulnerable PII (personally identifiable information).

AI could monitor network traffic and identify suspicious patterns indicating an attempted attack. This could include analyzing the content of network packets, the frequency and location of requests, and other characteristics. Based on this analysis, an AI could automatically take actions to defend against the attack, such as blocking the source of the traffic or redirecting it to a honeypot. Additionally, AI could conduct security testing of your application during the development process, simulating various attacks and vulnerabilities to identify potential weaknesses before attackers can exploit them.

## Increased productivity

AI already automates repetitive and time-consuming tasks, enabling teams to be more productive and efficient. AI will increase productivity for DevOps engineers by reducing the amount of boilerplate code for infrastructure as code (IaC), templates, and configuration files. Tools such as Copilot and Ghostwriter currently help with this and will only improve over time.

Furthermore, AI can help DevOps engineers by providing instant access to information from documentation. Instead of reading through documentation, engineers can ask AI for the information they need, allowing them to access the information they require instantly. Additionally, AI can handle tasks such as configuring infrastructure and setting up cloud services, freeing DevOps engineers to focus on more specialized work.


## Coherence and AI

At Coherence, we see several opportunities to incorporate AI in a way that will materially benefit our customers. For example, AI could help us and our customers streamline the onboarding process for new applications. Since every application has unique requirements, the onboarding process can vary greatly depending on the complexity and architecture of the app. AI could analyze a customer's application and assist with creating Dockerfiles, our coherence.yml, and ensuring that the app is ready for deployment in the cloud. This would save time and reduce errors, improving the overall onboarding experience for our customers. 

Artificial intelligence could help us regularly monitor our customers' infrastructure and cloud services to ensure optimal performance and cost-effectiveness. AI could enhance application security and compliance with HIPAA, SOC2, and others. Additionally, we believe that AI can assist our team with more efficient code reviews and improved code quality.


## Conclusion

Companies will create DevOps-specific models that are hyper-focused and specialized, like [Amazon’s DevOps Guru](https://aws.amazon.com/devops-guru/). Sam Altman, the CEO of OpenAI, [foresees a future](https://youtu.be/WHoWGNQRXb0) where several new companies and startups train existing models for specific verticals. Companies will leverage already trained and existing models but enhance them with data specific to DevOps. These AIs will improve code quality, strengthen monitoring and alerting systems, enhance security measures, and increase engineering productivity.

The use of AI in DevOps has the potential to significantly improve the efficiency and reliability of software development and deployment. We believe by leveraging the power of AI, companies can build better products faster and cheaper. If that provides a better experience for our customers and users we should embrace it.