r/coding • • Aug 11 '15

Code transplant could revolutionize programming

http://www.wired.co.uk/news/archive/2015-07/30/code-organ-transplant-software-myscalpel
7 Upvotes

23 comments sorted by

View all comments

Show parent comments

14

u/aftli Aug 11 '15

I had the same thought. Here's the overview.

First of all, I hate the analogy. I don't really think it makes sense, and I thought I was reading an Onion article at first.

Of note:

While we do not claim automated transplantation is now a solved problem, our results are encouraging: we report that in 12 of 15 experiments, involving 5 donors and 3 hosts (all popular real-world systems), we successfully autotransplanted new functionality and passed all regression tests.

So, that said, it seems that this relies on two key things: annotation of "donor" code (think docstrings, information about every parameter, etc. - I'm not exactly sure what it implies), and the "donor" having a test suite. They analyze the "donor" code and its sort of metadata, and it seems, take random bits and pieces from that code and put it together, trying different combinations of bits of it until all of the unit tests pass.

I think, anyway. That's what I could gleam from a quick read of the overview.

This doesn't seem more useful than dynamic linking or existing solutions like "just provide the source code for the library", so I think I'm probably misreading it.

12

u/[deleted] Aug 12 '15

It appears as if the article suffers from an over-sensationalized tone.

It speaks nothing in regard to the optimization/quality of the translated code. It basically says, "hey, this can be done!" ... like, no shit! lol

5

u/Madamelic Aug 12 '15

It speaks nothing in regard to the optimization/quality of the translated code.

I think this is the most important part of this.

This process is nothing if code can't be maintained or understood. Although, I guess we could just let 'MuScalpel' create spaghetti code on top of spaghetti code.

5

u/I_Like_Spaghetti Aug 12 '15

(╯ಠ_ಠ)╯︵ ┻━┻

4

u/chemicalcomfort Aug 12 '15

B-b-but I thought you liked spaghetti... :(