Background:In recent years, HIV testing has become one of the effective strategies to reduce the risk of the disease. Frequent HIV testing can be cost effective. Therefore, an in-depth study of factors related to the testing behavior of men who have sex with men (MSM) were analyzed to optimize intervention strategies.Methods:From March 2011 to October 2018, the project was carried out in a Tianjin bathhouse, and 5165 MSM were surveyed using snowball sampling. Factors related to HIV testing behavior were analyzed by multi-level multiple logistic regression analysis after grouping according to testing frequency, and comprehensive analysis was performed.Results:The multivariate logistic analysis showed that 6 variables including young MSM(OR=0.67, 95% CI: 0.49-0.92, P=0.01), low-education MSM (OR=0.60, 95% CI: 0.47-0.76, P <0.0001), low AIDS knowledge (95% CI: 0.22-0.29, P <0.0001), marital status(OR = 1.30, 95% CI: 1.07-1.58, p = 0.007), acceptance of condom promotion and distribution(OR = 10.98, 95% CI: 8.33-14.47, p <0.0001), and frequency of condom use(p <0.05) could link to HIV testing behaviors.Conclusions:In order to achieve the 90-90-90 goal, targeted publicity and education and promote self-testing kit should be carried out to encourage frequent HIV testing, mainly including Young MSM (especially students), low-education people, married MSM and those who cannot keep using condoms during anal sex.