Understanding and measuring the shelf-life of food