WHAT does it take to be a good soldier? Courage? Loyalty? Respect for the Geneva Conventions? Yes, yes, but for the Indonesian army, if a new recruit is a woman, she must also be a virgin. Those who have sex before marriage are immoral, top brass insist, and so cannot be trusted to defend the country. Also, male officers might wish to marry their female comrades-in-arms, so it is essential that they be pure. Hence the “virginity tests” to which new recruits are subjected: doctors check to see if their hymens are intact.

Until recently, virginity tests were also compulsory for female police officers in Indonesia. Senior officers say they were ended last year, after complaints from groups such as Human Rights Watch. But there are worries that, at least in some parts of the country, they have been rebranded as “reproductive-health tests” (see article). Fear of undergoing such a test is one reason why so few Indonesian women have joined the police; only 3% of the force is female. And that means the police are less good at protecting women, many of whom are reluctant to report rape or domestic violence to a male officer.

Unscientific, unethical, underreported

Virginity tests are unscientific—women’s physiologies vary a great deal, whether or not they have ever had sex. More to the point, the tests are degrading and unnecessary. Whether or not a woman is sexually active has no bearing on her ability to aim a rifle or to perform any other job. Yet in many parts of the world virginity testing continues. Sometimes it is demanded by prospective husbands, which is bad enough. Sometimes it is sponsored by governments, which is worse. They do so for three reasons, all bad.

In some cases, the aim is to intimidate. In Iran, for example, Atena Farghadani, a dissident cartoonist, was accused of “illegitimate sexual relations” because she shook hands with her male lawyer. She was then subjected to a “virginity and pregnancy test”. Egypt’s security forces have carried out virginity tests on women arrested for taking part in anti-government protests. In 2011 a little-known general called Abdel-Fattah al-Sisi said such tests were necessary to ensure that female detainees could not subsequently accuse their jailers of raping them. Mr Sisi is now president of Egypt.

In other cases virginity tests are administered in the false belief that they provide useful evidence in criminal cases. A study in Afghanistan found that 90% of a sample of female detainees had undergone such tests, some as often as four times. Most had been accused of “moral” crimes such as non-marital sex, but some of non-sexual crimes such as theft. The Indian Supreme Court ruled in 2013 that virginity tests could not be used as evidence in rape cases, but some Indian courts still allow it, on the assumption that a woman who is used to sex is more likely to have consented to the sex act in question.

A third rationale is to encourage virtue and discourage vice, as defined by (usually male) traditionalists. Even when national governments ban or discourage virginity tests, local bigwigs sometimes carry on regardless. In the Indian state of Madhya Pradesh in 2013, district officials made hundreds of women undergo virginity tests before taking part in a mass wedding, although Indian law forbids this. Each year in South Africa, hundreds of young women have virginity tests before dancing for the Zulu king. And to curb the spread of HIV, a Zulu mayor has offered scholarships for female university students who present certificates of virginity.

Enough, already. Sex between consenting adults is none of the state’s business. Virginity tests are pointless and traumatic. The time to end this outdated practice is now.