By experience (and I am only a beginner), SL and TP needs to be set even before you enter your trade so you avoid surprises.
As for testing, I would suggest backtesting your strategy on a demo account. Depending the timeframes that you trade, backtesting at least the past 12 months or until you have a sample of trades of at least 100 trades so you can have a good idea if your strategy is profitable or not. And when I mean profitable, it's not simply to know how often the strategy hits target, but how much pips in the end you make.
A strategy could be wrong 7 out of 10 times, but still be profitable if profits covers for losses and more. But that you will only find out with doing some consistent backtesting to have a sample of trade big enough.
Hope this helps