What leads you to believe it's time to replace them?
Battery life is measured in cycles, not length of time in service. The cycle rating of batteries is dependent on the construction of the battery and typical depth of discharge of each cycle. Frequent deep discharges shortens battery life as does chronic under or over charging. So the battery that does a really great job for me might not fare so well under the conditions you have. If your batteries have lived much of their life dockside, they may have many cycles left. It's not enough to look at the battery, as it's only one piece of the puzzle. Better to take a system approach and consider the battery as a part of the system, and insure that the battery is a good fit within that system.
If you spend a great deal of time at anchor and your bank is routinely not fully floated, anticipate shorter life. How is your bank recharged?What is the AH capacity of the bank? What's your typical DOD% (depth of discharge)per cycle? Does recharging always charge fully to float? Any solar? Is your engine capable of fully recharging the bank? Smart charger? Smart alternator regulator? Battery temperature controlled charging? All impact life expectancy, and the better your system is at returning the bank to 100% recharge, the longer the bank will last.
If there is some question about the present condition of the bank, if it's flooded a test of the SG (specific gravity) of the electrolyte could give some indication of the condition. Load testing would augment that, and provide additional input in determining battery life status.