To assess sexual performance, your doctor might conduct an overnight erection test. During this test, you'll wear a device around your penis while sleeping to measure the frequency and strength of erections.