Software development in the era of AI-generated code

In the rapidly evolving world of technology, quite a few software developers are anxious that their job might be at risk because of the GPT technology. As the AI system is likely to become better at an increasing rate (exponential rate), it challenges the traditional role of almost everyone involved in software development and other industries.

On the other hand, the management is unsure whether to leverage this technology or not. There are concerns both ways; If a company adopts this technology to generate code and other artefacts such as documentation or even JIRAs, then there are concerns about Intellectual Property Rights, Security, Human capital development and learning, Legal and Regulatory requirements and many more. If a company avoids it, then there are concerns around competitiveness, slower development cycles, increased costs, and the inability to capitalise on the potential benefits that AI-driven development might offer.

In this post, I will focus on how software development landscape is likely to evolve, assuming that a speedy advancement of this new technology is inevitable.

Broadly speaking there are these three main aspects of delivering a software project:

  • Strategic and Planning: Requirements analysis, Scoping, Prioritisation, Project management, Risk management, Client interfacing and expectation management etc.
  • Development and Implementation: Design, Architecture, Coding, Testing and QA, Deployment and infrastructure, CICD etc.
  • Support and Maintenance: Customer support, Level 2 support, Release notes, Maintenance and updates/ patches to both infrastructure and software product/ project etc.

Although each of these aspects holds potential for transformation, in this blog, I will concentrate specifically on the aspects of coding.

The featured image at the top of this blog was generated using DALL.E 2.
  1. Specification to code
  2. AI-Assisted Programming in Today’s World
    1. Practical Examples – Developers Can Try with ChatGPT
    2. Refinement
    3. Sophisticated code generation with GPT-4
    4. Skills Programmers Must Possess to Leverage AI Technology Today
    5. Above and Beyond Software Development
  3. Near-Term Future
    1. Better Code Generation and Bug Fixing
    2. UX Design to Front-End Boilerplate Generation
    3. Automated Code Reviews and Identifying Knowledge Gaps
    4. Skills Needed for Software Development in the Near Future
  4. Mid-Term Future
    1. Improved Collaboration Among Geographically Dispersed Teams
    2. New Methods of Expressing Decomposed Tasks to AI
    3. Faster Iterations Enabled by AI
    4. Accelerating Tech Evolution with AI
    5. Skills Needed for Software Development in the Mid-Term Future
  5. Long-Term Future of Software Development
  6. Conclusion

Specification to code

Without delving deeply into the initial stages of understanding business objectives and requirements, and their translation into functional and non-functional specifications, let’s concentrate on the phase where these specifications are transformed into code.

Developers generally analyze a user story or use case, breaking it down into smaller, manageable tasks. These tasks often involve programming, testing, and deployment activities that, when combined, contribute to the successful completion of the user story or use case. Importantly, while performing this breakdown, developers maintain a focus on the overarching architecture and software design to ensure consistency and alignment with the intended solution.

Although most developers are familiar with this process, it’s essential to highlight the following key points: Programs act as highly accurate instructions for compilers, allowing them to generate executables that, when run, produce the desired outcomes. The need for precise descriptions is the reason programming languages adhere to strict syntax and semantic rules, to the extent that they are defined in Programming Language Specifications and have established standards built around them. Bearing this context in mind, let’s examine the current AI landscape and delve into its potential advancements across the near, mid, and long-term horizons.

AI-Assisted Programming in Today’s World

Today, AI showcases impressive capabilities in the following tasks:

  1. Crafting functions and classes based on clear English language specifications.
  2. Developing comprehensive unit tests for well-structured, testable code.
  3. Writing Open API specifications for REST calls or even GraphQL schemas.
  4. Creating database migration scripts.
  5. Generating documentation that explains the functionality of functions, classes, or scripts.
  6. Developing scripts for deployment processes.
  7. And more.

In fact, AI can effectively engage with us to develop accurate specifications. However, since our primary focus for this blog is on coding, we will not delve into that aspect.

At present, the code generation tools at our disposal may occasionally produce buggy or non-compiling code. However, these limitations should not deter us from enhancing our productivity. By iterating with the generated code, we can often achieve our desired results. In the practical examples that follow, I will demonstrate how leveraging these tools can lead to increased productivity using the resources available today.

Practical Examples – Developers Can Try with ChatGPT

If you're not near a computer at the moment, feel free to read through this content, but be sure to give it a try step by step when you have the opportunity later. Most of the time, ChatGPT with the default (GPT-3.5) will suffice, but occasionally, GPT-4 might be more effective.

Just type the following sentence on the prompt:

Write an open api specification for Authentication Server.

It generated a valid OpenAPI specification, which I was able to copy and paste into https://editor.swagger.io. This allowed me to easily visualize and understand the content. Moreover, the response from ChatGPT included clear and concise documentation, further simplifying the process.

For the open api specification above, write a script for PostgreSQL to create corresponding tables.

It generated a valid script for creating three tables: users, refresh_tokens, and access_tokens. I executed the script to create tables in the PostgreSQL database. Further, I used commands to list and describe each table, verifying that the script executed successfully and the tables were created correctly.

Refinement

The generated PostgreSQL script included four fields: id, username, password, and email. As a developer, I wouldn’t want to store the password as plain text; instead, I would prefer using salting and stretching, which is a secure practice for storing passwords as hashes. Let’s see how to refine it.

password VARCHAR(255) NOT NULL, (Change this to passwordHash, and add 3 more fields: passwordSalt, hashingAlgo, numIterations)

You can either enter this modification directly in the prompt or copy the entire script, insert the plain English text within the script, and then ask ChatGPT to revise the script accordingly.

Sophisticated code generation with GPT-4

GPT-4 is significantly superior in terms of reasoning, allowing it to produce higher quality code and unit tests. Just type the following sentence on the prompt:

Write a salting and stretching function in Java which takes the following params: passwordClearText, passwordSalt, hashingAlgo, numIterations and returns the passwordHash. Use PBKDF2 to generate the passwordHash.

The generated code compiles without errors and runs as expected. It wrote a function called generatePasswordHash. To verify its proper functionality, we can rely on unit tests, which are essential for ensuring the code’s reliability and accuracy. Just type the following sentence on the prompt:

Write unit tests for generatePasswordHash.

This generated 5 different tests.

  1. Checking that the generated password hash is not null.
  2. Checking that the same input parameters produce the same hash.
  3. Checking that different passwords produce different hashes.
  4. Checking that different salts produce different hashes.
  5. Checking that different numbers of iterations produce different hashes.

In my opinion it missed one important test, so I simply asked to generate it.

Include a test for different hashingAlgo.

It has updated the tests to include the extra unit test which I wanted.

Numerous other experiments have demonstrated that ChatGPT can analyze both code and logs, and is even capable of proposing solutions and generating additional unit tests for any identified issues.

Skills Programmers Must Possess to Leverage AI Technology Today

To take full advantage of the available GPT-4 technology, software developers must possess the following skills:

  1. Proficiency in the programming language: A developer must be able to understand the code generated by ChatGPT and make necessary corrections. This requires a strong command of the programming language.
  2. Understanding of best practices and design patterns: Developers should be familiar with industry-standard best practices and design patterns to ensure that the generated code adheres to high-quality standards.
  3. Ability to suggest implementations with clear instructions: Developers should be capable of suggesting implementations with precise instructions on the overall approach to be used in the implementation.
  4. Decomposition of requirements into manageable small tasks: This skill is essential for any good development, and it involves breaking down the requirements into manageable, smaller tasks.
  5. Having a comprehensive understanding and mastery of unit tests, automated testing, and test-driven development is crucial for ensuring that the generated code is dependable and precise, and that it satisfies the user’s requirements and specifications.

Above and Beyond Software Development

Today, ChatGPT can generate code, write unit tests, and even create deployment and Infrastructure as Code scripts. With a solid understanding of the technology, a single developer can manage all aspects of procuring services from cloud providers and pushing deployments using Continuous Integration/Continuous Deployment (CI/CD) methodologies. ChatGPT can even generate the necessary YAML files for CI/CD pipelines. This means that software developers can go beyond software development and can potentially aid in the entire DevOps process for simple projects.

Near-Term Future

In the near future, it is highly probable that the generated code will compile with a much higher success rate, significantly reducing the need for developers to remember syntax completely. Even today, software engineers can provide error messages from compilers to ChatGPT and have it correct the generated code. This means that the need for iteration will be significantly reduced, leading to faster and more efficient development processes. As AI technology continues to evolve and improve, we can expect even more advanced capabilities in the near-term future.

Better Code Generation and Bug Fixing

With continued learning from interactions with humans worldwide, ChatGPT (or similar AI systems) may become proficient at inferring unspecified information and generating code accordingly. For example, in the case of authentication server code generation, the AI system may understand from prior conversations that the business is better suited to have notifications and small interactions over mobile, and therefore, the user registration must accept a phone number.

Moreover, it’s likely that an AI system with access to source code could effectively understand logs from a production system and assist in resolving issues. The AI system could propose fixes that developers could then review and incorporate through pull requests. This would lead to a more streamlined and efficient process for identifying and fixing bugs, allowing developers to focus on other critical aspects of development.

UX Design to Front-End Boilerplate Generation

In the near future, we can expect an AI integration with design tools such as Figma or Adobe XD and front-end codebases. In that the AI system will generate code directly from the design tools. The generated code will contain appropriate comments indicating where to inject code for back-end interactions or front-end state management. This streamlined process will accelerate front-end development, allowing developers to focus on other critical aspects of development.

Automated Code Reviews and Identifying Knowledge Gaps

In the near future, AI may be capable of suggesting better ways to write code when reviewing code written by a person. Additionally, AI may also identify knowledge gaps and suggest resources or links that developers could use to fill those gaps. These simple nudges to improve skills without overwhelming the developer will make software development more enjoyable and less frustrating.

Automated code reviews will not only improve the quality of code, but they will also provide developers with valuable feedback and insights. AI will be able to identify potential issues and suggest improvements, leading to more efficient and effective development processes. Furthermore, developers will be able to learn and grow their skills, leading to a more knowledgeable and capable workforce.

Skills Needed for Software Development in the Near Future

As AI technology continues to evolve and transform the software development landscape, software developers must have the following skills to stay relevant:

  1. Proficiency in a particular tech stack for both front-end and back-end development will be helpful.
  2. Proficiency in software design principles and design patterns.
  3. Understanding of industry best practices.
  4. Ability to decompose requirements into manageable, smaller tasks.
  5. Understanding of the importance of logging and incorporating sufficient logging into the generated code to support the system.
  6. Automated testing, including unit testing, component-level testing, integration testing, and system testing, will be essential for ensuring that the code is reliable and accurate. Developers must also have a good understanding of test-driven development methodologies.

By possessing these skills, developers can work alongside AI technology and take advantage of its advanced capabilities.

Mid-Term Future

As we look towards the mid-term future, we can expect that the generated code will compile and run seamlessly almost all the time. However, the ability to decompose the business requirement into manageable tasks will still be necessary. In addition, detailed planning of a story in which AI can assist will be essential. Developers could simply present decomposed tasks or expose JIRAs to AI and let it do the work. The decomposition would likely be expressed in industry-standard terms but not necessarily with strong syntactical grammar. The expression would only be in plain English, making it easier for developers to communicate their ideas and requirements.

Furthermore, AI will continue to evolve and improve, allowing developers to work alongside it more seamlessly. As AI technology becomes more sophisticated, developers can expect to have access to more advanced tools and capabilities.

Improved Collaboration Among Geographically Dispersed Teams

In the future, AI can play a crucial role in facilitating better communication and collaboration among team members who are geographically dispersed and have different cultural backgrounds. With the ability to translate between different human languages and analyse sentiments, AI can help team members to communicate more effectively. This will help to foster better collaboration, more efficient workflows, and ultimately, higher quality software development.

New Methods of Expressing Decomposed Tasks to AI

As AI technology continues to evolve, we can expect that new methods of expressing decomposed tasks to AI will emerge. These methods may include a variety of formats such as images, plain English, and snippets of audio or video recordings of developer and product owner discussions.

By utilising these new methods, developers and product owners can better communicate their ideas and requirements to AI, leading to more accurate and efficient development processes. With the ability to understand and analyze various types of data, AI can interpret these new methods of expression and generate code and other deliverables accordingly.

Faster Iterations Enabled by AI

With the increasing frequency of development and deployments, particularly in DEV/QA environments, projects may have updates on an hourly basis instead of daily or weekly.

Possibly, AI can automatically run system tests that focus specifically on the new code being pushed in the hourly release. This can be done quickly and efficiently, allowing developers to identify and address any issues or bugs in the release much faster. Additionally, improvements to the feature can be suggested in plain English by developers, and small changes can be deployed immediately, further speeding up the development process for the feature.

By leveraging AI technology, developers can work more efficiently, enabling faster iterations and more frequent releases.

Accelerating Tech Evolution with AI

As businesses evolve, their technological needs often require updates or upgrades. With the ability to analyse large amounts of data and identify patterns, AI can help businesses to adapt more quickly to changing market conditions and technological requirements. It’s possible that new market conditions or a bigger scale of business operations may necessitate pivoting on some of the core assumptions baked into the software design and architecture. In response, AI can play a key role in suggesting better architecture and guiding developers towards a path forward.

In the mid-term, developers can evaluate and decompose the suggested approach and begin generating code accordingly, leading to a much faster pivoting of the tech architecture as needed.

By leveraging AI technology, businesses can evolve their tech capabilities more rapidly, enabling them to stay ahead of the competition and meet the demands of their customers more effectively. This will ultimately lead to better business outcomes, as companies can respond more quickly and efficiently to changes in the market and customer needs.

Skills Needed for Software Development in the Mid-Term Future

As AI technology continues to evolve and become more integrated into software development processes, developers will need to develop new skills to keep up.

  1. Proficiency in programming languages and software design principles.
  2. Ability to decompose requirements into manageable tasks.
  3. Understanding of automated testing and quality assurance.
  4. Ability to collaborate effectively with AI systems using various formats.
  5. Adaptability and willingness to learn: With the rapid evolution of AI technology, developers will need to be able to adapt to new tools and techniques as they emerge, and be willing to continuously learn and improve their skills.

Long-Term Future of Software Development

Predicting the long-term future of software development is a challenge, but it’s clear that the role of AI in software development will only continue to grow in importance. As AI systems become more advanced, they will be able to generate higher quality code and assist developers in new and innovative ways.

One possible outcome in the long term could be that there will no longer be a need to learn a programming language. The ability to specify the intent correctly, and let the AI system generate compiled code and automated tests directly from it is not unimaginable.

There will still be new problems and business models that require human intervention and decision-making. It’s likely that AI systems will take care of the more mundane and repetitive tasks, freeing up human developers to focus on higher-level problem-solving and innovation.

As the field of AI continues to evolve, it will be important for software developers to remain adaptable and flexible, able to learn new skills and take advantage of emerging technologies to stay ahead of the curve. Ultimately, the long-term future of software development will be shaped by a complex interplay of technological advancements, business needs, and human ingenuity.

Conclusion

AI is transforming software development. From code generation to automated testing and deployment, AI is enabling developers to work more efficiently and effectively. As AI continues to evolve, developers must stay on top of the latest advancements and embrace new ways of working. The future of software development is exciting and full of possibilities.

1 Comment

Leave a comment