How do they test nucs underground?

How do they go about testing a nuclear bomb underground, and what do they learn about its performance? How does this simulate actual bomb performance? What are the scientists hoping to learn form these underground tests? (Or, are they just glad it works?) - Jinx

A lot of the time it was just making sure it went bang. They wanted to try out different designs and there was also the problem that, left to themselves, H-bombs tend to deteriorate.
In practice, you just basically detonate one in a specially carved cavern underground. Personally, however, the most gobsmacking aspect of the tests was that many had channels leading to sets of intruments with doors in the tunnel: the blast would slam the doors shut, protecting the instuments to the extent that they could transmit information about the initial flash.
William J. Broad’s book Teller’s War (Simon & Schuster, 1992) has a fair amount of details about testing. This is because it’s about the infamous Star Wars X-ray laser design that was supposed to be triggered by a nuclear weapon. The development tests thus involved instrumenting a “laser” in close proximity to a nuclear test and reading off the results. The project failed, but precisely because they could record such measurements.