Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Saturday, 28 May 2016

Automatic bug finder - Analysis Practical Coding

Automatic bug finder. System could make complex analysis practical for programs that import huge swaths of code.


Scientia — Symbolic execution is a powerful software-analysis tool that can be used to automatically locate and even repair programming bugs. Essentially, it traces out every path that a program’s execution might take.


Automatic bug finder, analysis , coding, computer science, code, programming , frameworks


But it tends not to work well with applications written using today’s programming frameworks. An application might consist of only 1,000 lines of new code, but it will generally import functions — such as those that handle virtual buttons — from a programming framework, which includes huge libraries of frequently reused code. The additional burden of evaluating the imported code makes symbolic execution prohibitively time consuming.


Computer scientists address this problem by creating simple models of the imported libraries, which describe their interactions with new programs but don’t require line-by-line evaluation of their code. Building the models, however, is labor-intensive and error prone, and the models require regular updates, as programming frameworks are constantly evolving.


Researchers at MIT’s Computer Science and Artificial Intelligence Laboratory, working with colleagues at the University of Maryland, have taken an important step toward enabling symbolic execution of applications written using programming frameworks, with a system that automatically constructs models of framework libraries.





The researchers compared a model generated by their system with a widely used model of Java’s standard library of graphical-user-interface components, which had been laboriously constructed over a period of years. They found that their new model plugged several holes in the hand-coded one.


They described their results in a paper they presented last week at the International Conference on Software Engineering. Their work was funded by the National Science Foundation’s Expeditions Program.


“Forty years ago, if you wanted to write a program, you went in, you wrote the code, and basically all the code you wrote was the code that executed,” says Armando Solar-Lezama, an associate professor of electrical engineering and computer science at MIT, whose group led the new work. “But today, if you want to write a program, you go and bring in these huge frameworks and these huge pieces of functionality that you then glue together, and you write a little code to get them to interact with each other. If you don’t understand what that big framework is doing, you’re not even going to know where your program is going to start executing.”


Consequently, a program analyzer can’t just dispense with the framework code and concentrate on the newly written code. But symbolic execution works by stepping through every instruction that a program executes for a wide range of input values. That process becomes untenable if the analyzer has to evaluate every instruction involved in adding a virtual button to a window — the positioning of the button on the screen, the movement of the button when the user scrolls down the window, the button’s change of appearance when it’s pressed, and so on.


For purposes of analysis, all that matters is what happens when the button is pressed, so that’s the only aspect of the button’s functionality that a framework model needs to capture. More precisely, the model describes only what happens when code imported from a standard programming framework returns control of a program to newly written code.


“The only thing we care about is what crosses the boundary between the application and the framework,” says Xiaokang Qiu, a postdoc in Solar-Lezama’s lab and a co-author on the new paper. “The framework itself is like a black box that we want to abstract away.”


To generate their model, the researchers ran a suite of tutorials designed to teach novices how to program in Java. Their system automatically tracked the interactions between the tutorial code and the framework code that the tutorials imported.


“The nice thing about tutorials is that they’re designed to help people understand how the framework works, so they’re also a good way to teach the synthesizer how the framework works,” Solar-Lezama says. “The problem is that if I just show you a trace of what my program did, there’s an infinite set of programs that could behave like that trace.”





To winnow down that set of possibilities, the researchers’ system tries to fit the program traces to a set of standard software “design patterns.” First proposed in the late 1970s and popularized in a 1995 book called “Design Patterns,” design patterns are based on the idea that most problems in software engineering fit into just a few categories, and their solutions have just a few general shapes.


Computer scientists have identified roughly 20 design patterns that describe communication between different components of a computer program. Solar-Lezama, Qiu, and their Maryland colleagues — Jinseong Jeon, Jonathan Fetter-Degges, and Jeffrey Foster — built four such patterns into their new system, which they call Pasket, for “pattern sketcher.” For any given group of program traces, Pasket tries to fit it to each of the design patterns, selecting only the one that works best.


Because a given design pattern needs to describe solutions to a huge range of problems that vary in their particulars, in the computer science literature, they’re described in very general terms. Fortunately, Solar-Lezama has spent much of his career developing a system, called Sketch, that takes general descriptions of program functionality and fills in the low-level computational details. Sketch is the basis of most of his group’s original research, and it’s what reconciles design patterns and program traces in Pasket.


“The availability of models for frameworks such as Swing [Java’s library of graphical-user-interface components] and Android is critical for enabling symbolic execution of applications built using these frameworks,” says Rajiv Gupta, a professor of computer science and engineering at the University of California at Riverside. “At present, framework models are developed and maintained manually. This work offers a compelling demonstration of how far synthesis technology has advanced. The scalability of Pasket is impressive — in a few minutes, it synthesized nearly 2,700 lines of code. Moreover, the generated models compare favorably with manually created ones.”




– Credit and Resource –


Larry Hardesty | MIT News Office




Automatic bug finder - Analysis Practical Coding

Monday, 4 April 2016

Programming language for living cells

A programming language for living cells. New programming language lets researchers design novel biological circuits.


Scientia — MIT biological engineers have created a programming language that allows them to rapidly design complex, DNA-encoded circuits that give new functions to living cells.


Using this language, anyone can write a program for the function they want, such as detecting and responding to certain environmental conditions. They can then generate a DNA sequence that will achieve it.


“It is literally a programming language for bacteria,” says Christopher Voigt, an MIT professor of biological engineering. “You use a text-based language, just like you’re programming a computer. Then you take that text and you compile it and it turns it into a DNA sequence that you put into the cell, and the circuit runs inside the cell.”





Voigt and colleagues at Boston University and the National Institute of Standards and Technology have used this language, which they describe in the April 1 issue of Science, to build circuits that can detect up to three inputs and respond in different ways. Future applications for this kind of programming include designing bacterial cells that can produce a cancer drug when they detect a tumor, or creating yeast cells that can halt their own fermentation process if too many toxic byproducts build up.


The researchers plan to make the user design interface available on the Web.


No experience needed

Over the past 15 years, biologists and engineers have designed many genetic parts, such as sensors, memory switches, and biological clocks, that can be combined to modify existing cell functions and add new ones.


However, designing each circuit is a laborious process that requires great expertise and often a lot of trial and error. “You have to have this really intimate knowledge of how those pieces are going to work and how they’re going to come together,” Voigt says.


Users of the new programming language, however, need no special knowledge of genetic engineering.


“You could be completely naive as to how any of it works. That’s what’s really different about this,” Voigt says. “You could be a student in high school and go onto the Web-based server and type out the program you want, and it spits back the DNA sequence.”


The language is based on Verilog, which is commonly used to program computer chips. To create a version of the language that would work for cells, the researchers designed computing elements such as logic gates and sensors that can be encoded in a bacterial cell’s DNA. The sensors can detect different compounds, such as oxygen or glucose, as well as light, temperature, acidity, and other environmental conditions. Users can also add their own sensors. “It’s very customizable,” Voigt says.


The biggest challenge, he says, was designing the 14 logic gates used in the circuits so that they wouldn’t interfere with each other once placed in the complex environment of a living cell.





In the current version of the programming language, these genetic parts are optimized for E. coli, but the researchers are working on expanding the language for other strains of bacteria, including Bacteroides, commonly found in the human gut, and Pseudomonas, which often lives in plant roots, as well as the yeast Saccharomyces cerevisiae. This would allow users to write a single program and then compile it for different organisms to get the right DNA sequence for each one.


Biological circuits

Using this language, the researchers programmed 60 circuits with different functions, and 45 of them worked correctly the first time they were tested. Many of the circuits were designed to measure one or more environmental conditions, such as oxygen level or glucose concentration, and respond accordingly. Another circuit was designed to rank three different inputs and then respond based on the priority of each one.


One of the new circuits is the largest biological circuit ever built, containing seven logic gates and about 12,000 base pairs of DNA.


Another advantage of this technique is its speed. Until now, “it would take years to build these types of circuits. Now you just hit the button and immediately get a DNA sequence to test,” Voigt says.


His team plans to work on several different applications using this approach: bacteria that can be swallowed to aid in digestion of lactose; bacteria that can live on plant roots and produce insecticide if they sense the plant is under attack; and yeast that can be engineered to shut off when they are producing too many toxic byproducts in a fermentation reactor.


The lead author of the Science paper is MIT graduate student Alec Nielsen. Other authors are former MIT postdoc Bryan Der, MIT postdoc Jonghyeon Shin, Boston University graduate student Prashant Vaidyanathan, Boston University associate professor Douglas Densmore, and National Institute of Standards and Technology researchers Vanya Paralanov, Elizabeth Strychalski, and David Ross.




– Credit and Resource –


Anne Trafton | MIT News Office




Programming language for living cells