Model-based Planning and Control for Balancing Functionality and Quality in Iterative Software Construction