The main contribution of this thesis is the formal specification and analysis of an adaptivity component, as part of a middleware application, that is responsible for adapting the cloud service content to different device profiles and changing network conditions. The main objectives of this work are: to determine the appropriate approach for layout and content adaptation regarding device and network characteristics, provide a formal design of the system, and validate and verify the high-level specifications. The communication channel between the client and the adaptivity component is envisioned as a web application, but this does not disregard the adaptation requirement, because still considerable amount of the web content is designed for desktop computers. Due to the fact that modeling languages currently used in cloud computing and web development areas have informal definitions and ambiguous semantics, and their use may, therefore, be unreliable, the request of formal methods for the specification and analysis in these areas increased. The adaptivity component is split into two parts: the adaptation based on device properties and the adaptation built upon network attributes. Each part contains two phases: the characteristics discovery and the adaptation, which enhances the cloud services with the capability to react and change in response to the specific characteristics.