Gender observation and testing for women has been practiced at the Olympic games since around 1960s. The mandatory practice is believed to have started after an athlete failed a gender chromosome test in 1966. Testing is used to detect male athletes posing as women to gain a competitive advantage in the games.
Female athletes participating in the 1976 Olympics in Montreal also had to take a gender test. The only exception is believed to have been made for Princess Anne, daughter of Queen Elizabeth II, who was competing as a member of the UK equestrian team. Some argue that this may not be true since men and women compete against one another in equestrian games. The popular belief, however, is that Princess Anne was the only Olympic woman athlete to have been exempt from gender testing when the practice was mandatory.
As of 1999, gender testing at the Olympics was not mandatory. However, if suspicions arise over a particular female athlete, the International Olympic Committee may request a gender test. Gender testing in the Olympics has long been a controversial issue due to the lack of completely reliable testing methods. Testing methods have varied over the years with physical examinations, chromosomal testing and hormonal testing.
More about Olympics gender testing:
I am very suspicious if it comes to Serena Williams' gender clarity. Is/was she tested diligently or is her fame protecting her?