1 Urinalysis-also analyzes sugar and hormone levels that may indicate diabetes, as well as kidney dysfunction and testosterone deficiency. 2  In some men, further tests may be required in order to help identify the cause of ED.