North Korean claims to have a nuclear weapon are thought to be based on the purchase of a complete, tested, bomb from Pakistan or Russia. At least that's the wide-spread rumor. Without a bomb from those sources, any North Korean made bomb would be suspect unless they had tested their design. These tests, even if underground, would be detected. And these tests sometimes fail. This was seen with the many tests Pakistan performed in the late 1990s. Some of these tests were failed designs, and this could be detected by the way the tests went.