I would wait until your period is officially late to test. The tests are more accurate then (less chance of false negatives). Some tests can detect a pregnancy 5 days sooner (though the box cheats a bit with that--the 5th day is the day your period is due), but if you read the stats on the box, testing 4 days before your period will give something like 30% of pregnant women a positive that soon.
Some women do spot before they get their periods. Pregnant women may have implantation spotting (though still you need about 3 days after implantation to get a positive pregnancy test). Some women have a sensitive cervix and may spot after sex.
I would wait until you are late on your period and then test.