to bear witness: to declare, on one's own firsthand knowledge, that something is true
At its core this word means to stand up and say what you know to be true, the way a witness speaks. It is firsthand testimony, not opinion or hearsay: the witness tells what he has seen, heard, or knows, and stakes his own credibility on it. John's writings press the word hardest, building a whole case in which the Father, the works of Jesus, the Scriptures, John the Baptist, and the Spirit all testify to who Jesus is.
The senses below differ only by who is testifying and to what end. Most often a person affirms a fact or vouches for a person, telling what they have seen or know to be so. A second shade is the favorable report, where the testimony commends someone's character, and in its passive form means to be well attested or to have a good name backed by people who vouch for you.
These are not separate words. The witness is always reporting what is true; what shifts is whether the report establishes a fact or commends a person.