Using data from a study that randomly assigns offers of HIV testing in two urban centers in East Africa, I examine the effects of testing, taking into account people's beliefs of their HIV status prior to testing. I objectively measure risky sexual behavior using sexually transmitted infections (STIs) contracted during the 6 month study as proxies. Individuals surprised by an HIV-positive test are over nine times more likely to contract an STI indicating an increase in risky sexual behavior. Individuals surprised by an HIV-negative test are 84% less likely to contract an STI indicating a decrease in risky sexual behavior. Using these estimates, I simulate the effects of testing on new HIV infections. I find the overall number of HIV infections increases by 30% when people are tested compared to when they are unaware of their status - an unintended consequence of testing.