Umm, I tend to put the test server on to a different URL but you don’t have to.
It doesn’t matter what the URL is for as long no one will ever see it as this will be for your development. You can ask WordPress not to be found by search engines.
Example: https://www.yoururl.com is your main site sat on a server and you could have development.yoururl.com which is your development site sat on a different server and that would be OK.
I tend not to use words like development or test, I would be tempted to use myname.yoururl.com but you can use any name you like. Not for much money you can have a .me url which is what I would use for a test site.
I keep the servers separate for security reasons and I tend to use dedicated servers so I am not sharing with other people (again for security reasons). I know lots of people who use shared hosting and they don’t seem to have any security issues so you can use them but it is my opinion to use dedicated.
Does that help to answer your question?