Halacha

הלכה א
הָעֵד מְצֻוֶּה לְהָעִיד בְּבֵית דִּין בְּכָל עֵדוּת שֶׁיּוֹדֵעַ. בֵּין בְּעֵדוּת שֶׁיְּחַיֵּב בָּהּ אֶת חֲבֵרוֹ בֵּין בְּעֵדוּת שֶׁיְּזַכֵּהוּ בּוֹ. וְהוּא שֶׁיִּתְבָּעֶנּוּ לְהָעִיד בְּדִינֵי מָמוֹנוֹת שֶׁנֶּאֱמַר (ויקרא ה א) "וְהוּא עֵד אוֹ רָאָה אוֹ יָדָע אִם לוֹא יַגִּיד וְנָשָׂא עֲוֹנוֹ":
כסף משנה
1.
A witness is commanded to testify in court with regard to all pertinent testimony that he knows. This applies both to testimony that will cause his colleague to be held liable or testimony that will vindicate him. With regard to financial cases, this applies only when he is summoned to testify. The source for this commandment is Leviticus 5:1: "And should he witness, see, or know of the matter, if he does not testify, he will bear his sin."

הלכה ב
הָיָה הָעֵד חָכָם גָּדוֹל וְהָיָה בְּבֵית דִּין פָּחוּת מִמֶּנּוּ בְּחָכְמָה. הוֹאִיל וְאֵין כְּבוֹדוֹ שֶׁיֵּלֵךְ לִפְנֵיהֶם עֲשֵׂה שֶׁל כְּבוֹד תּוֹרָה עָדִיף וְיֵשׁ לוֹ לְהִמָּנַע. בַּמֶּה דְּבָרִים אֲמוּרִים בְּעֵדוּת מָמוֹן. אֲבָל בְּעֵדוּת שֶׁמַּפְרִישׁ בָּהּ מִן הָאִסּוּר וְכֵן בְּעֵדוּת נְפָשׁוֹת אוֹ מַכּוֹת הוֹלֵךְ וּמֵעִיד שֶׁנֶּאֱמַר (גמרא ברכות יט ב) "אֵין חָכְמָה וְאֵין תְּבוּנָה לְנֶגֶד ה'". כָּל מָקוֹם שֶׁיֵּשׁ חִלּוּל הַשֵּׁם אֵין חוֹלְקִין כָּבוֹד לָרַב:
כסף משנה
2.
If the witness was a wise man of great stature and the judges of the court did not possess the same degree of wisdom, he may refrain from testifying. The rationale is that it is not becoming to his dignity for him to go to testify before them. Hence, the positive commandment of honoring the Torah takes precedence.
When does the above apply? With regard to testimony concerning financial matters. With regard to testimony that safeguards a person from a prohibition, by contrast, or testimony in cases involving capital punishment or lashes, he must go and testify. This is derived from Proverbs 21:30: "There is no wisdom or understanding... before God." Implied is that whenever the desecration of God's name is involved, honor is not granted to a master.

הלכה ג
כֹּהֵן גָּדוֹל אֵינוֹ חַיָּב לְהָעִיד אֶלָּא עֵדוּת שֶׁהִיא לְמֶלֶךְ יִשְׂרָאֵל בִּלְבַד. הוֹלֵךְ לְבֵית דִּין הַגָּדוֹל וּמֵעִיד בָּהּ. אֲבָל בִּשְׁאָר הָעֵדֻיּוֹת פָּטוּר:
כסף משנה
3.
A High Priest is not obligated to testify. An exception is made only with regard to matters involving a king. In such an instance, he should go to the High Court and testify. With regard to other testimony, he is not obligated.

הלכה ד
מִצְוַת עֲשֵׂה לִדְרשׁ אֶת הָעֵדִים וּלְחָקְרָן וּלְהַרְבּוֹת בִּשְׁאֵלָתָן וּמְדַקְדְּקִין עֲלֵיהֶן וּמַסִּיעִין אוֹתָן מֵעִנְיָן לְעִנְיָן בְּעֵת הַשְּׁאֵלָה כְּדֵי שֶׁיִּשְׁתְּקוּ אוֹ יַחְזְרוּ בָּהֶן אִם יֵשׁ בְּעֵדוּתָן דֹּפִי. שֶׁנֶּאֱמַר (דברים יג טו) "וְדָרַשְׁתָּ וְחָקַרְתָּ וְשָׁאַלְתָּ הֵיטֵב". וּצְרִיכִין הַדַּיָּנִים לְהִזָּהֵר בְּעֵת חֲקִירַת הָעֵדִים [שֶׁמָּא מִתּוֹכָהּ יִלְמְדוּ לְשַׁקֵּר. וּבְשֶׁבַע חֲקִירוֹת בּוֹדְקִין אוֹתָם]. בְּאֵי זוֹ שָׁבוּעַ. בְּאֵי זוֹ שָׁנָה. בְּאֵי זֶה חֹדֶשׁ. בְּכַמָּה בְּחֹדֶשׁ. בְּאֵי זֶה יוֹם מִימֵי הַשַּׁבָּת. וּבְכַמָּה שָׁעוֹת בַּיּוֹם. וּבְאֵי זֶה מָקוֹם. אֲפִלּוּ אָמַר הַיּוֹם הֲרָגוֹ אוֹ אֶמֶשׁ הֲרָגוֹ שׁוֹאֲלִין לָהֶן בְּאֵי זֶה שָׁבוּעַ בְּאֵי זוֹ שָׁנָה בְּאֵי זֶה חֹדֶשׁ בְּכַמָּה בַּחֹדֶשׁ בְּאֵי זֶה יוֹם בְּאֵי זוֹ שָׁעָה. וּמִכְּלַל הַחֲקִירוֹת יֶתֶר עַל הַשֶּׁבַע הַשָּׁווֹת בַּכּל שֶׁאִם הֵעִידוּ עָלָיו שֶׁעָבַד עֲבוֹדָה זָרָה שׁוֹאֲלִין לָהֶן אֶת מֶה עָבַד וּבְאֵי זוֹ עֲבוֹדָה עָבַד. הֵעִידוּ שֶׁחִלֵּל אֶת הַשַּׁבָּת שׁוֹאֲלִין אוֹתָן אֵי זוֹ מְלָאכָה עָשָׂה וְהֵיאַךְ עָשָׂה. הֵעִידוּ שֶׁאָכַל בְּיוֹם הַכִּפּוּרִים שׁוֹאֲלִין אוֹתָן אֵי זֶה מַאֲכָל אָכַל וְכַמָּה אָכַל. הֵעִידוּ שֶׁהָרַג אֶת הַנֶּפֶשׁ שׁוֹאֲלִין אוֹתָן בַּמֶּה הֲרָגוֹ. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה הֲרֵי הוּא מִכְּלַל הַחֲקִירוֹת:
כסף משנה
4.
It is a positive commandment to question the witness and to interrogate them, asking many questions and weighing their replies exactingly. They should divert their attention from one matter to another while questioning them, so that they will refrain from speaking or retract their testimony if there appear to be flaws in it, as Deuteronomy 13:15 states: "And you shall inquire and research thoroughly."
The judges must show extreme care when questioning the witnesses, lest from their questions the witnesses learn to lie. They ask them seven questions:
a) In which seven year cycle the event occurred?
b) In which year?
c) In which month?
d) On which day of the month?
e) On which day of the week?
f) At what time?
g) In which place?
Even if a witness says: "He killed him today," or "He killed him yesterday," we ask him all the above questions. In addition to these seven questions which are asked universally, the judges inquire into the fundamental issues involved. For example, if the witnesses testify that a person worshipped false deities, the judges ask them: "Which deity did he worship?" "What service did he perform?" If they testified that he desecrated the Sabbath, the judges ask them: "Which forbidden labor did he perform?" "How did he perform it?" If they testify that he ate on Yom Kippur, the judges ask them: "Which food did he eat?" "How much did he eat?" If they testified that he killed someone, the judges ask them: "With what did he kill him?" Inquiries of this type are considered as fundamental questions (chakirot).

הלכה ה
הַחֲקִירוֹת וְהַדְּרִישׁוֹת הֵן הַדְּבָרִים שֶׁהֵן עִקַּר הָעֵדוּת וּבָהֶן יִתְחַיֵּב אוֹ יִפָּטֵר. וְהֵן כַּוָּנַת הַמַּעֲשֶׂה שֶׁעָשָׂה וְכִוּוּן הַזְּמַן וְכִוּוּן הַמָּקוֹם שֶׁבָּהֶן יָזֹמּוּ הָעֵדִים אוֹ לֹא יָזֹמּוּ. שֶׁאֵין אָנוּ יְכוֹלִים לְהָזִים הָעֵדִים עַד שֶׁיְּכַוְּנוּ הַזְּמַן וְהַמָּקוֹם:
כסף משנה
5.
The derishot and the chakirot involve the matters that constitute the essence of the testimony. On their basis, the person will either be held liable or released. They include defining the deed that was performed, the time when it was performed, and the place where it was performed. On these basis, the testify of the witnesses will or will not be refuted through hazamah. For we cannot refute the testimony of the witnesses unless they define the time and place of the deed involved.

הלכה ו
וְעוֹד מַרְבִּין לִבְדֹּק הָעֵדִים בִּדְבָרִים שֶׁאֵינָן עִקָּר בָּעֵדוּת וְאֵינָהּ תְּלוּיָה בָּהֶם. וְהֵם הַנִּקְרָאִים בְּדִיקוֹת. וְכָל הַמַּרְבֶּה בִּבְדִיקוֹת הֲרֵי זֶה מְשֻׁבָּח. כֵּיצַד הֵן הַבְּדִיקוֹת. הֲרֵי שֶׁהֵעִידוּ עָלָיו שֶׁהָרַג וְנֶחְקְרוּ בְּשֶׁבַע חֲקִירוֹת שֶׁמָּנִינוּ. שֶׁהֵן בְּכַוָּנַת הַזְּמַן וְכַוָּנַת הַמָּקוֹם. וְנִדְרְשׁוּ בְּכַוָּנַת הַמַּעֲשֶׂה וְכִוְּנוּ הַמַּעֲשֶׂה וְכִוְּנוּ הַכְּלִי שֶׁהֲרָגוֹ בּוֹ. בּוֹדְקִין אוֹתָן עוֹד וְאוֹמְרִים לָהֶן מֶה הָיָה לְבוּשׁ הַנֶּהֱרָג אוֹ הַהוֹרֵג. בְּגָדִים לְבָנִים אוֹ שְׁחוֹרִים. עֲפַר הָאָרֶץ שֶׁנֶּהֱרַג עָלֶיהָ לָבָן אוֹ אָדֹם. אֵלּוּ וְכַיּוֹצֵא בָּהֶן הֵם הַבְּדִיקוֹת. מַעֲשֶׂה שֶׁאָמְרוּ הָעֵדִים הֲרָגוֹ בְּמָקוֹם פְּלוֹנִי תַּחַת הַתְּאֵנָה וּבָדְקוּ הָעֵדִים וְאָמְרוּ לָהֶם תְּאֵנִים שֶׁלָּהּ שְׁחוֹרוֹת הָיוּ אוֹ לְבָנוֹת עֻקְצִין שֶׁל אוֹתָם הַתְּאֵנִים אֲרֻכּוֹת הָיוּ אוֹ קְצָרוֹת. וְכָל הַמַּרְבֶּה בִּבְדִיקוֹת וְכַיּוֹצֵא בָּהֶן הֲרֵי זֶה מְשֻׁבָּח:
כסף משנה
6.
In addition, the judges question the witnesses exceedingly with regard to matters that do not involve the fundamental aspects of the testimony and their testimony is not dependent on them. These questions are called bedikot. The more a judge questions the witnesses with bedikot, the more praiseworthy it is.
What are examples of bedikot? Witnesses testified that a person killed a colleague. The witnesses were questioned with the seven chakirot which we mentioned which define the time and the place of the act. Similarly, they were interrogated with regard to the deed and they defined the deed and the murder weapon. The judges continue to interrogate them. They ask: What were the murderer and the victim wearing, white clothes or black clothes? Was the earth where he was killed white or red? These and similar questions are called bedikot.
An incident once occurred when witnesses stated that a murder took place under a fig tree. The judges questioned the witnesses: "Were the figs black or white?", "Were their stems long or short?" The more a judge questions the witnesses with bedikot like these, the more praiseworthy it is.

שופטים הלכות עדות פרק א
Shoftim Edus Chapter 1