A model driven approach to analysis and synthesis of sequence diagrams