DSA theory test:
You can take your theory test as soon as you are 17, on your birthday if you wish. You just need to take along both parts of your provisional driving licence, and have done some preparation. Once you have passed it is valid for 2 years, so it is just as well to get it done and dusted.
The DSA no longer publish the actual theory test questions and answers. This is so they can't be learnt by rote. They will however publish all the background material you will need, with similar questions to the one used on the test.