You can replace the battery, but if its the rectifier you will run fine for a while until the battery discharges then the bike will quit. Short runs will likely not "prove" the fault. I had a bad rectifier on a HD, it ran fine on the short hauls... would sit a while and recharge enough to start.
A 5 yo battery is a failure waiting to happen. It may simply not be able to handle the load anymore, so no matter what the rectifier does it will eventually discharge enough to be a problem.
To test the charging system, you should be able to start the bike and put a tester across the battery terminals...(+/+ and -/-). 25VDC range on the tester. At 3000 rpm the bike tester should read between 14 and 15v.
If the voltage is a lot higher than 15v then the rectifier is bad or the reg/rect wires could be loose/open/etc.
If the v is a lot lower than 14v then its either the rectifier or you have a load problem on the alternator.
Obviously of the charging system is within spec, you have a battery problem.