This blog post looks into which methods and technologies could potentially lead to the replacement of coders in the future — some futuristic, and some more "low-hanging" with respect to automating parts of coding.
The background for this post is a paper by Jay Jay Billings, Alexander J. McCaskey, Geoffroy Vallee, and Greg Watson at Oak Ridge National Laboratory: Will humans even write code in 2040 and what would that mean for extreme heterogeneity in computing?.
Also related is (Tesla AI director) Andrej Karpathy's article Software 2.0, where he looks back at how AI (primarily Deep Learning) replaced custom methods for image and speech recognition and machine translation, and generalizes how Deep Learning can further replace other software in years to come (exemplified by Google's recent paper The Case for Learned Index Structures).
1. FACT: Programming Environments (IDEs) Have Barely Changed in 30 Years
One of the primary purposes of programming is to provide efficient automation, yet programming itself remains a highly manual and labor-intensive process. Except for refactoring, the difference between modern IDEs and Turbo Pascal 5.5 in 1989 is surprisingly small.
Turbo Pascal 5.5 in 1989
Eclipse in 2017
2. FACT: For (Close to) All Functions Written, Tests Already Exist
For nearly any method written (or to be written) in popular languages, there already exists a test for it — in the same language or a similar one (for example, a C# test for a Java function). The obvious big data source for this is all public and private repositories on GitHub (100M pull requests merged so far in 2017).
So why are most developers still writing unit tests instead of having an IDE or service find and translate appropriate tests for the functions they write? (for instance, along the lines of IntelliTest)
3. FACT: As in 2 — For (Close to) All Tests, Functions Exist That Satisfy Them
In Test-Driven Development (TDD), you roughly write the test for the new API first and then alternate between writing just enough code to fulfill it. Automating the function-writing side has two main paths:
- Search for an existing function matching a set of tests — instead of writing the function, just write the tests.
- Automatically generate code fragments to fulfill the test, which could be done in several ways:
- Brute force with many computers (e.g., a few thousand CPUs in the cloud quickly generating and selecting the best of 30–50 increments per test iteration — see The Science of Brute Force).
- Sophisticated AI methods with GPUs — e.g., Program Synthesis with Deep Learning and earlier methods such as John Koza's Genetic Programming.
- Quantum computing — e.g., Logic Synthesis with Quantum Computing (see also Microsoft's Quantum Development Kit).
4. FACT: Many Data Structures Can Now Be Replaced by AI (Bloom Filters & B-Trees)
Google — Tim Kraska, Alex Beutel, Ed H. Chi, Jeffrey Dean, and Neoklis Polyzotis — published The Case for Learned Index Structures, showing that traditional data structures such as B-Trees, Hash Indexes, and Bloom Filters can be advantageously replaced by AI-trained index structures. This is groundbreaking research, and it will be interesting to see what the use cases become for program synthesis (both for other categories of data structures and logic operating on them). Key result figures from their paper:
5. FACT: Formal Methods Are Starting to Work and Can Support Code Automation
Amazon has used formal methods since 2011 for AWS, e.g., to ensure the quality of S3 (see Use of Formal Methods at Amazon). Facebook uses formal methods for mobile app quality assurance (see Moving Fast with Software Verification). Formal methods have also been used to validate blockchain protocols, e.g., A Temporal Blockchain: A Formal Analysis and Validation of Decentralised Smart Contracts Through Game Theory and Formal Methods.
A few years back I participated in a research project — Envisage (Engineering Virtualized Services) — where formal methods were used to prove that the TimSort algorithm was buggy across many languages (see Hacker News discussion below). Formal methods can potentially be paired with code-generating methods to ensure that generated code is correct.
Conclusion
These technologies show multiple paths that may play a role in automating coding going forward — including sequence-to-sequence deep learning combined with GANs for synthesis, such as Text2Action: Generative Adversarial Synthesis from Language to Action.
Amund Tveit