The shape memory eect in NiTi based shape memory alloys (SMAs) strongly depends on the microstructure. All types of microstructural defects, ranging from point defects to precipitates, affect the elementary processes of the martensitic transformation and thus shape memory properties. It is well known that cyclic shape memory operation results in a degradation of the shape memory effect due to the accumulation of lattice defects. This process is referred to as functional fatigue. The present work demonstrates how different types of microstructures evolve during various processing routes and how the functional stability of the material can be optimized. The first part of the presentation addresses the preparation and functional fatigue testing of NiTi and NiTiCu spring actuators. We show that thermomechanical cycling of the actuators gradually degrades the shape memory performance. With increasing cycle number, the geometries of a spring actuator in its high and in its low temperature phase change due to the accumulation of dislocations. Additionally, thermomechanical cycling results in an increase in martensite start and finish temperatures. We show that there are two options to increase the cyclic stability of the actuator: (1) Cold work prior to shape setting increases the material strength and thus impedes irreversible dislocation plasticity. (2) Alloying Cu improves the crystallographic compatibility between the low and the high temperature phase. As a consequence, fewer defects are generated during cyclic actuator operation. The second part of the presentation addresses NiTi SMAs with ultra- fine grained (UFG) microstructures of the high temperature phase. We show how different types of microstructures can be obtained by severe plastic deformation using high pressure torsion (HPT) and equal channel angular pressing (ECAP). As an alternative, we introduce a processing route which allows the production of UFG NiTi by simple conventional wire drawing. We show that UFG microstructures in SMAs strongly aect the martensitic transformation. While the initial coarse grained material shows a well defined one-step martensitic transformation on cooling (B2!B19), two-step transformations (B2!R!B19) were found for UFG material states. This finding can be explained on the basis of a scenario where grain boundaries impede the accommodation mechanisms of the martensitic transformation by imposing geometrical constraints. We further demonstrate that UFG NiTi alloys outperform conventional NiTi alloys in terms of shape memory effect stability. Dislocation plasticity which accounts for irreversible deformation is strongly reduced in UFG microstructures.