Pregnancy Test

Should I take a test after the missed AF or can I test a few days before the due date?