Technological development and scientific research are steadily enabling higher levels of automation in the global industry. In the aerospace sector, the operation of Unmanned Aircraft System (UAS) is a clear example. Given the huge potential of the UAS market, Civil Aviation Authorities are elaborating a new regulatory framework for the safe integration of UAS into the civil airspace. The general goal is ensuring that the operation of UAS has an Equivalent Level of Safety (ELOS) to that of manned aviation. To meet the previous goal, this thesis advocates for increasing the level of automation of UAS operations by providing the automatic system on-board the aircraft with Automated Contingency Management (ACM) functions. ACM functions are designed to assist the pilot-in-command in case a contingency, and ultimately to fully replace the pilot if this is required by the situation (e.g. due to a Command and Control (C2) link loss) or if the pilot decides so. However, in order for automation to be safe, automated functions must be developed following safe design methodologies based on aerospace standards. Agraïments Vull agrair la col•laboració de totes aquelles persones i institucions que han fet possible la realització d'aquesta tesi: En primer lloc, vull fer constar que aquesta tesi ha estat co-financiada pel Fons Social Europeu 2014-2020 i pel programa VALI+d de la Generalitat Valenciana (expedient número ACIF/2016/197). De forma molt especial, vull agrair a Joan Vila la seua dedicació al llarg de tots aquests anys. El seu recolçament i la seua tasca de direcció han estat fonamentals per dur a terme aquest treball. També vull agrair a tots els membres del Department of Unmanned Aircraft del German Aerospace Center-Institute of Flight Systems la seua acollida durant la meua estada a Braunschweig; i en especial a Jörg Dittrich, director del departament; Florian Adolf, supervisor de la estada; i Christoph Torens, per la seua inestimable ajuda. Finalment, vull agrair a la meua familia el seu suport i afecte (tot i el meu geni durant la recta final!): als meus pares, el millor exemple; a Pau i Ana, pels seus consells i comprensió; a Marc, el més bonic; i a Irene, que val el cel.