Fixing 'Tedious and Error-Prone' Computer Programming
You've now been exposed to augmented reality in computer programming (thanks, Pokémon Go), now say hello to computer augmented program engineering, "in which a programmer and an automated program-synthesis tool collaborate to generate software that meets its specification."
That's the idea behind ExCAPE (Expeditions in Computer Augmented Program Engineering), a research project funded by the National Science Foundation (NSF).
The NSF discussed the project in an article published yesterday, titled "Computer Programming Made Easier."
The article explains that ExCAPE aims to address a longstanding problem described by a lead researcher, Rajeev Alur at the University of Pennsylvania: "Software development remains a tedious and error-prone activity."
The project seeks to transform the way software is developed by reducing some of the human-generated errors from the process, replacing manual programmer actions through advancements made in the theory and practice of software synthesis.
In other words, the ExCAPE Web site says, "In the proposed paradigm, a programmer can express insights through a variety of forms such as incomplete programs, example behaviors, and high-level requirements, and the synthesis tool generates the implementation relying on powerful analysis algorithms and programmer collaboration."
With lofty goals to someday simplify computer programming on a broad scale, initial efforts have focused on four challenging problems: developing efficient concurrent data structures; developing protocols for on-chip interconnection networks; developing distributed routing network protocols; and end-user programming for autonomous robots.
One distinguishing feature of the new approach is flexibility in the way programmers can express insights to guide the program-synthesis tool, the NSF said. Depending upon the specific development task, programmers can express insights through means such as: incomplete programs; declarative specifications of high-level requirements; positive and negative examples of desired behaviors; and optimization criteria for selecting among alternative implementations.
For example, the programming of autonomous robots can be guided through the demonstration of example behaviors. Along with examples and demonstrations, developers can also express their intents through means such as commands spoken in natural language.
"The synthesis tool uses a range of computational approaches and developer interaction to compose these different views about the structure and functionality of the system into a unified, concrete implementation," the project site says. "The computational techniques include decision procedures for constraint-satisfaction problems; iterative schemes for abstraction and refinement; and data-driven learning. The methodology for programmer interaction moves verification from the back-end of the design cycle to the front-end, with the promise of a more reliable software product."
The research project has received grants totaling more than $9 million, covering research from 2012 through 2017.
While the goal of broadly revolutionizing computer programming remains to be realized, several offshoot developments have already been achieved, resulting in new tools such as NetEgg, which "lets a network operator specify the desired functionality of a switch using examples," according to the NSF article. "NetEgg then automatically generates the code needed to implement that behavior while ensuring maximal throughput for network traffic."
Other benefits realized by the research listed in the NSF article include Automata Tutor "to help students learn automata theory and to help teachers prepare exercises and problem sets." It's already being used by more than 10 universities to help more than 5,000 students, NSF said.
AutoProf, another tool mentioned by the NSF, can provide automated feedback about problems in Python functions, for example.
CPSgrader, yet another tool, was built to automatically grade laboratory courses and generate feedback.
The ExCAPE research into syntax-guided synthesis has also made its mark in commercial software via companies such as Microsoft, which was inspired to create its own automated program synthesizers, the NSF said.
"At Microsoft, we have invested significantly in the field of program synthesis, especially programming-by-examples, and with applications to end-user programming," the NSF quoted Microsoft Research exec Sumit Gulwani as saying.
"Microsoft started out by developing domain-specific synthesizers such as FlashFill and FlashExtract, each of which uses examples to generate custom code that improves efficiency," the NSF said in yesterday's article. "FlashFill, which was released as a feature of Microsoft's Excel 2013, allows data entered into one column of a worksheet table to be entered in a new table column using only a few keystrokes. FlashExtract, which was included in Microsoft's PowerShell and Operations Management Suite, extracts structured data from semi-structured log files using examples."
The ExCAPE site also lists many other research initiatives, ranging from addressing the special challenges of mobile app development to solver-aided languages research to explore the rapid creation of synthesizers in a prototyping fashion.
The research project is a collaborative effort involving the University of Pennsylvania, Cornell University, University of California-Berkeley, Rice, UCLA, University of Maryland, MIT, University of Michigan and the University of Illinois at Urbana-Champaign.
"This project builds on decades of foundational advances in formal methods and programming languages," said NSF exec Nina Amla in yesterday's NSF article. "It signals a paradigm shift in the way we teach basic programming principles, and develop reliable software systems."
If so, tomorrow's programming is going to be a lot more advanced than today's programming.
David Ramel is the editor of Visual Studio Magazine.