Evidence, testimony, deposition, affidavit are, in their legal senses, closely related but not synonymous terms.
The last three designate forms of evidence, or material submitted to a competent legal tribunal as a means of ascertaining where the truth lies in a question of fact. Evidence also implies the intention of the side offering the material to use it as a basis for inference and argument and as a medium of proof.
Testimony is evidence offered by persons (as eyewitnesses or experts) who are in a position to provide pertinent information. It implies declaration under oath or affirmation, usually on the stand in open court. Testimony does not necessarily constitute favorable evidence for the side that calls the witness, for its effect may vary with such matters as inferences that may be drawn from it favorable to the opposition or new aspects and emphases elicited by cross-examination.
Deposition, though occasionally used interchangeably with testimony, is more usually used to designate a form of testimony that replaces testimony in open court or, more often, provides information for pretrial procedures and is given orally in response to questioning by competent officers, taken down in writing, and sworn to or properly affirmed.
Affidavit designates a written declaration made upon solemn oath before a recognized magistrate or officer. An affidavit may sometimes be used as testimony, but when so used it is as a rule because a witness cannot take the stand.
An affidavit submitted as testimony may be distinguished from a deposition; when used specifically and in contrast with deposition, affidavit always implies that the declaration has been obtained by one side to the dispute and that there has been no cross-examination.