The most important testing that goes on in the maintenance phase is regression testing. Regression testing asks, "Does the software do today what it did yesterday?"
Regression tests often start out as bugs:
A user discovers an error.
The error is reproduced by the programmer.
The programmer fixes the error.
The code used to reproduce the error is run again to ensure that the error doesn't occur again.
From now on, every time a change is submitted, that code is run again to ensure that the error hasn't crept back in.
In the last few years, this concept has been pushed back into the development phase. Instead of the user discovering an error, the programmer discovers a new requirement. In essence, the "bug" is the lack of some particular capability. The test is a piece of code that will work when the capability is added.
This technique is called "Extreme Programming". It takes advantage of an old software development dictum: "Programming is the art of debugging a blank sheet of paper." (The Jargon File is recommended reading for all developersmaintenance and otherwise.) Extreme Programming has many other aspects (some controversial), but its habit of developing regression tests in the development phase rather than the maintenance phase makes maintenance a lot easier.