Its easy to check if it is your alternator or battery. When the engine is idling get a multi-meter across the battery terminals. It should be reading around 14v. Switch on your lights, heater, heated rear window and all your electrics and the voltage across the battery shouldn't drop below 12v. If it does your alternator or voltage regulator (usually part of the alternator assembly and can sometimes be replaced separately) is not charging enough. The only way to check a battery is to use one of those devices that shorts across the terminals and tests if it can maintain amp output for a certain number of seconds, but thats not a test you want to repeat regularly as it can damage the battery.
Older generation diesel engines could run fine without a battery - they don't have an electrical circuit, but modern engines are different with electronic fuel injection and all the mirriads of environmental systems running to ensure emissions are maintained but these all run on low voltage and low current circuits so you're battery would have to be completely and utterly dead as a doornail before the engine would cut out.
How is it cutting out? Is is as you approach a junction when you depress the clutch? If so it could be something to do with your idle control system like a crank sensor, or a temp sensor for your ECU.