Code That Heals Itself: The Cost-Benefit of Automating Software Maintenance