Possible in JavaScript. JSLint (jslint.com) is a tool written in JavaScript, to detect bad parts in a JavaScript snippet.
I've seen systems that program themselves to either solve problems or optimize their algorithms to run things either faster or more efficiently. Typically these are used in FPGA.
Yes it is, and the solution might not be so futuristic as everyone seems to think.
First, what is a bug? Is it a bad code implementation? An unexpected input, caused by an user, or problematic hardware?
For each one of the possible causes of a "bug", your software must be able to execute and debug itself simultaneously, in order to keep track of its own actions. You also need a process that uses a list of known patterns for common "programming errors" / "best practices" to identify possible pieces of code that might be causing unexpected behaviors, the biggest trick here is to have another process that replaces the identified bad practices with good ones.
If the issue is caused by a bad implementation, one possible solution for it is to have a different implementation for the same function, to check if the software is producing the expected result or not. Or in alternative, you might create "step by step" tests to validate the same process.
The next part, (maybe not the most difficult one) is to create a process that works as a time-machine to "go back in time", (like an auditer), that saves the state of the application in different execution times, as all the changes produced by the software.
When an unexpected result is caught, the software should be able to trace back the error root, identify the cause, patch itself with one solution from your pattern list, run the application again from a saved state before the bug happened and use the auditer to reproduce the inputs after the bug, to try to achieve the wanted result.
If the result is still not the expected, another solution is applied, and it repeats this last steps until the expected result is found.
I must add that my solution for this problem, is not applicable to any kind of software, it is far from perfect, and maybe some steps could be very difficult "software problems" that not any programmer can solve (everyone can try), but all processes here are "doable".
In conclusion, what you asked is definitely possible and most of the processes that I described already exist in software nowadays. However, the cost of implementing a software like this, and the difficulty to have a good code replacement tool makes it very difficult to implement, or adjust and expensive. It also can cause slower execution times, every time the software patches itself.
In any case, I strongly believe that this sort of "self assisted" / "self fixable" software, will sooner or later make its way into the IT world, very likely as a software improvement tool , with or without AI.
Great question! The futurist in me loves to think about these types of things.
Someday I think that software will not only identify and fix bugs, but also write whole applications. I imagine developers would still be needed to give such software detailed instructions on what to build and I’m sure it will be a technical skill just as it is today. Just another layer of abstraction and in my opinion, the natural progression of the industry over the next few decades.
As for today, as Mev-Rael pointed out, there are lots of existing tools (IDE’s, compilers, linting scripts, etc) that can point out certain types of code mistakes. It’s not hard to imagine software having some sort of playbook/strategy guide in which to look up solutions, then branch the code and insert/retest the changes. A developer would likely still have to manually confirm the changes and re-merge, but I’d say that this would meet a loose definition of your question.
But to Mev-Rael and j points, I think we are a long, long way away from a software program being able to reason HOW an application should work and fix any bug that that doesn’t throw a specific error of some sort.
Some day, probably, real AI will come and will be able to change the own code if it will have access to it, but even in that case I am not sure about bugs.
It depends on what kind of bugs, many IDEs already are helping you with basic syntax errors and other problems, there is even a startup using ML and StackOverflow to fix common problems on the fly. However, logical and real problems can't be solved looking only on the code, it requires a wider look on the knowledge outside of that scope, what goal and requirements that software should pursuit. Basically solving a bug is usually simple and fast task, while finding answer to the questions like "Is it working as expected?", "Is it what we need?", "Why it's not working, where is a problem?" is not simple.
If that software:
then yes, software can find and fix some of it's parts (but never all, especially on core level) itself, however, the main problem with AI today is "can reason".
I think it is hard to do and almost impossible to do so
but great determination may lead to such a cool goal
before 10 years we thougt that mars exploration is impossible but now it's possible
hence we can made it
very cool idea but very hard and tough
that would need intelligence of knowing what the purpose should be / what the deterministic of it self should be.
So in theory we could do some of it. But it's hard to do so I guess it could duplicate it self in an evolved form and so find out if it's programming was improved / fixed. basically what our bodies do.
Cool and hard topic :D ....
Prince Owen
Bugs seem to be mainly caused by the programmer's mistakes, so of course not. Except well, you're talking about a programmer robot, that could create a whole software on it's own(crazy..LOL... :) ), but there'll be no bugs for it to fix because computers don't make mistakes, we do!