Selecting an appropriate usability testing sample size

Have you ever wondered how a sample is selected for usability testing of a prototype? What are the significant factors on which sample size is selected? And how it goes through usability testing before a launch. What is an appropriate usability testing sample size?