Osteoporosis is diagnosed through bone density tests, such as dual-energy X-ray absorptiometry (DEXA) scans, which measure bone mineral density (BMD).