7 Ways GenAI Can Help Improve Software Development
There are many areas where GenAI-based development tools can act as assistants to individual enterprise software developers or as full team members. Here are a few of the more common places where the technology can help today, from software design to software deployment.
1. Bug detection and debugging. GenAI systems can efficiently help to identify and fix, or suggest fixes for, errors in code. Of course, there’s an entire industry built around defect remediation; open source and commercial tools can scan source code for security or functional defects, including subtle errors that might only occur if the system is heavily loaded, or if there are memory leaks, issues with multithreaded execution, attempts to access protected memory, and much more.
GenAI can add value to bug remediation in several ways. First, it could use prompts to help analyze whether the code will do what the developer or stakeholder intended, because even if the code compiles and runs correctly, it might not do the right action or return the desired result. Second, GenAI can help summarize defect reports from traditional tools to help test teams and developers understand subtle errors, find patterns of erroneous code, and suggest fixes.
2. Code generation. GenAI can automate writing code based on prompts or specifications. As mentioned, it’s unlikely that GenAI will generate a complex business application anytime soon. However, it can help create boilerplate code that developers can complete as well as code snippets that might implement a complex algorithm, make a difficult procedure call, or access external resources.
For example, many developers know how to use SQL to read, write, and update database information. But there’s an art to writing SQL stored procedures that can handle complex database tables and run efficiently across very large data sets, for example. GenAI tools can use prompts to help the programmer express the requirements for database access and then provide a suggested SQL call or procedure that could be copied and pasted into the application.
3. Code review. GenAI can help review code quality, security, and adherence to best practices. Code reviews are an essential part of the software development process, where a team looks at complex code in a group setting—projected on a screen or large monitor—aiming to validate its proper functionality and suggest areas for improvement. Developers can find code reviews stressful, especially when they’re in the presence of more senior software engineers who find nothing but fault. Code reviews are also very time-consuming and many people simply want to get them finished quickly, which may result in a lack of diligence.
GenAI can help by walking developers through a preliminary code review to spot obvious errors. That helps junior developers learn and can make in-person review sessions go faster. GenAI can also act as a participating member of the group code review team, highlighting areas that require extra attention, even offering up its own guidance as to the best way to make improvements.
4. Documentation. AI can automatically generate or improve documentation for codebases. Even with the best of intentions, developers are prone to ask, “What in the world was I thinking?” when reviewing software they wrote only a few months earlier. That’s why documentation is so important at many levels, including for the complete project’s architecture and the purposes of specific modules or microservices. Within modules and services, documentation can explain the decisions made for libraries, APIs, and algorithms, especially when the developer has a choice. There was a reason—now, what was it? GenAI can help by asking the developer, while coding is in progress, to explain those decisions and then expand those explanations into easy-to-understand documentation.
In addition, when the GenAI is used to help generate code itself (see No. 2 above), it can write full documentation that explains what the code snippet or microservice does and how to use it properly.
5. Learning and training. GenAI can help provide instant examples and explanations to improve developer skills. Software developers—even, or maybe especially, rock star coders—are continuously learning. There are always new technologies, such as AI and microservices, coming online as well as new tools, new language features, new design patterns, new security vulnerabilities, new corporate standards and best practices, and even new compliance requirements.
While there are numerous courses and classes as well as in-house training and mentoring, ongoing help is valuable. GenAI offers the potential to help detect when a developer is struggling, such as when there are attempts to use a deprecated feature or out-of-date API, and provide instant, personalized training. It can also, through prompts, help provide instant guidance when the developer doesn’t know or remember how to perform a new or rarely used task. It’s like a help screen but customized for that exact situation.
6. Refactoring. Optimizing and restructuring existing code for better performance is something GenAI can help with. Refactoring is an essential part of the software development lifecycle: It’s where you take a section of code and, without changing its functionality, make it run better. That may mean improving its speed and scalability, lowering its memory consumption, updating an algorithm, taking advantage of a new microprocessor shortcut, or using a new language instruction. Developers use runtime metrics to spot areas of code that are slow, consume too many resources, or cause end-to-end delays and target those for refactoring.
Refactoring may be an ideal place for GenAI code generation, where developers feed the problematic code into the system and, essentially, ask, “Can you make a version that runs faster?” We’re oversimplifying, but by seeing what the code does and how it works, GenAI’s predictive capabilities can often allow it to find a better approach. What’s more, because the old code and the refactored code can be compared and benchmarked, it’s easy to determine the benefits of the refactoring process as well as verifying that, indeed, the underlying functionality didn’t change.
7. Testing. GenAI can help create test cases, automate testing processes, and simulate edge cases. Different methodologies have their own unique views of the software testing process. Test-driven development (TDD), for example, insists that before you write a single line of code, you create test cases to ensure that whatever you write will work properly. In other methodologies, the development team may do testing at the end of a sprint; in others, a dedicated testing team does testing. The role of stakeholders in testing is essential and varies depending on the methodology: Sometimes, stakeholders are constantly involved and in other cases they review only release candidates.
GenAI can play multiple roles in helping testing and test management. We mentioned bug detection, but GenAI can also help write scripts that can be used as test automation tools, a process that many developers find tedious. Such GenAI-enhanced tools can also help test for edge cases, that is, situations that are unlikely to occur but still must be properly handled by a code module, stored procedure, or microservice. In addition, GenAI can help review test cases, including those written by humans, to determine if they’re good tests and that they cover all likely situations, including error conditions and attempts to hack the code at runtime.