When engineering complex and distributed software and hardware systems (increasingly used in many sectors, such as manufacturing, aerospace, transportation, communication, energy, and health-care), quality has become a big issue, since failures can have economic consequences and can also endanger human life. Model-based specifications of component-based systems permit to explicitly model the structure and behaviour of components and their integration. In particular Software Architectures (SA) have been advocated as an effective means to produce quality systems. In this chapter by combining different technologies and tools for analysis and development, we propose an architecture-centric model-driven approach to validate required properties and to generate the system code. Functional requirements are elicited and used for identifying expected properties the architecture shall express. The architectural compliance to the properties is formally demonstrated, and the produced architectural model is used to automatically generate Java code. Suitable transformations assure that the code is conforming to both structural and behavioural SA constraints. This chapter describes the process and discusses how some existing tools and languages can be exploited to support the approach.
Top1. Introduction
Software Architectures (SAs) are typically used to specify high level design blueprints of the systems under development and later on for maintenance and reuse purposes (in order to capture and model architectural design alternatives). At the same time, SAs can be used in order to analyze and validate architectural choices, both behavioural and quantitative (by complementing traditional code-level analysis techniques). More recently, architectural artefacts have been used to implicitly or explicitly guide the design and coding process (ArchJava Project, 2005; Fujaba Project, 2006). In summary, SA specifications are nowadays used for many purposes (Mustapic, 2004; Bril, 2005) like documenting, analysing, or guiding the design and coding process.
Even though SA documentation, analysis, and code generation have been intensively analyzed in isolation (e.g., Bernardo, 2003; Muccini, 2006; Fujaba Project, 2006) (code generation only very recently and partially), a tool supported process for selecting and documenting the right architecture and for successively propagating architectural design to the final system implementation is still missing. Analysis techniques and tools have been introduced to understand if the SA satisfies certain expected properties. By using model checking, testing, performance analysis (and others) at the architectural level, a software architect can assess the architectural quality and predict the final system characteristics. In the context of code generation, this verification phase assumes even a more central role, being the selected architectural model used for (automatically) deriving the system implementation. However, most of the analysis techniques rely on formal architectural specifications (e.g., (Bernardo, 2003)) of difficult application in industrial projects and of difficult integration in the software development process.
In this chapter we propose an architecture-centric development approach which enables the Java code generation of a software system from a high quality architectural model-based design. High quality architecture hereafter is referred to the SA ability to fulfil certain functional and temporal constraints as imposed by the requirements. Other qualities (i.e., performance, security, safety, reliability, etc..) are not explicitly taken into consideration. The formally verified SA is then the starting point of model transformations that produce a skeleton of the Java code implementing the specified system. The produced code reflects both structural and behavioural SA constraints and consequently assures the validity of defined, specified, and verified functional requirements.
Thus the goals of this work are twofold: to validate the model-based architectural specification with respect to defined requirements, and to use this validated model to guide the generation of a quality system implementation using model-driven techniques. Moreover, the approach promotes the following key benefits: (i) a model-based specification of the SA is provided, (ii) the conformance relation between functional requirements and architecture is validated, and (iii) Java code is automatically generated from architectural models. The generated code is obliged to respect both structural SA constraints (e.g., each component can only communicate using connectors and ownership domains (Aldrich 04) that are explicitly declared in the SA) and behavioural constraints (i.e., methods provided by components have to be invoked consistently with respect to the architectural specification). The approach is supported by automated tools, which allow formal analysis and permit code generation from the validated architecture. Overall, the approach encourages developers to make a more extensive and practical usage of SA specifications.
The remaining of the chapter is organized as follows: Section 2 outlines the state of the art on functional requirements specification, on SA modelling and analysis, and on code generation. Based on this background information, Section 3 describes our proposal for an architecture-centric model-driven and quality oriented development process from requirements to code. Section 4 introduces an ATM system running case study that is used for detailing the approach. Section 5 draws future research directions. Section 6 discusses related work, while Section 7 concludes the chapter.