Marius Marin, woensdag 04 februari 2009
Software systems are continuously evolved to enhance or correct functionality of earlier releases, to integrate new requirements, or to adopt new technologies. Many of the software systems in use today have been developed over multiple iterations and several years by teams that changed over time or handed over their work. As a result, such systems have become inherently complex, difficult to understand and costly to modify and evolve.
Common techniques for addressing complexity and for improving comprehensibility of software systems include modularization of concerns and structuring of the code by applying well-established design patterns. However, non-trivial software systems unavoidably exhibit concerns whose implementation cannot be mapped onto a single programming module, but cut across the system’s structure. These crosscutting concerns lead to implementations where multiple responsibilities are tangled inside the same module, making it hard to distinguish them and hampering the comprehensibility of the code and the design.
This paper shows how source code query technologies can be used to improve comprehensibility of software systems, and particularly of crosscutting concerns. We illustrate general concepts of employing code queries for software analysis and comprehension through a tool-set for identification and documentation of crosscutting concerns in source code.
Independently of whether they work on building new systems or, most often, on changing and extending existing ones, software developers need to gain a quick insight into complex software applications and into how they provide solutions to specific problems. This task is particularly challenging in today’s software development environments where maintenance and evolution is carried out for ever growing (legacy) applications and involves changing teams, in various different locations.
A major challenge to understanding,maintaining and ensuring the quality of software systems is the presence of crosscutting concerns. In well-designed systems, crosscutting implementation of concerns stems frommodularization limitations of the employed programming paradigms which prevent the mapping of each concern in that system to a dedicated programming module. For example, the module for a business object that requires secured access implements authentication checks as a secondary concern, on top of the core domain functionality. Similarly, typical implementations of system-wide concerns like logging or error handling result in multiple responsibilities, i.e. concerns, tangled in one module, such as a class or a suproutine.
Tangling of concerns hampers program comprehension by making it difficult to distinguish between the different concerns implemented by one module. Furthermore, crosscutting concerns end up scattered over multiple modules harming the quality of the code [Eaddy, Zimmermann, Sherwood, Garg, Murphy, Nagappan, Aho, 2008].
The problem of crosscutting concerns has received significant attention from the software research and practice community, most recently through the popularity of aspectoriented software development (AOSD) techniques [Filman, Elrad, Clarke, Aks¸it, editors, 2005], [Murphy, Schwanninger, 2006], [The AspectJ Programming Guide]. The benefits of using aspect-oriented techniques for implementing typical crosscutting concerns like logging, security or transaction management have been discussed by various authors [Pawlak, Retaill´e, Seinturier, 2005], [Laddad, 2003], [Colyer, Clement, Harley, Webster, editors, 2005], [Colyer, Harrop, Johnson, Vasseur, Beuche, Beust. Point/counterpoint,2006]. However, a different line of argument goes that AOSD techniques require expert users and they have yet to prove their value in improving code comprehensibility and maintainability in the long run and for a wider range of concerns [Steimann, 2006], [Colyer, Harrop, Johnson, Vasseur, Beuche, Beust. Point/counterpoint,2006].
In this paper we present an approach to the management of crosscutting concerns that is a complement to AOSD techniques, but that can also be applied independently. In particular, we focus on the identification and comprehension of crosscutting concerns by demonstrating a tool-set that employs query technologies to search for and to model typical crosscutting relations in source code.
The next section gives a background overview of such topics as crosscutting concerns and source code queries. In Section 3 we look at design considerations for a consistent approach to the identification and modeling of crosscutting concerns. Section 4 describes the tool support of the proposed approach to concern management. We discuss a parallel between query-based approaches and AOSD, challenges to these approaches and interesting directions for further investigation in Section 5, and conclude in the last section....