Is it possible to ensure division of labor on a group assignment?
Make each group member explicitly be 'responsible' for one aspect of the project.

Let's think about why group work is a useful tool in terms of teaching your students. I'd imagine one of the big reasons you would assign a group task is to prepare your students for a job, working with a team to build a product. In the workplace, you typically have a way of assigning individual roles and responsibilities; if you're building a website, you generally would have someone responsible for design, someone for the backend logic, etc.

You should do the same thing here. Specifically require that your students build a plan, with each member being given a role that they are individually responsible for, and before allowing them to proceed, make sure each role is relatively equal in scope. You wouldn't want Alice to have ten times the work of Bob in the plan—it won't give you the scope to analyse each bit of work individually.

Obviously, each piece of the project likely depends on another, so it's very difficult to isolate each person's contribution individually. That's why I'd suggest not weighting the group work too highly, because the difficulties of evaluating the outcome far outweigh the benefits of making the group work count for a high percentage of the grade.

Carnegie Mellon's Design &amp; Teach a Course section has some useful tips:


  In addition to evaluating the work of the group as a whole, ask individual group members to demonstrate their learning via quizzes, independent write-ups, weekly journal entries, etc. Not only does this help you monitor student learning, it helps to prevent the “free-rider” phenomenon. Students are considerably less likely to leave all the work to more responsible classmates if they know their individual performance will affect their grade.
  
  To create individual accountability, some instructors combine a group project with an individual quiz on relevant material. Others base part of the total project grade on a group product (e.g., report, presentation, design, paper) and part on an individual submission.


You'll need to think about your aims. Do you want to test the group's ability to spot people not contributing as part of the teaching? If so, don't put in those safeguards, and see what happens. If you just want to test their CS knowledge, make sure that you can fairly evaluate individual contributions, as well as the overall result.