You can put rservers in multiple serverfarms at the same time. Using policy and class maps you determine which traffic will get sent to each serverfarm.
You can then use a Layer 7 class map to direct any traffic from www.domain.com to production serverfarm and another class map to direct traffic from test.domain.com to a different serverfarm. Any load balancing changes only will affect the classmap.
Obviously your servers will would have to multiple virtual hosts to serve out traffic for both domains.