A Modular Environment for Software Development and Re-engineering. Salvatore Campanaâ, Andrea Poliâ, Luca Spalazziâ , and Francesco Spegniâ .
A Modular Environment for Software Development and Re-engineering Salvatore Campana∗ , Andrea Poli∗ , Luca Spalazzi† , and Francesco Spegni† ∗ Computer
VAR ITT, Verona, Italy {s.campana,a.poli}@computervaritt.it †
Universit`a Politecnica delle Marche, Ancona, Italy {spalazzi,spegni}@dii.univpm.it
Abstract—Traditional software development processes are designed to deal with the construction of new software systems. We believe the software development methodologies should include from the beginning the possibility of a re-engineering phase. With our work we identify the main characteristics that make software (re)engineering tools useful and usable Developing them in a modular architecture allows for a better integration with the developer’s working habits.
Figure 1.
clever navigation tools should allow to move from design to code and viceversa [2], [3]. If the modeling language is general enough, it can be used along the designing, development and re-engineering phases, realizing a more integrated working environment. From the system model, thus, specialized views of the software itself can be obtained, allowing the engineer to focus on different concrete aspects, from time to time. Our approach is based on XAL [4]. A detailed description of the language is beyond the scope of this paper, but an example of XAL program can be found in Figure 2. It should be mentioned that XAL programs are described as sets of timed automata that can be dynamically instantiated at execution-time from a fixed collection of automaton definitions. To make the automata executable, every state is linked to a piece of code written in some pre-existing language (e.g. Java, PHP or XAL itself) and it represents the action of the state itself. When a state action is executed, it can determine the next transition to be taken. The main reason why we adopted XAL is that previous experiences suggested that state-based languages can be understood by both technical and non-technical stakeholders [5]. Also, automata-like languages have survived as documentation artifacts and design aids through several evolutions of programming languages. The proposed architecture is depicted in Figure 1. In our methodology, during Requirements Analysis a first XAL model of the system is sketched. This model can be intuitively validated from the beginning with the help of the users or clients. In addition formal techniques, such as Model Checking, can be used to formally verify that specific properties are met by the provided design. Doing so, helps to early detect design faults, preventing bugs. The implementation task extends the XAL model coding the •
I. I NTRODUCTION Several authors assess those factors that hinder the success of a software product. Some point out that in part it may depends on management issues like budget variation or workforce turnover, or even insufficient training of IT people. Nevertheless, many technical issues may affect the success of a software system. A critical factor is often the capability to recover, after several months or years, the system design from its implementation, abstracting the low level details [1]. An important limitation of classic approaches to software production is that they always require the developing team to synchronize any change on the code with an analogue modification on the documentation. Common programming languages, indeed, are not descriptive enough about what their programs are supposed to do. This doubles the cost of a single conceptual update in the software artifact. It is very important to project tools and methodologies that help software engineers in producing maintainable software, knowing that this will need restructuring from time to time. In our opinion software (re)engineering tools should have the following characteristics: • when a change is made at design level, it should be reflected on the implementation level; • it should extract the abstract model from source code; • it lets you manipulate many languages contemporary. Complex systems, indeed, are often realized using different idioms and the maintenance task itself may require to translate pieces of the system from a legacy language to a more recent one; • it provides means in order to zoom in or out when analyzing the software design;
c 2012 IEEE 978-1-4673-1820-4/12/$31.00
A modular architecture based on XAL
90
TOPI 2012, Zurich, Switzerland
state actions, that can be successively tested individually, e.g. through Unit Testing. Applying the proposed methodology, the system design is described by the state-based description of the XAL program, while the implementation is the collection of all state actions. These two levels can be manipulated separately by the software engineers, helping to distinguish what is mere code refactoring from an architecture restructuring. In case an application has not been developed using the proposed methodology, a XAL based representation can be extracted applying a set of rules defined over the Abstract Syntax Tree of the source code. This set of rules constitute an analysis service called DocXAL [6], [7] which is able to infer XAL models from Java code and index them using a relational DBMS. Successively, using the XAL IDE it is possible to access the models and the indexed information to conduct the desired Business Intelligence analysis.
Figure 2.
A XAL program in the XAL IDE
III. F INAL R EMARKS The XAL-IDE has been used for analyzing the code of Open-Bravo ERP [9], that is made of 3559 classes, 58712 methods and 3.2 · 105 attributes and variables. The case study underlined the need for abstraction techniques (like identifying system entry points). It is currently used as test-bed for the formal verification of security properties on a complex application. For example, one may wish to prove that every view of OpenBravo is accessed only after the user has been authenticated.
II. T HE XAL IDE XAL IDE is the Eclipse plugin that developers can use to create and maintain their software systems, as well as analyze existing ones. It acts as a GUI for producing XAL programs and manipulate the XAL models produced using DocXAL. Relying on an existing modular architecture like Eclipse, we were able to focus on the most advanced and innovative features, as well as to produce a tool that looks familiar to developers that know the platform. The Eclipse architecture also allowed us to export the XAL IDE on a Tomcat webserver, through the Eclipse RAP project [8], without needing to create a different version of the tool. The main functionalities of XAL IDE at the moment are: • visual and textual editing of the XAL programs • integration of external parsers, to read method signatures of Java and PHP files used as state actions; • visual marking of graphical components that have erroneous or incomplete specifications; • a list of reference for each automata definitions is kept. This helps to choose the components to focus on (e.g. the application entry points or the most referred components); • basic graph layout algorithms are provided, in order to optimize the visualization of states and transitions for large automata. For the future, we are considering to add this features: • interaction with the repository of inferred XAL programs, using existing Version Control Systems; • model checking XAL programs using tools like NuSMV or Uppaal • state abstraction techniques for manipulating groups of states. For example a collection of states could be mapped onto a single one.
R EFERENCES [1] P. Tonella, M. Torchiano, B. Du Bois, and T. Syst¨a, “Empirical studies in reverse engineering: state of the art and future trends,” Empirical Software Engineering, vol. 12, no. 5, 2007. [2] J. Singer, T. Lethbridge, N. Vinson, and N. Anquetil, “An examination of software engineering work practices,” in CASCON First Decade High Impact Papers. ACM, 2010. [3] T. Lethbridge, “Architecture of a source code exploration tool: A software engineering case study,” Journal of Inf. Tech. and Eng., 1997. [4] S. Campana, L. Spalazzi, and F. Spegni, “Dynamic Networks of Timed Automata for Collaborative Systems: A network monitoring case study,” in Int. Symp. on Collaborative Technologies and Systems. IEEE, 2010. [5] D. Harel, “Some thoughts on statecharts, 13 years later,” in Computer Aided Verification. Springer, 1997, pp. 226–231. [6] F. Spegni, “Formal methods for practical reverse engineering and software verification,” Ph.D. dissertation, Univ. Polit. delle Marche, Ancona, Italy, 2011. [7] Computer VAR ITT. XAL project. [Online]. Available: http://www.computervaritt.it/xal/ [8] F. Lange, Eclipse Rich Ajax Platform.
Apress, 2008.
[9] OpenBravo Team. OpenBravo ERP. [Online]. Available: http://www.openbravo.com/
91