Software development is a meticulous process, often requiring a series of small steps, each contributing to a robust codebase’s evolution. The interaction between human developers, code reviewers, bug reporters, software architects, and various software tools forms a dialogue that guides the creation and refinement of software1.
Recently, Google has introduced an innovative approach to training machine learning models for software development. This technique, known as DIDACT (Dynamic Integrated Developer ACTivity), uses the software development process as the source of training data. Unlike conventional methods that rely on the finished code as a learning resource, DIDACT exposes the model to the contexts and actions developers take during their work. This approach aligns the model with how developers spend their time, and the results are extremely promising1.
The DIDACT Methodology
Google’s software engineering toolchains store every operation related to code as a log of interactions between tools and developers. This record essentially serves as a “software engineering video” of how Google’s codebase came to be, offering an in-depth look at the step-by-step evolution of code1.
To harness this wealth of data, DIDACT employs a strategy called the “state-intent-action” formalism. In this setup, the state represents a code file, the intent refers to annotations specific to the activity (such as code-review comments or compiler errors), and the action is the operation to address the task. The actions are expressed in a mini programming language called DevScript, which can be extended for newly added activities. This methodology allows for the efficient and interpretable prediction of complex actions, such as a variable rename that might touch a file in dozens of places1.
DIDACT in Action
Google has internally deployed three DIDACT tools: Comment Resolution, Build Repair, and Tip Prediction. These tools, integrated at various stages of the development workflow, have received enthusiastic feedback from thousands of internal developers. This positive response from professional developers, who are experts on the code base and have carefully honed workflows, attests to the utility of these tools in enhancing productivity.
One of the unique abilities of DIDACT is its potential to serve as a general-purpose developer-assistance agent. The trained model can be used unexpectedly, from suggesting responses to developer activities to chaining multiple predictions to map out longer activity trajectories. This approach is paving the way for the development of agents to assist across the software development process.
For instance, DIDACT excels in code clean-up tasks, examining the code along with the final comments by the code reviewer and predicting edits to address those comments. Its multimodal nature also enables history augmentation, which helps the model make better predictions about what the developer might do next based on their recent actions.
Additionally, DIDACT has demonstrated impressive capabilities in history-augmented code completion and edit prediction. The model can correctly predict the docstring entry for a new function parameter and decide where to edit the text in a way that aligns with the developer’s historical actions.
Perhaps most impressively, DIDACT can develop code step-by-step that mirrors a human developer’s process. For example, the model created a fully functional code file, starting with a basic skeleton and gradually adding new functionality, such as reading from a file, writing results, and adding user-provided regular expressions.
Conclusion
DIDACT is transforming the software development process at Google. Converting software development actions into training demonstrations creates models that construct code in a step-by-step, interactive fashion. This approach offers promising tools for developers and sets the stage for future advancements in machine learning-assisted software development.
As we move forward, we can expect to see greater AI integration into the software development world. Google’s DIDACT is just the beginning of this journey, highlighting the potential of machine learning to understand and assist with the complex, dynamic process of creating and refining code. By harnessing the power of AI in this way, we can look forward to a future where developers are supported by intelligent tools that help them navigate the challenges of their work, leading to more efficient, high-quality software development processes.