Universidad Carlos III de Madrid Escuela Politécnica Superior Bachelor Degree in Computer Engineering

Bachelor Thesis Contract-Based Programming on Modern ++

Author: José Cabrero Holgueras Supervisor: José Daniel García Sánchez

Leganés, Madrid, Spain July 2018

“Mentors are there in the moments of truth” Anonymous iv Contract-Based Programming on the Modern C++ Acknowledgements

There are so many people who have been involved in the development of this project. First of all, I would like to thank all my family for all their support and unconditional help, especially over this last year. I could not have borne the load if you would not have been present with all this help. There are not enough lines in this document to thank what you have given me.

I want to especially thank Javier López. I did not think I would live to know a genius, but I did. He has computer science in his veins and transmits his passion to anyone close to him. It is astonishing what he can do with a computer. He has taught me everything he knew when I needed and helped me like no one has in this work. A real mentor is the one that sits next to you and guides you in solving your problems, and Javier has been mine. There is probably no one in the group as dedicated to its task as Javier is. I wish I had had more time to share with him since it has been a real inspiration for this work. If someone deserves credit in the ideas of this project, it is Javier who does.

I would also like to give a huge thank to Manuel F. Dolz. You also contributed to this project offering me to work with you. When I received the offer, I did not think I would earn what I have. It has been an incredible experience. If I look back to September, I was a completely different person, and things that change you, are what define who you are.

I am specially thankful to David del Rio, to Javier Fernandez and to Mario Vasile, because they were present on the last days of this project. Each of them has given something to this project that makes it unique and without their collaboration, this project would not have been what it is. I do not really imagine how this would have ended up without your collaboration. Thank you.

My labmates also deserve some words here. They have been my classmates, my friends and my partners during this journey that has been the degree. Thanks to Laura Martín for helping me in those desperation moments in the lab, you really helped me out. And thanks to Nerea Luna for all those train travels back and forth, your support during all these years is immeasurable. Thanks for talking to me on stress moments and for always believing in me.

v Thanks to Saúl Alonso, because he has always guided me and telling me about any opportunities that there are out there; to Javier Prieto, who has cared of me from the very first moment that I joined the group. He has always been there and it has been an inspiration to follow what I really liked to do, and his support at all points. And to Guillermo Izquierdo, who helped me a lot on the decision of the Master Course and I really believe that thanks to that, I will follow my dream. Thanks to you all, you have all given me something that I will always keep, and you have all been an inspiration for me to be better.

Thanks to Ignacio Guillermo Martínez and to Alejandro Rey. They have been my classmates and I could not imagine a better group of friends. Thanks to all the work you put up to help me with practices and for those good moments we spent.

Finally, thanks José Daniel García and the ARCOS group for offering me a job in the department and lending me all the equipment and tools that I needed.

This project has been more than a learning process, it has been a personal growth. Thanks to all of you. Contract-Based Programming on Modern C++

Bachelor Thesis

José Cabrero Holgueras

Abstract

Contract-based Programming or Design By Contract (DBC) is a discipline