Test the alternator with a voltmeter
If you're tempted to test an alternator by disconnecting the negative battery cable, don't do it. A good alternator may indeed keep the engine running, but it was never a good test. In the pre-computer days, you could pull it off without damaging anything. Today, you risk frying every electrical device in your vehicle. The second you disconnect the battery, the voltage regulator pegs the alternator to put out maximum power. With no battery in the circuit to act as a buffer, the alternator can put out up to 150 volts, depending on engine rpm. When the smoke clears, that “simple test” could end up costing you several thousand dollars for new electronics.
Instead, get a cheap voltmeter (about $15 at any home center or auto parts store). With the engine off, battery voltage should be between 12.5 and 12.8 volts. If it's below that, charge the battery with a battery charger before you conduct the test. Then start the engine and check for increased voltage readings as shown above. If you see higher readings, chances are the alternator is good (more sophisticated testing equipment is needed to detect an open or shorted alternator diode).
By the way, a dead battery in the morning is usually caused by a computer module that isn't shutting down when you turn off the car. If your alternator tests good, get your vehicle into a shop and pay a pro to find the misbehaving module.
Video: How to Test an Alternator
If you have a newer battery, but your car won't start, you may have a bad alternator. Rick Muscoplat, an automotive expert at The Family Handyman, will show you how to test an alternator.