An excellent statement of work, preferably written by the customer, is the only way to go.
A persistent problem with this is that customers may write something so thorough that he/she can't afford to pay for it or that there's no room for "stuff that comes up."
Specmanship is an art that...
Good Idea to check local legal customs, but here's my 2 cents worth--expanding the conversation a little.
You can use a DBA to work as an independent contractor; however, many companies now refuse to work with anybody without an LLC or other formal business structure. The tax effect is the...