The word "Affidavit" is a Latin word meaning "He or She has declared upon oath", hence very clear that it is a written sworn statement(s) of facts made by an "affiant" or "deponent" under an affirmation or oath administered by a person authorized to do so by law such as a Commissioner of Oaths etc, or Notary Public who has the legal power to witness the oath.
In other words, an affidavit is a written testimony of the affiant or deponent. In a Court, you will have to place your hand on some holy book and swear that you are telling the truth, in this case, you swear or affirm in front of the Commissioner of Oaths etc. and then sign your affidavit, attesting that whatever you said or claimed in the affidavit is truth and nothing but the truth. You are under oath, before you sign on the paper (document) outside the court environment.
Remember to read all the statements on the Affidavit before you sign the affidavit, as they belong to you, the affiant or deponent who is signing the affidavit. If you agree to all the statements in the document, then go ahead and sign the affidavit. The Notary or Commissioner of Oaths etc. have no responsibility or nor any obligation to verify the truth of your statements. Their job is to see you taking the oath and signing the affidavit, thereby certifying that the deponent took the oath before signing the affidavit. The affidavit becomes a legal document once you sign after taking the oath and the Notary or Commissioner of Oaths etc. signs and put his stamp or seal.