The sample data from the relevant time period means it should also include representation sample stocks of companies that went liquidated or bankrupt or sold etc. If it sounds hectic then the alternative is to only pick historical data from the stocks that still exist today.
A backtest should includes all trading risks or costs, as these can drastically affect the backtesting strategy. So traders should always ensure that their backtesting strategy covers or accounts for all these costs. Then the out of sample testing and further/forward testing actually confirms the system’s effectiveness or true colors before rolling it out in the real world. Good relation between the out of sample testing and further/forward testing is significant for concluding the efficiency of the trading system.