The association between testosterone deficiency and insulin resistance in men with type 2 diabetes is well established and current endocrine society guidelines recommend the measurement of testosterone levels in all men with type 2 diabetes or erectile dysfunction .