c. 1400, "proof or demonstration of some fact, evidence, piece of evidence;" early 15c., "legal testimony, sworn statement of a witness," from Old North French testimonie (Old French testimoine 11c.), from Latin testimonium "evidence, proof, witness, attestation," from testis "a witness, one who attests" (see testament) + -monium, suffix signifying action, state, condition. Despite the common modern assertion, the sense of the word is unlikely to have anything to do with testicles (see testis).
Earliest attested sense in English is "the Ten Commandments" (late 14c.), from Vulgate use of Late Latin testimonium, along with Greek to martyrion (Septuagint), translations of Hebrew 'eduth "attestation, testimony" (of the Decalogue), from 'ed "witness."