Why does my dishwasher fill when the machine is off?
Shutoff the water supply to the dishwasher and run water through the sink drain from the faucet.

If the flow of water stops to the dishwasher, then the problem is in the supply and Ed's advice is likely on track. If you find water filling the dishwasher with the supply turned off, then the problem is with the drain line. The drain needs to be attached to the underside of the counter or connected through an air gap at the sink to minimize the risk of water from the drain backing up and into the dishwasher.