Chapter 1. Generative AI in Software Development
Across all industries, the expectations for Generative AI (GenAI) are high. A recent Forbes survey on AI in Business found that the majority of business owners expect AI will have a positive impact on their business and that AI will be a key asset in several areas. According to that survey, AI is expected to:
- increase productivity (64%)
- improve decision-making (44%)
- decrease response times (53%)
- help avoid mistakes (48%)
- save costs (59%)
- streamline job processes (42%)
For reasons that we’ll outline in this chapter, we believe that software development is the industry best poised to realize these kind of actual benefits and even go beyond the expectations. From planning processes through release and maintenance cycles, taking the opportunities to automate your processes and evolve your technology have always been key practices for successful software delivery. Automating and evolving using GenAI is the next opportunity.
In this period of great expectations, it’s important to acknowledge that the hype and confusion around GenAI are also high. The same study identified, that, among business owners surveyed:
- 43% are concerned about becoming too reliant on AI
- 35% are anxious about the technical skills needed
- 30% are concerned about AI-generated misinformation
- 31% are apprehensive about data security and privacy when using AI
You and your team may share some of these same expectations and concerns when considering using AI. So how do you best target incorporating AI to get the benefits and avoid the pitfalls? In this book, we’ll be using two primary strategies:
- Focusing on the realistic applications of GenAI coding assistants versus the more aspirational AI processes and tools
- Providing dedicated chapters for application of GenAI in the SDLC stages
To begin, let’s level-set on some foundational pieces. In this chapter, we’ll cover
- The rise of LLMs
- Where does GenAI really fit?
- Software development assistants and their fit for purpose
- The software development lifecycle
- Applying GenAI in the SDLC
These sections will give you a good baseline on how to think about GenAI overall and help bound what we’ll be talking about in the rest of the book. A good place to start is by looking at the role of LLMs, but not as generators of prose, social content, or futuristic images. We need to understand how they relate to your mission - developing software - and what makes them well-suited for that.
The rise of LLMs
It may be hard to believe, but we are dealing with technologies that, at their core, are over sixty years old. Both software development and AI can trace their formal origins back to the 1950’s. The data sciences that underlie today’s GenAI, machine learning (ML) and natural language processing (NLP), have been around for decades.
Historically, ML and NLP were viewed as out of reach of most people, including most engineers, unless you were a data scientist or an academic. So, what happened that brought us to the point where we are today - with generative AI available everywhere? The transformation can largely be attributed to the development of large language models (LLMs), and adding a chat interface to them. As shown in Figure 1-1, public interest in AI in general spiked significantly after the release of ChatGPT in November, 2022.
We don’t need to go into all of the details of how an LLM is created, or how it works here. There are plenty of other sources available to go into the interesting, math-heavy (and frequently mind-numbing) details on that. For our purposes, we’ll just define an LLM as an AI model, trained across huge amounts of data, that can predict a sequence of output that is a logical response to some prompt. (This is a significant oversimplification, but we’re aiming for simplification here.)
What makes LLMs different from traditional computer models that can process formatted data, or respond to a math problem, is that large language models are trained to take into account context as well as syntax and structure. They are prediction engines and they are good at it. Adding a chat interface onto them has captured the public’s imagination because we feel we can talk to them almost as we would another person. And we can even tell them to focus their context and prediction functionality to emulate an expert in nearly any field.
But an LLM is still really just an engine. Without augmentation, its knowledge is only as complete as the data it was trained on. And without that same augmentation, it’s information is only as up-to-date as the data when it was initially trained. (That’s why you see lots of press about approaches like RAG (Retrieval Augmented Generation) and fine tuning to supplement an LLMs training.) So, it’s not a best fit for every use case.
Where does GenAI really fit?
LLMs plus a chat interface can captivate as a cool technology that anyone can interact with. But our focus here is putting these models to work. The buzz around LLMs might have us believe that they work equally well for nearly any content generation task. But the reality is different. A recent graphic from Gartner (Figure 1-2) shows that all things are not equal when it comes to the type of tasks these sophisticated prediction engines do best (under the umbrella term Generative AI) .
Notice that content generation is in the High category on that list (even though it’s at the bottom). If we were able to dive deeper, we would undoubtedly see that a certain type of content generation ranks very high - code completions and suggestions. The reason is because programming languages, unlike human languages, have an extremely well-defined, orderly structure and grammar. This is by design and necessity. If the syntax isn’t right, the code won’t run. If the semantics aren’t right, you will get incorrect or unexpected results.
The rules that must be followed to create executable, correct code lend themselves well to a predictable set of tokens. Thus, the process of helping create code is an excellent use case for LLMs that have been adequately trained on large bases of good code examples. We can harness the LLM engine for code completions from a simple element to complete functions. And we can get helpful responses on coding questions through chatting in natural language with it, conversing as if we were having a technical discussion with another member of the team.
Harnessing the models for these kind of coding tasks is the realm of AI assistants or AI coding assistants. These is where the intelligence part of GenAI can be most directly and usefully applied today. It’s also the category of GenAI tooling that we’re focusing on in this book. While these assistants can be referred to by different names, we’re just going to refer to them, from here on, as software development assistants (SDAs), starting in the next section, which looks at the overall application of SDAs in software development.
Software Development Assistants: Fit for Purpose
It’s no secret that AI-powered software development tools are in high-demand by many software development teams due to the potential benefits and potential productivity increases. And it’s probably not a well-kept secret that use of these kind of tools is often widespread within organizations - likely even yours - whether directed or sanctioned by management or not. (A 2023 Stack Overflow developer survey found that 77% of those who responded felt favorably about using AI in their workflow, and 70% of them were already using AI.)
At least as of this moment, the trend of using AI in software development is only expected to increase. Gartner predicts that, by 2028, 75% of enterprise software engineers will be using AI software development assistants in their development processes.
We’ve seen these sorts of seismic shifts in software development before. Software release requirement and planning cycles have been brought from months or years down to weeks (or even days). Crafting bespoke infrastructure for engineering has been replaced with Infrastructure as Code. Hard-coded scripting to do builds, testing, and packaging have been replaced by CI/CD. The ability to deliver to, and run resiliently in, the cloud is a requirement for any application that needs to scale. Secure software is an expectation out of the gate, with an expectation that remediation for security vulnerabilities and updates will happen within very short time frames.
Most of these innovations came about from software engineers addressing a need to solve a unique problem in producing or running software. The adoption of these innovations spread organically as developers and organizations saw the extra value they provided. They have been in use for many years, and are now widely accepted as best practices.
What differentiates a technology innovation from being a novelty, versus a trend, versus a long-term best-practice? It largely depends on how well the tech can be applied accurately and securely to solve a novel problem or solve an existing problem better than other current solutions (i.e. the fit). GenAI, in particular, has captured people’s imaginations for its potential fit across many different domains. Even within software development, the proposed use cases range from simple code completion to being able to develop complete systems from scratch, as a typical software engineer would.
In reality, some of these applications of GenAI are still more aspirational than practical. The actual fit for SDAs is less than full system development, but more than just code completions during the development phase. Engineers at nearly all phases can benefit from using SDAs for targeted tasks. We’ll be discussing examples throughout the coming chapters. But, as a guideline, consider any task where you would normally be asking someone to generate/update basic content, research public examples, or gather insights from your codebase, as potential fits.
With this context, we’re ready to discuss how SDAs can fit into the SDLC. The first steps for that are agreeing on what an SDLC is and then mapping out the potential SDLC integration points with GenAI.
Rolling your own
One other key point on using software development assistants: while teams have the option to create their own, we don’t see it as a good use of your time. Beyond simply connecting to the LLM and getting answers, there are key elements such as quality of training, fine-tuning, infrastructure, and providing a suitable interface to consider. And it is an on-going commitment to maintain. There are many vendors that have strong contenders for software-development assistants at reasonable price-points. If you were to create your own system, any gains you make and time saved using GenAI in your SDLC processes would likely be cancelled out by the time and effort to roll your own.
The Software Development Life Cycle
Let’s define what we mean by SDLC. Although intrinsically we can all describe it, there’s no standard definition that everyone would agree on. Since interpretations can vary, we’ll just cite this one from Amazon:
“The software development lifecycle (SDLC) is the cost-effective and time-efficient process that development teams use to design and build high-quality software. The goal of SDLC is to minimize project risks through forward planning so that software meets customer expectations during production and beyond. This methodology outlines a series of steps that divide the software development process into tasks you can assign, complete, and measure.”
In short, the SDLC is about how you produce software, and do it well, in an orderly, collaborative, and transparent way. Hopefully, it’s also cost-effective, timely, and of high quality. (If not though, incorporating AI isn’t a cure-all, although it has the potential to help.) Within the SDLC, there are different options for strategies to govern how work flows at the high level. These strategies have names you’re likely well-acquainted with, or at least recognize, such as agile, waterfall, spiral, etc.
Regardless of which strategy or methodology you’re using, there’s an iterative set of phases involved. And like the definition of SDLC itself, there’s no universal, standard set. The ones you use may be significantly different from, or significantly similar to, what another company, or even another organization in your company, is using.
Since we want to make sure we are being consistent throughout the book, we’re picking a specific set of phases to work with. Here’s the ones we’re going with, in order, and some basic definitions of what each phase includes.
- Plan: This phase involves defining the scope, objectives, and purpose of the project. It includes gathering requirements, conducting feasibility studies, and creating a project plan or roadmap.
- Create: In this phase, the actual coding and development of the software take place. Developers write code to implement the defined requirements and functionalities.
- Test: The software is tested extensively to identify any problems or shortcomings. This phase includes the various testing types and stages (unit testing, integration testing, system testing, and acceptance for example) to ensure the software meets the organization’s quality standards and requirements.
- Fix: Following on the Test phase, this phase involves debugging, correcting errors, and making necessary adjustments to improve the software’s performance and functionality.
- Document and Explain: Documentation is created to provide detailed information about the software’s design, development, and usage. Communication of the functionality, features, and usage of the software to stakeholders, users, and team members occurs. Training sessions, presentations, and user guides are created to ensure everyone understands how to use and benefit from the software.
- Deploy: Final testing, validation, and signoffs occur. Software is made available in production environments and rolled out to users per the release strategy. User-facing support and maintenance strategies are activated.
- Maintain: Ongoing support and maintenance are provided to ensure the software continues to function correctly and efficiently. This includes updating the software with new features, fixing any new bugs, and making improvements based on user feedback and changing requirements. This phase also includes internally-driven changes such as porting to another language or framework or refactoring the code.
It’s almost certain that these are not the same names and definitions as in your SDLC. But we think that most readers will be able to see clear correspondence with the SDLC process that they have.
For the last part of our chapter, we’ll tie these ideas altogether and look at how we can apply GenAI in an SDLC at a high level.
Applying GenAI in the SDLC
Reading through the list in the previous section, you may already be envisioning ways that GenAI could be beneficial in some of the phases. For others, it may seem murky or unlikely that it could really provide much value-add. You may also have previous experience with AI assistants in your own processes that you’re recalling - good or bad. Those will probably be front and center, as you read through the rest of the book. But it’s important to keep an open perspective as we discuss the realities of what GenAI can, and can’t, do in the SDLC.
Table 1-1 lists some bullet points showing where and how GenAI, provided through SDAs, can be incorporated into the phases we previously outlined.
Phase | Potential use cases |
---|---|
Plan |
|
Create |
|
Test |
|
Fix |
|
Document & Explain |
|
Maintain |
|
The lists for the phases in this table are done with broad strokes to help start building out an overall vision and understanding. In the later chapters, we’ll be guiding you through application in the different areas in detail. But there are steps you can take now to start formulating your own overall plan for integration.
Actionable Steps
In each chapter of this book, we’re going to leave you with advice on steps to take based on the chapter content. We recommend following through on these exercises to get the most out of the discussions.For this chapter, consider creating your own version of Table 1-1 This can be as simple as sketching out the table on a piece of paper, a whiteboard, a spreadsheet or whatever application you prefer. (We do recommend eventually transferring this to an electronic format that can be updated and shared easily.)
Start with the list of your SDLC phases for the first column. (If you haven’t fully codified them yet, this is a great time to do that.) Then, given the context we’ve laid out here and the examples shared in the table, brainstorm a few bullet points for each phase on how you think that GenAI via SDAs can fit into each phase. We recommend doing this as a team exercise if possible to help build understanding and agreement and head off any FUD around future changes.
Brainstorming approach
While we’ve suggested a form and way to approach this, you should use whatever form of brainstorming works best for you and your team. For example, if creating a mind map for this is more typical of the way you develop ideas, feel free to use that approach. We do recommend eventually transferring the results into a simple form like a table that can be easily and quickly digested.
One additional note on this exercise: don’t limit yourself at this point - this is brainstorming. You may come up with use cases that we haven’t thought of. There will be opportunities to validate those later. Once you have this table, continue to refer to it, update it, and evolve it as you progress through the integration process and the rest of the book.
Get The AI-Enabled SDLC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.