Skip to main content

How AI Helps Coders

(Source:  whiteMocca/Shutterstock.com)

Waterfall software development is a clunky but trusted process. Teams plan projects months, if not years, in advance. They lay out project requirements, architects diagram the software, coders get down to coding, and testers ensure all systems are go before the software is released into the wild.

 

That lumbering cycle is fast becoming history.

 

In modern business environments, competitive advantage rides on high-quality software. So high is this demand that the global market for custom application development services is expected to jump by $14 billion to $61 billion in the five years leading up to 2023, according to IDC. As a result, companies are increasingly prioritizing the rapid development of innovative code, prioritizing Agile software development methods instead. Today’s Agile techniques mean each of the stages of the software development lifecycle (SDLC) might be running in parallel.

 

The pressure is on: to innovate with each release cycle, to deliver high quality, and to do it all quickly, while the industry itself is staring down a talent pool that seems to be draining fast. Coders and developers are in short supply so tech-forward companies must do what they can to tighten the SDLC without compromising quality.

 

Enter: Artificial intelligence (AI).

 

AI as ally

The premise of leveraging AI is that it is a programmer’s ally, taking care of the grunt work and freeing developers and coders to focus on innovative new features instead of getting tangled up in endless debugging and maintenance.

 

Today’s AI algorithms operate along the edges delivering efficiencies in coding in a few important ways:

 

AI as coding helper

Machine learning, an application of AI, is a very sturdy workhorse. It can be put to use to help developers.

 

Most enterprises run on volumes of large code bases, some developed in-house, libraries written by third parties, and an increasing number of components downloaded from open-source development projects. Developers need to become proficient in many APIs and techniques. They often need to see how the APIs are being used already. Just combing through all of the code and learning to use it is a daunting task. Machine-learning algorithms not only trawl through code, they also remember what it looks like. So the next time coders want to learn how to code a certain snippet of an application they can simply type in a query.

 

Developers do this today by consulting experts in the area. They often go to online resources or public programming knowledge forums like Stack Overflow. This is an important means for programmers to educate themselves on the job and helps novice coders ramp up on new technologies and write better code. It also preserves tribal knowledge, which would otherwise have been lost when more experienced programmers leave. In most cases, coders don’t just copy and paste but use the results as a base for their own.

 

Much like a home amateur might type “how to fix my dishwasher” to find video tutorials online, natural language processing-driven algorithms can help coders dig through the volumes and bring up gold. In 2018, Rice University announced the launch of BAYOU, a search engine-like functionality where coders could type in a few keywords and obtain matching code snippets for use.

Figure 1: BAYOU. (Photo Credit: Rice University)

 

This machine-learning system learns to recognize coding patterns based on a large training set of millions of lines of publicly available Java programs. In response to a query, this system can provide a few ready-made snippets of code. Not only does this save time by giving the programmer a concrete example to study, it can also eliminate a lot of question-answer sessions with peers by making the programmer’s initial question already a well-informed one.

 

The primary disadvantage of using AI this way is that it enables the propagation of inelegant code. If the original code worked but was still not the most elegant solution, AI can’t fix it for you; it merely serves up the same result for repeated use.

 

AI as code tester

Quality assurance (QA) is an important part of the SDLC. Businesses have to release quality software that performs as it should. Damaging bugs could damage reputation as well. While the necessity of quality testing cannot be discounted, it too must be done quickly and efficiently. AI and ML can help in two areas.

 

The first area is compliance testing. Software in many industries must conform to a variety of industry coding, security, and safety standards. These standards keep evolving and ensuring compliance is time-consuming and tedious. AI-driven automated testing tools weave these compliance standards into the development environment. Machine-learning algorithms continuously sweep code and flag instances where code does not conform to the standard. Such automated testing allows for earlier defect detection, saving time and money, and preventing bigger headaches further down the pipeline.

 

Compliance with standards also mandates documentation to demonstrate compliance. AI-driven automated testing tools automatically generate these documents, resulting in both time saving and cost.

 

The second area is in managing the code base and making development and testing more efficient. Automated testing tools can scan through the entire code base and recognize when large chunks are repeated, highlighting such instances for repair and potentially decreasing bloat. Code that’s less bloated is easier to maintain. Eliminating duplicate code can eliminate the possibility of introducing inconsistencies (by forgetting to modify both copies) and help make the code more reliable.

 

Finally, some tools continuously monitor for code changes, correlating them with the corresponding requirements and dependencies. Any new tests need be conducted only on modified code units and their dependencies. With machine-learning techniques, it is possible to automatically learn these mappings between intent as captured in work items (tickets) and code changes. Again, this saves time and labor.

 

These AI-driven testing tools usually integrate into the Agile coding environment and work continuously, keeping pace with accelerated coding processes.

 

In all cases, AI’s role in coding is about prompting coders about mistakes and suggesting fixes. Machine learning essentially learns patterns from a large set of examples, and spots something new that matches or does not match the pattern. The programmer still has final authority on what to include — or not.

 

As Big Data, smart cities, autonomous vehicles, and other advanced technologies drive the value proposition for more computing, businesses will have to get smarter about how they leverage their coding talent. AI delivers efficiencies at the edges, greatly boosting productivity. An increasingly reliable ally, AI has the potential to help coders code faster — and better.