An Application of Configuration Management on Graphical Models
Total Page:16
File Type:pdf, Size:1020Kb
MBVC – Model Based Version Control: An Application of Configuration Management on Graphical Models MEHIAR MOUKBEL Master of Science Thesis Stockholm, Sweden 2007 i MBVC – Model Based Version Control: An Application of Configuration Management on Graphical Models By: Mehiar Moukbel A A B Merge Engine B Master of Science Thesis MMK 2007:38 MDA261 KTH Machine Design SE-10044STOCKHOLM ii Master of Science Thesis MMK 2007:38 MDA261 MBVC – Model Based Version Control: An Application of Configuration Management on Graphical Models Mehiar Moukbel Approved Examiner Supervisor 2007-03-20 Martin Törngren Jianlin Shi Jad El-Khoury Commissioner Contact person KTH, Machine Design Abstract File-based version control consists of tools in the software engineering industry, with many available commercial products that allow multiple developers to work simultaneously on a single project. However these tools are most commonly used on plain textual documents such as source code. There exist few tools today for versioning fine-grained data such as graphical Simulink models. Since Simulink is widely used as a modeling tool in numerous engineering fields, nonetheless in the mechatronics field, it will be interesting to study the possibility of developing a tool for version control of graphical models. Two textual software configuration management (SCM) products, CVS and Rational Clear Case, were studied and their functionalities were analyzed, along with a different number of research topics on document versioning. The existing algorithms of ‘diff’ and ‘merge’ functions were also studied to give an understanding of how these functions work for text based documents. The knowledge gained from the tools, existing algorithms and literature on the subject were used to write MATLAB programs that perform diff and merge on Simulink models. The resulted programs perform 2-way diff and merge on Simulink models and display the differences graphically using color codes. Although the tool did have some limitations and did not perform all the expected SCM functions, it still displayed differences between Simulink models. Displaying of results occurred both graphically and textually. A third tool called Rhapsody was studied which is used in model driven development and its interaction with Simulink was also studied, showing that is possible but rather complex and requires knowledge in both programs. The study shows thus that it is possible to build and develop configuration management tools for graphical models in Simulink, possibly also the 3-way merges, but certain difficulties such as connecting blocks correctly must firstly be solved. iii Examensarbete MMK 2007:38 MDA261 MBVC – Versionshantering av Grafiska Modeller En Applikation av CM Mehiar Moukbel Godkänt Examinator Handledare 2007-03-20 Martin Törngren Jianlin Shi Jad El-Khoury Uppdragsgivare Kontaktperson KTH, Maskinkonstruktion Sammanfattning Filbaserad versionshantering är ett verktyg inom mjukvaruutvecklingen, och det existerar ett stort utbud av kommersiella produkter. Problemet är dock att de flesta verktygen fungerar endast för textbaserade filer, och saknar någon motsvarighet till hantering av ’fine grained’ filer som exemplevis grafiska Simulink modeller. Eftersom Simulink är ett utspritt modelleringsvertyg och används inom flera utvecklingsarbeten och särskillt inom mekatronik, så är det intressant att studera möjligheten att utveckla ett sådant verktyg. Genom analys av två tillgängliga konfigurationsverktyg: CVS och Rational Clear Case, samt studie av diverse publikationer och rapporter av versionshantering och algoritmer angående ’diff’ och ’merge’ funktioner, så utvecklades ett enkelt sådant verktyg. Programmet utför enkel skillnads- och föreneingsfunktioner (2-way merge) på grafiska Simulink modeller. Verktyget fungerade inte som det var uttänkt i början men det lyckades ändå visa skillnader mellan Simulink modellerna både grafiskt och textmässigt. Ett tredje verktyg, Rhapsody, som används inom MDD studerades, samt dess samarbete med Simulnik testades. Resultatet visar att programmens samverkan är möjlig men något komplex och kräver erfarenheter från båda programmen. Studien visar att det går att bygga ett mer avancerat konfigurations-hanteringsprogram för Simulink modeller, såsom ett 3-way merge, men vissa svårigheter som en korretk koppling av blocken måste först lösas. iv Model Based Version Control – An Application of Configuration Management on Graphical Models Keywords Model based version control, MBVC Software Configuration Management Configuration Management CVS / Clear Case Difference, diff Merge, 2-way merge, 3-way merge Abbreviations The following is a list of all the abbreviations used in this report. API: Application Programming Interface CC: Clear Case CM: Configuration Management CVS: Concurrent Versions Systems MDD: Model Driven Development MDA: Model Driven Architecture RCS: Revision Control Systems RG: Rhapsody Gateway SCM: Software Configuration Management SE: Software Engineering STEP: STandard for the Exchange of Product model data PDM: Product Data Management UBCC: Usefulness Based Control Code UML: Unified Modeling Language VCS: Version Control System VOB: Version Object Base XML: eXtensible Markup Language v Model Based Version Control – An Application of Configuration Management on Graphical Models Contents 1 Introduction.................................................................................................................1 1.1 Background and Introduction................................................................................1 1.2 Problem..................................................................................................................2 1.3 Goal .......................................................................................................................2 1.4 Approach................................................................................................................2 1.5 Assumptions and Limitations.................................................................................3 1.6 Thesis Outline ........................................................................................................3 2 SCM and Model Based Development........................................................................5 2.1 Basics of SCM........................................................................................................6 2.1.1 SCM Workflow......................................................................................................................7 2.1.2 The Repository.......................................................................................................................7 2.2 Model Driven Development...................................................................................7 2.3 Summary of Chapter 2:..........................................................................................8 3 Existing Software Configuration Management Tools .............................................9 3.1 CVS ........................................................................................................................9 3.1.1 The CVS Repository............................................................................................................10 3.1.2 Viewing Differences............................................................................................................11 3.1.3 Revisions..............................................................................................................................11 3.1.4 Branching and Merging .......................................................................................................12 3.1.5 Multiple Developers ............................................................................................................13 3.2 Rational Clear Case ............................................................................................13 3.2.1 ClearCase Views..................................................................................................................13 3.2.2 Versions, Elements and VOBs ............................................................................................14 3.2.3 Checking Out Files ..............................................................................................................14 3.2.4 Checking In Files .................................................................................................................15 3.3 Rhapsody and the Telelogic Family ....................................................................16 3.3.1 Short about UML 2.0...........................................................................................................16 3.3.2 The Rhapsody GUI ..............................................................................................................17 3.3.3 Rhapsody in C++ .................................................................................................................17 3.3.4 More Telelogic Programs ....................................................................................................19 3.3.5 Conclusions Regarding Rhapsody.......................................................................................20 3.4 Summary of the SCM Tools .................................................................................21 3.4.1 Concurrent Development.....................................................................................................21 3.4.2 The Diff................................................................................................................................22