The testimony of faith is the formula whose sincere utterance before witnesses makes a person Muslim, and it is not a Quranic verse.
Both of its clauses use Quranic vocabulary and both ideas are pervasive in the text. The denial that there is any god but God appears in various forms in many places; that Muhammad is the messenger of God is stated repeatedly. But the composite two-clause formula as recited is not lifted from a single verse. It is early Islamic, embedded in the call to prayer and the ritual prayer from the earliest period, and it functions as a creed in the technical sense, a fixed statement whose recitation constitutes membership.
The two clauses are separable and are used separately. The first alone, the tahlil, is the commonest formula of remembrance in Sufi and general devotional practice, recited in counted sequences. Shia practice adds a third clause naming Ali, and whether it is part of the testimony or an additional and permissible affirmation is treated differently by different Shia authorities; it is not part of the Sunni formula.
Its legal weight is considerable. Utterance with intent, before witnesses, is conversion, and there is no further requirement, no officiant, no ceremony, no institution. It is also the phrase said into the ear of a newborn and the phrase a Muslim hopes to die uttering.
Its appearance on the flags of several states, and on the banners of armed movements that other Muslims regard as illegitimate, is a modern political development and not a traditional use.