Ad hoc networks are multi-hop wireless networks where all nodes cooperate to maintain the network connectivity without centralised administration. The use of this emerging technology extends from military to civilian applications. Routing protocols, which are key elements for these networks, are in charge of establishing routes between network nodes efficiently. Despite the interest shown by the scientific community and industry in converting the first specifications of ad hoc routing protocols in functional prototypes, aspects such as the resilience of these protocols remain generally unaddressed in practice. Tackling this issue becomes critical given the increasingly variety of accidental and malicious faults (attacks) that may impact on the behaviour exhibited by ad hoc routing protocols. There exist many and varied challenges in the deployment of ad hoc routing protocols, but the need for methods to evaluate and justify their resilience is, without doubt, one of the most important. This lack can be addressed through the deliberate and controlled introduction of faults in the system. This technique, can be useful to measure the network behaviour in adverse conditions. The main objective of this thesis is to design and implement a framework based on the injection of accidental and malicious faults to quantitatively evaluate their impact in routing protocols. This framework, called REFRAHN (Resilience Evaluation FRamework for Ad Hoc Networks), can be used to (i) identify sources of problems in the deployment of ad hoc routing protocols, (ii) design fault-tolerant mechanisms that address and minimise these problems, (iii) compare and select which is the routing protocol that fits the best the system requirements, and finally (iv) determine how to optimise the performance and robustness of the network, tuning the settings of routing protocols, and their dependability and security complements. By tackling this topic, this thesis aims at making a step forward to improve the resilience aspects of ad hoc networks.