(CNN) -- Middle-distance runner Caster Semenya carried the South African flag last month in opening ceremonies for the 2012 Olympic Games in London.
That was quite a change for the powerhouse runner, who three years ago was scrutinized for issues other than her athletic performance before being cleared to compete.
Semenya gained attention in 2009 before the World Championships in Berlin -- not for her athletic prowess, but because some questioned the then-18-year-old's gender.
Her masculine appearance had raised concerns and complaints to the International Association of Athletics Federations, the governing body for all international athletic competitions outside the Olympics.
Before the World Championships began, the IAAF confirmed Semenya was being tested for gender verification.
The concept of gender testing for athletes is not new. Various methods have been used to assure that men do not compete as women, which would give them an unfair athletic advantage.
While both men and women produce testosterone in their bodies, in men it produces more muscle, adding to athletic prowess. Women use testosterone to produce estrogen, the female hormone.
This year, the London Olympic Committee instituted a new testing policy that measures testosterone levels of female athletes, rather than DNA. The testing is performed only if questions are raised about a female athlete's performance, and must be requested by a chief medical officer of a national Olympic committee or a member of the International Olympic Committee's medical commission.
While Semenya won the gold medal in the women's 800-meter in 2009, the win was overshadowed by the gender questions, and her competitors complained she should not have been allowed to compete.
On September 11, 2009, Australia's Daily Telegraph reported information from "a source closely involved with the Semenya examinations IAAF testing," which revealed that she had both male and female sexual characteristics.
Semenya had no womb or ovaries, according to the report, and had undescended testes, causing her to have triple the levels of testosterone of other female athletes.
While the politically incorrect term for people who possess both male and female sexual characteristics is hermaphrodite, the proper term is "intersex."
The IAAF advised Semenya to get surgery because of the potential health issues caused by her condition. No public information was provided about her treatment.
Gender testing has been the subject of debate, and different testing methods -- hair patterns, chromosome testing, individual gene testing -- have been used, but no method is perfect.
"There's no simple test to determine gender, so what we're left with is an imperfect system," says Dr. Eric Vilain, a UCLA medical geneticist who served as a medical adviser to the IOC on its new policy for testing female athletes for "hyperandrogenism" -- meaning producing too many male hormones.
Critics of the female "hyperandrogenism" testing include professors Rebecca Jordan-Young and Katrina Karkazis of Barnard College and Stanford University, respectively.
The two say the "new sex testing policy threatens to ban women whose bodies produce high levels of testosterone."
They argue in an editorial published in the Guardian that "faulty logic ... links two common but inaccurate assertions about testosterone."
"The first is that male and female elite athletes have clear and distinct testosterone levels. ... The IOC then projects this supposed gap onto differences in male and female athletic performance, claiming they 'differ mainly due to the fact that men produce significantly more androgenic hormones than women.'"
Vilain disagrees, saying that "there's a huge no man's land" between male and female testosterone levels.
He also suggests "there could be no testing, which has been argued," by Jordan-Young and Karkazis, "but the vast majority of female athletes I have spoken with believe there should be some sort of testing" when questions are raised about female athletes.
The IOC regulations state that "the performance of male and female athletes may differ mainly due to the fact that men produce significantly more androgenic hormones than women and, therefore, are under stronger influence of such hormones."
Women who are found to have abnormally high levels of androgens may have an unfair advantage, according to the regulations.
The IOC also notes, "Nothing in these regulations is intended to make any determination of sex. Instead these regulations are designed to identify circumstances in which a particular athlete will not be eligible (by reason of hormonal characteristics) to participate in the 2012 Olympic Games" in the female category.
Vilain says he believes it would be "extraordinarily difficult" for women to reach the male range threshold for testosterone, which is not spelled out by the IOC because of differing lab testing methods.
He says that for the small number of female athletes who learn they have high levels of testosterone, treating the condition, whether it is caused by a disorder of sex development or an adrenal malfunction, will benefit their health.