The US tested its last nuclear weapon on 23 Sep, 1992. It was the 1030th test conducted by our nation. The Russians had quit testing several months earlier, and several other nations (primarily new nuclear states) have tested weapons since. China tested its last weapon in 1996.
Although it is possible that some clandestine testing has been going on, we have highly advanced seismic technology to detect it, and we have satellite monitoring of facilities, so even though it may be possible for a country to have a successful secret nuclear program, it is unlikely they can conduct a test program without our knowing about it.
I don’t know anything about nukes, but I do know they have a shelf life. Stuff wears out, components age, and parts and materials need to be periodically replaced, or at least, subsystems like detonators need to be tested to make sure they still work. And of course, I’m sure many components are updated or even redesigned, and they have to be integrated into existing weapons. Not only are the nuclear explosives themselves vulnerable to obsolescence and even entropy, ancillary systems such as fuses, triggers, safety and security systems and so on must be replaced from time to time. Delivery systems are constantly changing, too. I presume warheads must occasionally be modified to fit and integrate them to new munitions and vehicles.
These are highly complex systems, and when we go about updating them they need to be tested. All complex systems need to be tested after undergoing modifications. I understand we rely a lot on computer simulations now to investigate how mods will work out. What could possibly go wrong, eh?
The only thing worse than a nuke that goes off unexpectedly is one that doesn’t when its supposed to.