A sputum for AFB (Acid-Fast Bacilli) test is a laboratory analysis of lung mucus to detect bacteria that cause tuberculosis (TB) and other mycobacterial infections. It is typically ordered for patients experiencing a persistent cough lasting more than 2-3 weeks, coughing up blood, unexplained fever, or weight loss