Generative Contracts
Total Page:16
File Type:pdf, Size:1020Kb
Generative Contracts by Soheila Bashardoust Tajali B.C.S., M.C.S. A Thesis submitted to the Faculty of Graduate and Postdoctoral Affairs in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science Ottawa-Carleton Institute for Computer Science School of Computer Science Carleton University Ottawa, Ontario November, 2012 © Copyright 2012, Soheila Bashardoust Tajali Library and Archives Bibliotheque et Canada Archives Canada Published Heritage Direction du 1+1 Branch Patrimoine de I'edition 395 Wellington Street 395, rue Wellington Ottawa ON K1A0N4 Ottawa ON K1A 0N4 Canada Canada Your file Votre reference ISBN: 978-0-494-94208-6 Our file Notre reference ISBN: 978-0-494-94208-6 NOTICE: AVIS: The author has granted a non L'auteur a accorde une licence non exclusive exclusive license allowing Library and permettant a la Bibliotheque et Archives Archives Canada to reproduce, Canada de reproduire, publier, archiver, publish, archive, preserve, conserve, sauvegarder, conserver, transmettre au public communicate to the public by par telecommunication ou par I'lnternet, preter, telecommunication or on the Internet, distribuer et vendre des theses partout dans le loan, distrbute and sell theses monde, a des fins commerciales ou autres, sur worldwide, for commercial or non support microforme, papier, electronique et/ou commercial purposes, in microform, autres formats. paper, electronic and/or any other formats. The author retains copyright L'auteur conserve la propriete du droit d'auteur ownership and moral rights in this et des droits moraux qui protege cette these. Ni thesis. Neither the thesis nor la these ni des extraits substantiels de celle-ci substantial extracts from it may be ne doivent etre imprimes ou autrement printed or otherwise reproduced reproduits sans son autorisation. without the author's permission. In compliance with the Canadian Conformement a la loi canadienne sur la Privacy Act some supporting forms protection de la vie privee, quelques may have been removed from this formulaires secondaires ont ete enleves de thesis. cette these. While these forms may be included Bien que ces formulaires aient inclus dans in the document page count, their la pagination, il n'y aura aucun contenu removal does not represent any loss manquant. of content from the thesis. Canada Abstract A quality-driven approach to software development and testing demands that, ultimately, the requirements of stakeholders be validated against the actual behavior of an implementation under test (hereafter IUT). That is, there needs to be a systematic (ideally objective and automated) approach to the validation of the requirements of the stakeholder against the actual behavior of an IUT. To do so, it is necessary to have a specification language from which tests can be generated and executed 'against' an actual IUT (as opposed to a model of the latter). Corriveau and Arnold have recently described at length elsewhere such an approach (in the form of a contract-based specification language called ACL (Another Contrcat Language)) and its corresponding tool, the Validation Framework (hereafter VF). Simultaneously, in recent years, the software product line approach, initiated by Parnas back in the 1970s, has emerged as a promising way to improve software productivity and quality. A product line (also called a 'product family' or 'system family') arises from situations when we need to develop multiple similar products (e.g., for a library, or for different clients, or from a single system over years of evolution). The problem we address in this dissertation can be summarized in one question: how can ACL/VF support domain engineering and application engineering? In the specific context of ACL/VF, this question can be broken down into two more immediate ones: 1) how can ACL (i.e., the requirements modeling language) be 'augmented' to support some modeling of variability? 2) how can such augmented ACL models be used, together with some specification of a configuration of feature values, to generate a domainmember contract, that is, the set of contracts associated with a specific member of a domain? The solution we propose adopts Cleaveland's template-based general approach to variability. We explain at length and demonstrate with two case studies how to go from the traditional feature diagram and feature grammar used in System Family Engineering and Software Product Lines to a) domain contracts capturing commonalities between the requirements contracts of a domain and b) variability contracts capturing how features and their relationships (captured in the feature grammar) can affect these domain contracts. Domain and variability contracts are ultimately captured in XML files relying on XSLT to specify how variability is to be resolved to generate a specific member contract. This generative process uses off-the-shelf XML technologies to generate ACL contracts that indeed can be input, compiled and run in ACL/VF. Our solution is domain independent and we believe that being template-based it is not specific to ACL and can be generalized (though this claim is left as future work). iii To my beloved parents, Soheil and Aghdas, for their endless love and support In memory of my belovedfather, Soheil and my dear aunt, Anis Acknowledgments I express my deep gratitude to my advisor Prof. J.-P. Corriveau, for his guidance, support, and encouragement during my years at Carleton. Over the last six years, he challenged me to be better, supported me to move forward, and encouraged me to strive for excellence. His valuable advice and insights guided me throughout my Ph.D. study and will continue to guide me through my future career. Dr. Corriveau, I really thank you for everything. 1 would like to thank Dr. Abhari, Dr. Ajila, Dr. Some, and Dr. Shi for being in my defense committee and for their invaluable suggestions and comments. I also thank all my teachers, professors, and paper reviewers during the years of my studies, to whom I will always be in debt. I would like to express my appreciation to all office administrators at the School of Computer Science, who were available anytime for help during my program. My special thanks to Linda, Anna, Claire, Sharmi, and Edina. My special thanks to my friend and former colleague at our favorite IS Lab Voja Radonjic, for his helpful discussions, critical reviews of papers and technical reports, and companionship through the years. He has provided a refuge for me away from the pressures of work and research during all those hard years. I would like to thank all my friends and lab-mates for making our lives more colorful and enjoyable at IS Lab. Finally, I would like to thank my parents for their endless love, generosity, and support. I dedicate this dissertation to them. I also thank my brothers Masoud and Siamak, and my sister Maryam, for their patience, kindness, care and valuable encouragement through the hard times. I am greatly indebted to my family for their unconditional love and support without which my studies at Carleton might have never happened. Table of Contents List o f Tab le s........................................................................................................................................................................... viii List o f Figures.............................................................................................................................................................................ix List o f Acronym s ....................................................................................................................................................................... x 1. Introduction ..........................................................................................................................................................................1 1.1 The Problem................................................................................................................................................................3 1.1.1 ACL and VF ....................................................................................................................................................3 1.1.2 An Example Contract ................................................................................................................................. 7 1.2 Proposed Solution................................................................................................................................................... 12 1.3 Contributions............................................................................................................................................................19 1.4 Plan for the Dissertation .......................................................................................................................................21 2. Literature Review ...........................................................................................................................................................22 2.1 Model-driven Transformation Frameworks and Tools .................................................................................22 2.1.1 Related Work..............................................................................................................................................22 2.1.1.1 Blouin e ta l..................................................................................................................................22 2.1.1.2 Tefkat ........................................................................................................................................