Towards optimal software engineering: learning from agile practice