Generative AI - Flattening the Software Development Life Cycle
Generated by DALLE-3

Generative AI - Flattening the Software Development Life Cycle

For some time, I've wanted to write about this topic because I don't see anyone else addressing these questions. If we augment software development with generative AI, what kind of productivity should we expect, and where will the greatest impact be?

The adoption of generative AI to augment software development requires us to re-examine how we estimate time and effort needed, as much of the programming code can now be written by generative AI.

Why is This Important??

I asked Claude-Opus and GPT-4 to estimate how many lines of code are being written every year. Considering that 2024 could mark the last year where commercial software is largely done by humans, I'd like you all to think about this.?

The abbreviated response from Claude-Opus is as follows:

According to a report by IDC, there were approximately 26.4 million professional?software developers worldwide in 2019, and this number is expected to reach 28.7?million by 2024.

To estimate the total number of lines of code written annually, Claude-Opus suggested multiplying the projected number of software developers by the average daily output per developer.

Here's the calculation:?

  • 28.7 million developers (projected for 2024) × 50 lines of code per day = approximately 1.435 billion lines of code per day
  • Multiply this daily output by the total working days in a year: 1.435 billion lines of code per day × 220 working days per year = approximately 315.7 billion lines of code per year

Claude-Opus? was also ask to calculate the total person-days dedicated to software development in 2024:

  • 28.7 million developers × 220 working days per year = approximately 6.314 billion person-days of software development

That's a staggering number! Take a moment to consider what it will mean when nearly all software development is augmented with generative AI.

Approach

This article presents an end-to-end software development case study that showcases a project of sufficient complexity to be tackled by a small team, rather than an individual developer. The key requirement was that the solution would benefit from upfront design work, allowing for a more structured approach to development.

The Case Study: A Novel Approach to Generative AI

I'm tired of seeing reviewers hype the latest AI model by having it generate code for a simple game like Tic-Tac-Toe or Snake, only to declare it a "coding wizard." In this case study, I've taken on a more challenging task: developing software that can write a first draft of a fiction novel on any subject with minimal human involvement.

While there are already existing tools that can generate fiction novels, I chose this case study because it presents an ideal opportunity to explore the capabilities and limitations of generative AI in software development. Writing a novel from scratch is a complex, multi-step process that involves developing a narrative structure, outlining chapters, creating characters, and more.

To tackle this challenge, I'll be following a structured approach: first, I'll develop a narrative structure and character glossary, and then use those as the foundation to write the novel. This approach allows me to demonstrate how generative AI can be used in two capacities: (1) generating most of the programming code, and (2) incorporating AI into the novel-writing? software itself to create interim and final outputs.

Please note that this exercise is focused on creating a competently written first draft, not a masterpiece. My goal is to better understand the nature of software development using generative AI and to demonstrate its potential applications in creative fields like writing.

The Software Development Life Cycle ? ?

The concept of the Software Development Life Cycle (SDLC) has been formally described since 1970 by Winston W. Royce in an article that can be accessed through the Wayback Machine. See below:?

Original Article - Systems Development Life Cycle

While various approaches, such as Waterfall, Iterative, or Agile, have evolved over the years, one aspect remains relatively consistent: the estimation of effort for each phase of the SDLC. The typical breakdown of a SDLC is as follows:

  • Requirements: 10%
  • Design: 25%
  • Development: 40%
  • Testing: 20%
  • Implementation: 5%

Please see the chart below to visualize this breakdown.

Software Development Life Cycle Estimates

The question that rarely gets asked is what happens to this characteristic curve, which has remained constant for over 50 years, as generative AI increasingly takes over the creation of programming code during the Development phase.

To address this uncertainty, let's take a closer look at each phase of the Software Development Life Cycle (SDLC) for our case study. We'll focus on the key points without delving into technical details. A more in-depth examination of the design and development approach will be discussed in a separate article.

Requirements:?

My requirements were straightforward: provide a brief description of the fiction novel you want to be written, and the software generates the novel. However, writing a novel is a more complex process than crafting a short story. A good practice when writing a novel is to establish a narrative structure first, including a chapter-by-chapter summary. Each chapter typically consists of several scenes. Additionally, creating character profiles in a glossary can be beneficial, listing their strengths, weaknesses, roles, and relationships with one another.


Design?

This design (shown below) describes the data objects and generative services required.


I started by creating a Narrative Structure object, which contains a list of Chapter Outline objects, each with a list of Scene objects. The Character Glossary object will contain Character and Character Relationship objects. Finally, there is the Novel itself, which will contain Chapter objects.

To ensure that a human-in-the-loop can adjust the Narrative Structure and Character Glossary before they are used in the next step, each data object has a Save_to_File method to persist the object as a plain text file. More on this later.

Next, I needed at least three generative services. By generative service, I mean a function that accesses one or more data objects, creates an AI prompt using values pulled from the data object(s), and then handles the response.

The first generative service will create a Narrative Structure. The second will create a Character Glossary. The third will?generate the Novel itself. The prompt to generate the Character Glossary will include the complete Narrative Structure generated earlier. The prompt for the Novel will require the largest context, as it includes the Narrative Structure, Character Glossary, and since the Novel is built scene by scene, the prompt needs to include the text of the story so far.

The generative AI at the top of the diagram refers to a Large Language Model (LLM) like GPT-4 or Claude-Opus. The generative services create prompts, and the LLM is asked to return a structured object instead of a plain text object.

The purpose of this design is to ensure that the output from the generative AI is passed back to the program in a consistent?format, allowing the values to be used to populate the attributes of each data object.

In other words, the generative services create prompts for the LLM, which then generates a structured output that can be easily consumed by the program. This allows for seamless integration between the human-in-the-loop and the AI-generated content.

Human in the Loop?

It still seems unusual to say this, but one of the key differences in this solution is that I would not have typically spent so?much time deciding where to "inject" human involvement into the process (Human-in-the-Loop).

In reality, I could have created a program that simply took a prompt as input and produced a fiction novel as the sole output. However, generative AI still has a significant way to go before it can produce high-quality fiction novels, so incorporating humans at each step in the process remains a good idea.

Development (Coding)?

The effort required for requirements gathering, analysis, and design remains largely unchanged by generative AI. At least for now, collecting requirements and applying software engineering principles to design still necessitates significant human input. Just as with any software development project, if you get this part right, the rest of the development process falls into place seamlessly. However, it's not a straightforward process; instead, there will be near-continuous iteration between design and coding for a period of time.

Writing program code in the Development phase involves working at the granular level with one or more programming languages. With generative AI, you can instruct a Large Language Model to write the code you need, piece by piece, while following good software engineering practices.

I will provide further details on the actual process for creating the code in a separate article. What's crucial for this article?is that, following the design shown above, I was able to implement the solution in a modular fashion, one data object or generative service at a time. Since the generative service functions rely on the data objects, I was able to define them next.



Testing?

Testing is another phase where there is a notable reduction in effort. When using generative AI to write code for your data object or generative service, the Large Language Model (LLM) can also generate the test code required to verify the functionality of the defined function. In most cases, when working with GPT-4, you don't even need to ask it to do so - the LLM will automatically produce the necessary test code.

What was Learned

My personal perspective is that once you start developing software in this manner, you won't go back to traditional approaches. Your focus shifts from the low-level details of coding to design. With generative AI, even solo developers can deliver the same level of productivity as a small team.

As a result, I was able to significantly reduce the Software Development Lifecycle (SDLC) estimates for this project. Typically, an SDLC breakdown looks like this: 10% Requirements, 25% Design, 40% Development, 20% Testing, and 5% Implementation. Based on my experience, I believe that any software development augmented with generative AI will see a significant reduction in the Development and Testing phases. In contrast, Requirements and Design will remain relatively unchanged.

As a starting point, I would estimate that generative AI-augmented software development projects will typically involve:

  • 10% Requirements
  • 25% Design
  • 20% Development
  • 15% Testing?
  • 5% Implementation.?

You can see the changes in the SDLC Estimates in the diagram below.?

Software Development Life Cycle Estimates Comparison

One final observation is that while there have been many software development tools that claim to boost productivity, generative AI stands out because it allows you to communicate with it in the same way you would collaborate with an additional team member. There's no steep learning curve to overcome; once you have your design, you can assign tasks to generative AI just as you would if you were delegating a task to a human colleague.

Related Articles:?

This will be the firs of three articles based on this case study. The topics covered will include:

1. Flattening SDLC Estimates

This article explores how generative AI can significantly reduce Software Development Lifecycle (SDLC) estimates by enabling rapid generation of new code and adaptation of existing code to meet changing business requirements.

2. Time to Adapt: Applying Generative AI in Software Development

Building on the introduction of GitHub Copilot, this article delves into various ways to integrate generative AI into software development, including the Centaur and Cyborg approaches, based on research by Ethan Mollick. I have firsthand experience with both methods.

3. Moving from Software Design to Coding with Generative AI

This article will discuss how to transition from software design to coding when most of the code is written by generative AI, allowing for a seamless and efficient workflow.

Imagine the possibilities when you can walk through a software design and have the code written by generative AI as quickly as assigning tasks to a team of programmers. The code will be consistent and high-quality right from the start, and can be endlessly revised and refactored as needed.

The integration of generative AI into the software development lifecycle is poised to revolutionize everything, but good software design skills by humans are still essential – at least for the time being.? It’s time to adapt!

Full Disclosure: I used Llama3–8B to correct grammar and improve readability from a first draft. All of the thoughts expressed in this article are my own, and I am human. My pre-training took over 45 years.?

要查看或添加评论,请登录

Dennis Layton的更多文章