Actually, only underground tests truly limit damage. There are three destructive effects from a bomb. The explosion itself, the fission products from the bomb, and the radioisotopes bred from high neutron flux impacting surrounding materials.
Tests are conducted away from civilization, which lowers the impact of all forms of damage. However, the above ground tests were conducted generally on the surface with only a few exceptions, which would have increased the amount of radioactive fallout due to neutron activation. In contrast, actual use of a nuclear weapon would be in air bursts which would generate very little activated fallout.
Also, the total number and yield of nuclear weapons now in all arsenals would probably not be sufficient to kill even 50% of the world's population. Much of the world lives in high density areas, but much does not. The total area that the world's population lives on is extremely large and only a small percentage of it could be destroyed through nuclear weapons. Though the industrial and economic collapse would lead to massive starvation which would cause even more delayed deaths, but it's difficult to estimate such things.
Tests are conducted away from civilization, which lowers the impact of all forms of damage. However, the above ground tests were conducted generally on the surface with only a few exceptions, which would have increased the amount of radioactive fallout due to neutron activation. In contrast, actual use of a nuclear weapon would be in air bursts which would generate very little activated fallout.
Also, the total number and yield of nuclear weapons now in all arsenals would probably not be sufficient to kill even 50% of the world's population. Much of the world lives in high density areas, but much does not. The total area that the world's population lives on is extremely large and only a small percentage of it could be destroyed through nuclear weapons. Though the industrial and economic collapse would lead to massive starvation which would cause even more delayed deaths, but it's difficult to estimate such things.