Define your expectations for the living space. Ask yourself how much privacy you need, what you consider clean and how social you are. Do you plan to use the space more for parties or study groups? What about overnight guests? How soon do you expect dishes to be washed? How much alone time do you need during a day or week? Discussing all of these issues ahead of time will make it more likely that your friendship will survive being roommates.
Set rules about common areas and usage. Decide on how to share access to and use of common areas, such as the living room, linen closets and bathrooms. Establish any restrictions or curfews (such as no loud music in the living room past 11:00 p.m. on school nights). Divide chores equally. Create a "chore spinner" to remind you both of your responsibilities.
Maintain clear communication, anticipating problems before they worsen. Keep discussions about the household separate from other conversations about your friendship. Let your roommate know that your conscientiousness about your living situation doesn't mean you don't care about your friendship, even when there is a household situation which needs to be resolved.
Have other friendships. One of the potential risks of becoming roommates with a friend is that this person will take up too much space in your life, creating an emotionally unhealthy and unsustainable situation. Prevent this by keeping some separation in your social circles and pursuing some experiences that you don't share with your friend and roommate.