testimony: the act of bearing witness, or the statement a witness gives.
At its core this word names what a witness (μάρτυς) does and what a witness says. It began as a courtroom word in everyday Greek, the formal statement a person gave under oath, and the New Testament keeps that legal feel even when it moves far beyond the courtroom. To give testimony is to declare what you have seen and know, usually before people who may not want to hear it, and to stake yourself on its truth.
From that one center the word spreads across several settings without changing its meaning. It can be a literal deposition at a trial, as when false witnesses speak against Jesus. It can be the public reputation a person has earned, the standing testimony others give about a person's character. Most often in John and his letters it is the solemn declaration about who Jesus is, weighed almost like courtroom evidence in a larger trial over Jesus' identity. And in Revelation it becomes the confession Christians hold onto and refuse to deny, even when holding it costs them their lives.
One thing the word does not yet mean in the New Testament is martyrdom in the later sense of death itself. Even in Revelation, where witnesses (μάρτυς) are killed for what they declare, the word still points to the testimony they bore. Their death is the cost of the witness, not its definition. The technical Christian meaning of dying-as-witness took shape only a generation or two after the New Testament was finished.