Shelf-life can also include industry standards as well as your own lab results. For example, if you are making bread then the industry standard shelf-life could be Day of Production (DOP) +5 days.
You could then use this, but would need to monitor and produce your own results too. You may find that fruited or sugared products last longer, and the risk here is mould - so quality.
If you are talking about a USE BY date, then this needs to be pretty accurate as this is about food safety.
You should conduct shelf-life testing based on risk. You could review the number of complaints you have, the risk category of the food, and the testing methods used. On a product with a 2yr shelf-life, you would expediate testing at the laboratory (they would mimic a 2yr shelf-life instead of waiting 2yrs).
You can also keep your own samples too, and send these off towards the end of shelf-life.
Lets say you have a frozen product with a 2yr shelf-life if stored at -18c. Then you would need to determine the risk of the product should it nor meet shelf-life, and the likelihood of the shelflife being shorter. We could argue that it should easily last 18 months.
You then keep 10 samples in house, stored correctly and send one away at 18 months. You send another at 19 months, one at 20 months, and so on. You then send one away at 25 months and 26 months. You have 2 spare, so you may want to go to 27 and 28 months. This pushes your testing beyond what's on the label giving you a potential buffer.
You would typically do this once per year, but you can do this based on risk. If you are supplying your products to retailers, they will have their own requirements.