Although most of the modern units test batteries periodically, if is always good to power the UPS every 6 months.
This is done by switching the power off to the UPS and monitoring DC voltage. Once the batteries reach 20% capacity, re-instating power. This cycles the battery, prolonging their service life.
If the batteries do not perform to specification, they should be replaced by a qualified service technician and old batteries disposed of correctly.