Define Testify Under Oath Meaning

Testify Under Oath
Where you **swear** to tell the truth.

Confused social-studies student: I was always under the impression that you're supposed to be polite and respectful whenever you in a court of law, not lace your language with profanity --- why should anyone be compelled to "swear" to tell the truth when he agrees to "testify under oath"???
By Perle