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.