What is the dual function of deposition?

The Rules of Court provide six (6) different modes of discovery that parties may make use of. They are under Rules 23 to 28. They are the following:

[1] Depositions pending action (Rule 23)
[2] Depositions before action or pending appeal (Rule 24)
[3] Interrogatories to parties (Rule 25)
[4] Admission by adverse party (Rule 26)
[5] Production or inspection of documents and things (Rule 27)
[6] Physical and mental examination of persons (Rule 28)
Deposition is a mode of discovery and an alternative mode of discovery. 

It is a mode of discovery. Deposition is chiefly a mode of discovery. This purpose is explained under Section 2 of Rule 23. It allows a broad scope of examination regarding any matter, not privileged, which is relevant to the subject of the pending action, whether relating to the claim or defense of any other party, the only requirement is that it be relevant and not privileged.

It is an alternative mode of testimony. Section 4 of Rule 23 on the use of deposition is clearly indicative of the use of deposition as an alternative mode of testimony in view of distance, death or disability of the deponent.