Random spotting

So my period is about 8-9 days away and I went to the bathroom and saw light pink spotting.. what causes spotting? Should I test?

Update:

It only happens when I use the bathroom 😭. Also, I am now feeling cramps which is strange because I don’t get cramps till the day before my period and I’m currently 9 days away from my period.. welp, I’m going to wait it out and test soon. 😓