That is something we did before cars became so computerized. Now - DON'T DO IT.
Some people tell you that you can check your alternator by disconnecting it from the battery to see if the alternator can produce enough current to keep the engine running. Disconnecting the battery will subject the voltage regulator (and computer and audio equipment...) to significant voltage spikes which may cause an otherwise good alternator to fail. Even if there were no damaging spikes, this test would not indicate whether or not the alternator was good because the engine will easily run with a weak or failing alternator.
If you want to see if your alternator is producing current, turn on your headlights when you're parked and the engine idling with the headlights shining on a wall (at night). Notice how bright they are. Then turn the engine off. The lights should get dimmer when you turn the engine off. If the lights get brighter when you kill the engine, the alternator was not charging sufficiently. When doing this test, the lights should be the only load (turn the stereo, a/c and other accessories off). With a heavy load, an otherwise good alternator may not be able to produce sufficient amounts of current at idle.
Worked on cars for over 55 years.