Architecture Reconstruction to Support a Product Line Effort: Case Study
July 2001
Architecture Tradeoff AnalysisUnlimited distribution subject to the copyright.
[Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File]
The Software Engineering Institute is a federally funded research and
development center sponsored by the U.S. Department of Defense.
Copyright 2001 by Carnegie Mellon University.
NO WARRANTY
THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS
FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT
LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY,
OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES
NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT,
TRADEMARK, OR COPYRIGHT INFRINGEMENT.
Use of any trademarks in this report is not intended in any way to infringe on
the rights of the trademark holder.
Internal use. Permission to reproduce this document and to prepare derivative
works from this document for internal use is granted, provided the copyright
and "No Warranty" statements are included with all reproductions and
derivative works.
External use. Requests for permission to reproduce this document or prepare
derivative works of this document for external and commercial use should be
addressed to the SEI Licensing Agent.
This work was created in the performance of Federal Government Contract Number
F19628-00-C-0003 with Carnegie Mellon University for the operation of the
Software Engineering Institute, a federally funded research and development
center. The Government of the United States has a royalty-free
government-purpose license to use, duplicate, or disclose the work, in whole
or in part and in any manner, and to have or permit others to do so, for
government purposes pursuant to the copyright license under the clause at
52.227-7013.
For information about purchasing paper copies of SEI reports, please visit the
publications portion of our Web site
(http://www.sei.cmu.edu/publications/pubweb.html).
Members of the technical staff at the SEI recently conducted architecture reconstructions on three small automotive motor systems. One of the systems has an interface to an external bus within the automobile (the CAN bus); the other systems do not include this interface. An outline of the Architecture Reconstruction process is given below. It is followed by an outline of the Dali workbench, the tool used to support the architecture reconstruction effort. The software architecture reconstruction process comprises five phases, as
shown in Figure 1.
[DTIC Page]
[PDF File]
1
Introduction
All five phases are highly iterative. In addition, the entire process may have to be repeated several times to extract the right information and to build useful architectural representations.
1.2 The Dali WorkbenchWe carried out the architecture reconstruction activities using the Dali workbench. It is a collection of tools that primarily include Rigi, Dali (an extension of Rigi), and PostgreSQL.
|
Figure 1. The Dali Workbench Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
[Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File] 2 View Extraction
In the View Extraction phase, we analyzed the existing design and implementation artifacts and constructed a system model based upon multiple views. We then used source artifacts (e.g., code, header files, build files) and other artifacts (e.g., execution traces) to identify and capture the elements of interest, define their relationships, and extract several fundamental views of the system.
The following sources of information were available:
- the source code of the systems
- feature specification for the motor systems. This was not particularly helpful in the reconstruction process.
- the staff who maintained the existing system
Both Imagix-4D and SniFF+ tools were applied to extract views from the source code [Imagix 01], [Sniff 01]. After analyzing the output from both tools, we concluded that the Imagix-4D was more useful for extraction purposes. Table 1 shows the statistics for one of the motor systems.
Table 1: Source Statistics for One of the Systems
|
Files |
KLOC |
Functions |
Macros |
Variables |
Types |
|
|
C/c |
44 |
31 |
316 |
312 |
803 |
43 |
|
Header |
23 |
7 |
0 |
1102 |
222 |
70 |
|
Total |
67 |
38 |
316 |
1414 |
1025 |
113 |
While using Imagix-4D to carry out the extraction, we found it necessary to make minor changes to the code. These changes included
- the commenting of bit masks such as
#define PRO_MASK 0b10000000
- compiler specific keywords such as @tiny, @interrupt had to be commented
- assembler code between @asm and @endasm was commented
- some #define constructs for single bit accesses such as #define b_motor_on status1._0 were changed to variable declarations so that they were picked up by the parser unsigned char b_motor_on
The code was parsed and loaded into Imagix-4D. The Imagix-4D tool exported information from its internal representation to a set of flat files. We then extracted the elements and relations that we required. Table 2 shows the set of elements and relations that were extracted from each system.
Table 2: The Set of Source Elements and Relations Extracted
|
Source Element |
Relation |
Target Element |
Description |
|
File |
includes |
File |
A C preprocessor #include of one file by |
|
File |
contains |
Function |
A definition of a function in a file |
|
File |
defines_var |
Variable |
A definition of a variable in a file |
|
Function |
calls |
Function |
A static function call |
|
Function |
access_read |
Variable |
A read access on a variable |
|
Function |
access_write |
Variable |
A write access on a variable |
Since these systems run in an embedded environment without profiling tools, we were unable to use any standard dynamic information gathering techniques. We were also unable to instrument the code and get run-time output for the same reason. Instead, the architecture reconstruction was carried out using static information only.
[Top] [Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File] 3 Database Construction
After extracting the views, we converted the views into the Rigi Standard
Format. The data was next converted into SQL code, then stored in a relational database. Several tools and techniques were incorporated into the Dali workbench to expedite this process. A perl script was applied to convert the elements and relations (Extracted View) file to Rigi Standard Format. The Rigi Standard Format files were then read by another perl script and output in a format that included the SQL code needed to build and populate the relational tables.
Figure 2 describes this process.
Dali currently uses the PostgreSQL relational database. By
executing the SQL code in the file, one set of tables is created for each
relation. The data is then entered into these tables. At that point, two
additional tables are generated: components and relationships.
The components table lists the set of source and target elements. The
relationships table lists the set of relations extracted from the
system. The View Fusion process involves defining a set of queries to manipulate
the extracted views and create fused views. We carried out two fusions
in this case study: In some cases, a static call view may be fused with a dynamic call view. The reason is that a static view may not provide all of the architecturally relevant information required. In the case of late binding in the system, some function calls may not be identified until run-time, so there is a need to generate a dynamic call view. These two views needed to be reconciled and fused to produce the complete call graph for the system. In reconstructing these systems, however, only static information was available. The updated components table had the attributes
Figure 2. Conversion of the Extracted View to SQL Format
Figures in this file are displayed in a separate browser
window. This window will remain open to display figures in this file,
although it might be hidden behind other browser windows.
[Top] [Abstract]
[Figures]
[Introduction]
[View Extraction]
[Database Construction]
[View Fusion]
[Architecture Reconstruction]
[Results]
[References]
[DTIC Page]
[PDF File]
4
View Fusion
|
Figure 3. Example Fusion Query to Set the Type of Each Element Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
One of the automotive motor systems contained code developed by the organization, external code for the CAN bus, and code to interface between these two pieces of software. In performing the reconstruction, we were interested in identifying the code in each of these parts of the system (high-level components). We wrote a query that created a separate table within PostgreSQL for each component and derived its visualization. Figure 4 presents a view of all three high-level components.
|
Figure 4. High-Level Component Decomposition for One Motor System Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
This high-level decomposition allowed us to concentrate our reconstruction efforts on the most important code to the organization, the INTERNALSW component.
[Top] [Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File] 5 Architecture Reconstruction
The Architecture Reconstruction phase consisted of two primary activity areas:
- visualization and interaction
- pattern definition and recognition
Once Dali has opened and loaded the database containing the various views, it generates a visual representation similar to that shown in Figure 5. We examined the visualization to define and recognize the various patterns, and uncover the architecture of the system.
|
Figure 5. Initial Visualization Generated by Loading the View into Rigi Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
By aggregating the variables and functions the file contains, we were able to obtain a view of the system in terms of various files and their relations. Figure 6 shows this visualization.
|
Figure 6. File Aggregation of Functions and Variables Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
In this view, the connections (arcs) between the nodes (files) represent different types of relations. For example, there may be simple relations such as one file includes another file, or the arc could represent composite relations of different types (a function in the file calls a function in the other, and a variable in the file is accessed in the other).
We began to identify architecture components by reading comments in the code to determine what functionality was being carried out in the file. We also read the documentation and talked to system maintainers. This enabled us to identify several components and determine which files belonged to a particular component. A visualization of the components was generated by creating and executing a pattern on the view shown above in Figure 6. The resulting view is shown in Figure 7.
By reading the comments and examining the code, we learned that that the HWPARAMETER component consisted of a set of declaration of hardware specific variables that were included in almost every file. We manipulated the visualization manually to hide this component. By similar means, we identified that the UTILITY component consisted of a set of utility functions that were accessed by almost all of the components. We manipulated the visualization to hide this component, as well.
|
Figure 7. Components in the INTERNALSW Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
An examination of the BLACKBOARD component revealed how it was used. The component contains a set of files in which large sets of variables are declared. Other components access the values in these variables (access_read view) and some of the components set the values of these variables (access_write view). We identified this approach as the blackboard architectural style and produced the view shown in Figure 8.
|
Figure 8. Use of the Blackboard Architectural Style Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
Next, we removed the BLACKBOARD component and the arcs to it to determine the functional decomposition of the system. Figure 9 shows a visualization of the functional decomposition. All the arcs except the calls view between functions in the components are hidden.
|
Figure 9. Functional Decomposition of the Components (with COMMIF and EXTERNALSW) Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
By removing the COMMIF and EXTERNALSW components from the view, we isolated software of interest in the case study. This updated view is shown in Figure 10.
|
Figure 10. Functional Decomposition of INTERNALSW Figures in this file are displayed in a separate browser window. This window will remain open to display figures in this file, although it might be hidden behind other browser windows. |
In this view, we can identify some layering between the components. The MAIN component is at a higher layer than the CONTROL component and there is a layer under that containing the USERIF, CRITICAL, PTION, and EEP components. However this is not a strictly layered architecture, as we can see by the links between MAIN and the lower level components USERIF, CRITICAL, PTION, etc. By examining these links, we determined that the main function (contained in the MAIN component) contains a cyclic executive that calls various functions in the different components. This architecture style is typical of embedded system software with hard performance requirements.
[Top] [Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File] 6 Results
The view of the software in Figure 10 shows the various architecture components in one of the motor systems. The same process outlined in the last section was carried out for the three systems in the case study. In each of the systems, we identified similar components. We also came up with several important differences in characteristics among these systems by talking to the maintainers. For example, each system had different performance requirements. In the motor system with the CAN bus interface, certain information was obtained from the CAN bus. This information was not available in the other systems because they lacked this interface.
We further identified several architectural styles in the three systems:
- blackboard style. It shows that system functionality was divided across several computational steps; and each step is a knowledge source. Together, they follow a set of rules to form the solution. After each computation, several reactions are possible. We captured this using a large amount of state variables.
- cyclic executive style. It was identified in the MAIN component of each system. The MAIN component calls functions in each of the other components. This architecture style is typical of embedded system software with hard performance requirements and with both critical and less critical functionality.
- partial layered style. It was identified in each of the systems, although it was not strictly followed because of the cyclic executive.
We used the system reconstructions to determine the architectural and technical feasibility of developing a software product line from the three small automotive motor systems. A method, Mining Architectures for Product Line Evaluations (MAP) [Stoermer 01], has been developed that outlines the activities required to help stakeholders make that decision. Currently, the customer organization has an effort underway to develop a product line architecture for two of the motor systems and has produced a prototype product line. The organization is now investigating the feasibility of including the other system as well as additional products in that product line.
[Top] [Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File]
| References | |
|
[Kazman 00] |
Kazman, R.; Klein, M. & Clements, P. ATAM: Method for Architecture Evaluation (CMU/SEI-2000-TR-004 ADA 382629), Pittsburgh, PA: Carnegie Mellon University. (2000). |
|
[Müller 93] |
Müller, H. A.; Mehmet, O. A.; Tilley, S. R. & Uhl, J. S. "A Reverse Engineering Approach to System Identification." Journal of Software Maintenance: Research and Practice 5, 4 (December 1993): 181-204 |
|
[Stoermer 01] |
Stoermer, C. & O'Brien, L. "MAP: Mining Architectures for Product Line Evaluations." Working IEEE/IFIP Conference on Software Architecture, Amsterdam, The Netherlands, August 28-31, 2001. |
[Top] [Abstract] [Figures] [Introduction] [View Extraction] [Database Construction] [View Fusion] [Architecture Reconstruction] [Results] [References]
[DTIC Page] [PDF File]
|
REPORT DOCUMENTATION PAGE |
Form Approved |
|||||
|
Public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions, searching existing data sources, gathering and maintaining the data needed, and completing and reviewing the collection of information. Send comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing this burden, to Washington Headquarters Services, Directorate for information Operations and Reports, 1215 Jefferson Davis Highway, Suite 1204, Arlington, VA 22202-4302, and to the Office of Management and Budget, Paperwork Reduction Project (0704-0188), Washington, DC 20503. |
||||||
|
1. agency use only (Leave Blank) |
2. report date July 2001 |
3. report type and dates covered Final |
||||
|
4. title and subtitle Architecture Reconstruction to Support a Product Line Effort: Case Study |
5. funding numbers F19628-00-C-0003 |
|||||
|
6. author(s) Liam O’Brien |
||||||
|
7. performing organization name(s) and address(es) Software Engineering Institute |
8. performing organization CMU/SEI-2001-TN-015 |
|||||
|
9. sponsoring/monitoring agency name(s) and address(es) HQ ESC/XPK |
10. sponsoring/monitoring agency report number |
|||||
|
11. supplementary notes |
||||||
|
12a distribution/availability statement Unclassified/Unlimited, DTIC, NTIS |
12b distribution code |
|||||
|
13. abstract (maximum 200 words) Recently, technical staff members of the SEI performed architecture reconstructions on three small automotive motor systems.1 One system has an interface to an external bus within the automobile (the Controller Area Network [CAN] bus). The other systems do not have this interface. This technical note describes the architecture reconstruction process that was followed. It provides an overview of the Dali workbench developed to support this process, presents the various activities in each phase of the process, and outlines the results that were produced. |
||||||
|
14. subject terms Architectural styles, architecture reconstruction, reverse engineering |
15. number of pages 25 |
|||||
|
16. price code |
||||||
|
17. security classification of report Unclassified |
18. security classification of this page Unclassified |
19. security classification of abstract Unclassified |
20. limitation of abstract UL |
|||
|
NSN 7540-01-280-5500 |
Standard Form 298 (Rev. 2-89) Prescribed by ANSI Std. Z39-18 298-102 |
|||||
| 1 | The name of the organization sponsoring the case study is not used. Some of the component names also have been changed. |