Question: how do you know if it's a bad battery or alternator?
Answer: Simply jump-start your car and then remove the jumper cables as quickly as possible. Then wait. If the alternator is failing to charge the system, the car will soon die again and you've pinpointed the problem. However, if the car runs and continues to run, then the likely problem is with the battery.