• No results found

Teaching Software Architecture Concepts with HUSACCT

N/A
N/A
Protected

Academic year: 2021

Share "Teaching Software Architecture Concepts with HUSACCT"

Copied!
4
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Teaching Software Architecture Concepts with HUSACCT

Tool Demo

Christian K¨oppe

HAN University of Applied Sciences, Arnhem/Nijmegen, the Netherlands

christian.koppe@han.nl

Leo Pruijt

HU University of Applied Sciences, Utrecht, the Netherlands

leo.pruijt@hu.nl

Abstract

Teaching software architecture (SA) in a bachelor computer science curriculum can be challenging, as the concepts are on a high ab-straction level and not easy to grasp for students. Good techniques and tools that help with addressing the challenging SA aspects in a didactically responsible way are needed.

In this tool demo we show how we used the software architec-ture compliance checking tool HUSACCT for addressing various concepts of SA in our courses on software architecture. The stu-dents were introduced to architectural reconstruction and architec-ture compliance checking, which helped them to gain important insights in aspects such as the relation between architectural mod-els and code and the specification of dependency relations between architecture elements as concrete rules.

Categories and Subject Descriptors K.3.2 [Computers and Edu-cation]: Computer and Information Science Education —Computer science education

General Terms Software Architecture, Education

Keywords Architecture Reconstruction, Architecture Confor-mance Checking

1.

Introduction

Software architecture is a complex knowledge area, where many concepts are on a high abstraction level. Addressing all these con-cepts in a way that the students can easily grasp them is challeng-ing.

In our experience, many students perform well at the lower level concepts of programming and small-scale designing. The more ab-stract the concepts become, the more difficult it is for them to grasp these concepts and connect their programming knowledge to these high-level architectural concepts. We observed that stu-dents often develop high-level architectural models such as com-ponent diagrams or layered architectures, but somehow don’t see them directly related to the system to be built based on these mod-els. In the implementation of such systems, the architecture is often

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted.

presented at SPLASH-E 2015, October 26, 2015, Pittsburgh, PA, USA. Copyright is held by the owner/author(s).

not completely realized as intended. Reasons are many-fold: low-level issues the students solve in the most straight-forward way, hereby violating the architectural decisions made before; insuffi-cient knowledge about how the models translate to concrete imple-mentations; or the perception that architecture needs to be done in larger projects, but is not relevant or valuable when it comes to the concrete realization.

Finding ways to help students with better understanding archi-tectural concepts and supporting them with connecting these con-cepts to their prior knowledge on programming and software design would improve software engineering education. We believe that us-ing a compliance checkus-ing tool such as HUSACCT offers possibil-ities to address these issues in a holistic way. The need for defining the architecture in such a tool including the associated rules that are an essential part of it require the students to think further than just making box-and-arrow diagrams. The students hereby have to ensure that they make correct use of the different architectural el-ements and rule types in order to define a correct representation of the architecture. Furthermore, the necessary correct mapping of these architectural elements to source code artifacts makes this con-nection explicit and shows the students that changing one of them is likely of direct influence on the other one.

In the next section we shortly describe the HUSACCT tool. We then explain how the tool is used in our software architecture courses. We conclude with an elaboration on the educational value of using HUSACCT.

2.

The HUSACCT tool

HUSACCT (HU Software Architecture Compliance Checking Tool) was initially developed by a group of 25 students during an advanced software architecture course at the HU University of Applied Sciences and has been improved since. It supports compli-ance checking of semantically rich modular architectures (SRMA): “expressive modular architectures, composed of different types of modules, which are constrained by different types of rules; ex-plicitly defined rules, but also rules inherent to the module types” [5]. This extensive SRMA support offers good opportunities for applying it also for educational purposes.

The following summary is quoted from [6], where an extensive description of the tool is given:

“HUSACCT is a tool that provides support to ana-lyze implemented architectures, define intended architec-tures, and execute conformance checks. Browsers, dia-grams and reports are available to study the decomposi-tion style, uses style, generalizadecomposi-tion style and layered style [3] of intended architectures and implemented architec-tures. HUSACCT is free-to-use and open source. It has been developed in Java and analyzes Java and C# source

(2)

code. The executable and source code are downloadable at http://husacct.github.io/HUSACCT/. An introduc-tion video and documentaintroduc-tion are accessible at the same site.”

3.

HUSACCT in a software architecture course

Both authors use HUSACCT in courses on software architecture at their universities. The courses are both part of bachelor curricula in Computer Science with a strong focus on Software Engineering. The courses at the HU University of Applied Sciences are at the 2nd year (introductory level) and 3rd year (advanced level). The course at HAN University of Applied Sciences is at the 3rd year.

In the courses, two of the topics covered that make use of the HUSACCT tool are architecture reconstruction and architecture compliance checking. The lectures on these topics consist of the-oretical explanation and hands-on exercises. The results of these exercises are immediately discussed in class. Additionally, take-home assignments are given which implicitly address other impor-tant aspects too (as described in section 4). Example systems for the practical parts were HUSACCT itself (version 1.0) for the take-home assignments and an open source card game for the in-class exercises. Both are implemented in Java, which the students are familiar with, and had the source code available.

The following sections describe the take-home assignments in more detail.

3.1 Assignment 1: Architecture Reconstruction

This assignment is intended for making the students familiar with HUSACCT and to introduce architecture reconstruction, a process of reverse engineering that allows an analyst “to build, maintain, and understand a representation of an existing architecture” [2].

The students get the source code of HUSACCT itself (version 1.0) and have to reconstruct the intended architecture of it. They first have HUSACCT analyze the source code. Based on this anal-ysis, HUSACCT builds an explorable hierarchical model which can be examined using various HUSACCT views. Figure 1 shows a module diagram of the implemented architecture (based on the high-level packages) and their dependencies. Each shown depen-dency is based on a summary of all concrete dependencies between both elements in the implemented system. The number of concrete dependencies is shown in the diagram and the dependencies with the highest numbers of concrete dependencies are additionally em-phasized by representing them with thicker lines. After selection of a dependency arrow in the diagram, a tabular and sortable overview is given of all concrete dependencies. This overview contains infor-mation on the from- and to-artifacts (on class level), the line num-ber in the source code file and the type of dependency. Clicking on a concrete dependency opens a code browser which highlights the line of code causing this dependency.

Using these views, the students have to examine the imple-mented architecture and reason about a probable intended architec-ture. They also have to examine the dependencies in detail, hereby being exposed to a variety of dependency types. Based on their findings, the students finally are asked to identify which elements which parts of the intended architecture represent. All results of this assignment had to be handed in by the students and were discussed in the following class meeting.

3.2 Assignment 2: Architecture Compliance Checking In this assignment, the students are given the intended architecture of HUSACCT v1.0. A component model was provided (see Figure 2), which also formed the starting point of the HUSACCT imple-mentation. All components had a clear responsibility, such as the analysis of the source code (Analyse component) or the definition

Figure 1: Visualization of implemented architecture and a tabular dependency overview

Software Architecture 1

© HU SAP-A4: 1

Assignment SA & Practice 4: Software Architecture Compliance Checking Provided

• HUSACCT, see the previous assignment instruction for download, run, documentation … • ‘SAP 3 HUSACCT_1.0 Source Code Assignment.zip’ in folder Assignments on Sharepoint.

Assignments

1. Create a workspace and analyse the code of HUSACCT_1.0. See the instructions in the previous assignment.

2. Perform a SA compliance check on the top level of the modular architecture.

2.1. Define the intended modular architecture (HUSACCT view: Define intended architecture). 2.1.1. Create modules

Based on the component model below, create five component with the same names. Select SoftwareArchitecture => New Module; enter name and setModule type to Component.

2.1.2. Create rules

In the previous step, for each component a facade and a ‘facade convention rule’ were added automatically. Other rules are derivable from the diagram above. Most dependencies between the components are allowed, but in HUSACCT, ‘is allowed’ rules don’t have to be registered, only real constraints. Register the following rules: Select module => Rules - Add.

From-Module Constraint To-Module

Analyse is not allowed to use Define Analyse is not allowed to use Validate General GUI & Control Is the only module allowed to use Graphics

2.2. Create a diagram of the defined architecture (Define intended architecture => Intended architecture diagram). Export the diagram and include it in your result document. Close the diagram.

2.3. Assign the packages and classes of the source code to the modules of the intended architecture. Select a module and click on Add within panel ‘Assigned software units’. Select and add the software units from the table below. Precondition: the application is analysed.

Module Source code

Analyse husacct.analyse

Interface<Analyse> husacct.analyse.IAnalyseService Define husacct.define

Interface< Define > husacct.define.IDefineService General GUI & Control husacct.control

Interface< General GUI & Control > husacct.control.IControlService,ILocaleChangeListener Graphics husacct.graphics

Interface< Graphics > husacct.graphics.IGraphicsService Validate husacct.validate

Interface< Validate > husacct.validate.IValidateService

Figure 2: Component Model of HUSACCT v1.0

Software Architecture 1

© HU SAP-A4: 1

Assignment SA & Practice 4: Software Architecture Compliance Checking Provided

• HUSACCT, see the previous assignment instruction for download, run, documentation … • ‘SAP 3 HUSACCT_1.0 Source Code Assignment.zip’ in folder Assignments on Sharepoint.

Assignments

1. Create a workspace and analyse the code of HUSACCT_1.0. See the instructions in the previous assignment.

2. Perform a SA compliance check on the top level of the modular architecture.

2.1. Define the intended modular architecture (HUSACCT view: Define intended architecture). 2.1.1. Create modules

Based on the component model below, create five component with the same names. Select SoftwareArchitecture => New Module; enter name and setModule type to Component.

2.1.2. Create rules

In the previous step, for each component a facade and a ‘facade convention rule’ were added automatically. Other rules are derivable from the diagram above. Most dependencies between the components are allowed, but in HUSACCT, ‘is allowed’ rules don’t have to be registered, only real constraints. Register the following rules: Select module => Rules - Add.

From-Module Constraint To-Module

Analyse is not allowed to use Define

Analyse is not allowed to use Validate General GUI & Control Is the only module allowed to use Graphics

2.2. Create a diagram of the defined architecture (Define intended architecture => Intended architecture diagram). Export the diagram and include it in your result document. Close the diagram. 2.3. Assign the packages and classes of the source code to the modules of the intended architecture.

Select a module and click on Add within panel ‘Assigned software units’. Select and add the software units from the table below. Precondition: the application is analysed.

Module Source code

Analyse husacct.analyse

Interface<Analyse> husacct.analyse.IAnalyseService

Define husacct.define

Interface< Define > husacct.define.IDefineService General GUI & Control husacct.control

Interface< General GUI & Control > husacct.control.IControlService,ILocaleChangeListener

Graphics husacct.graphics

Interface< Graphics > husacct.graphics.IGraphicsService

Validate husacct.validate

Interface< Validate > husacct.validate.IValidateService

Figure 3: Example rules of intended architecture HUSACCT v1.0

of the intended architecture (Define component). Additionally, the rules that are applicable for the relations between the modules of the intended architecture and for the modules themselves (such as naming constraints) were given (see Figure 3 for an example). Fi-nally, an overview of the mappings from the elements of the in-tended architecture to the software units in the analyzed source code (Figure 4) was provided. This information was used by the students to define the intended architecture of HUSACCT in the tool itself.

The students then had to execute the compliance check, examine the results, and to answer a series of questions such as “Which rule is most often violated and is this a problem?” or “Will it be easy to replace the existing user interface of Define by another

(3)

Figure 4: Define intended architecture view in HUSACCT, module hierarchy, mapping to software units and rule specification shown

implementation? Why?”. As with the previous assignments, the students had to hand in their results which then were used for an extensive discussion in the next class meeting.

3.3 Assignment 3: Combination of reconstruction and compliance checking

This assignment is given only at the 3rd year students of HU Uni-versity of Applied Sciences as part of the course Advanced Soft-ware Architecture. It is intended for applying both architecture re-construction and compliance checking on a larger and more com-plex system and in a group of 3-4 students. The collaborative aspect encourages discussions between the students and increases the va-riety of e.g. potential solutions.

The students are first asked to analyze a larger open source sys-tem (up to 300.000 lines of code, a couple of examples were pro-vided but the students were free to choose). They then have to de-termine a possible intended architecture through examining the an-alyzed modular elements and reasoning about possible design de-cisions made by the developers of the systems. Based on this likely intended architecture, the students had to identify possible applica-ble rules, e.g. rules of layering if layers were identified or commu-nication via interfaces only if components were identified. Based on the results of the following compliance check, the students have to give advice on possible improvements for the system on both ar-chitectural and implementation level, making again the connection between these two more tangible.

4.

Educational Value of HUSACCT

In our opinion, using HUSACCT in software architecture education is valuable, as it:

•supports the teaching of the procedural part of architecture reconstruction and architecture compliance checking;

•makes the connection between the intended architecture and the realized source code explicit and visible through the required

mapping of architectural elements on software units (as shown in Figure 4);

• supports better understanding of semantically rich modular ar-chitectures [5], as there are two different representations of the intended architecture: as hierarchical tree and as diagram (see Figures 1 and 4);

• supports better understanding of the different types of rules that are related to the dependencies between different modules, as these rules need to be explicitly defined in HUSACCT (see Figure 4);

shows the relation between a logical division into components

in the architecture and the equivalents in the realized software system, as in HUSACCT all elements of the compliance check-ing process map to components in the software architecture (in Figure 4, the component Analyse is mapped to the package husacct.analyse);

• gives good insight in the variety of possible dependencies in source code, as all dependency types described in [4] are in-cluded in the source code analysis of HUSACCT and provided in the violation view (see Figure 5), including direct linking to the violation-causing source code;

• shows the direct relation between an architectural violation and the part of the source code that is responsible for it, again ex-plicitly linking these high- and low-level aspects, hereby mak-ing the relevance of the architectural concepts more experience-able; and

• combines conceptual and procedural knowledge, two important knowledge dimensions as described in the revised Bloom’s taxonomy [1].

However, we cannot provide empirical proof of these assump-tions yet. In the future, we will validate the applicability of the tool in a large scale empirical study across different universities.

(4)

Figure 5: Violation report and implemented architecture view in HUSACCT (only parts are shown)

References

[1] L. W. Anderson and D. R. Krathwohl. A taxonomy for learning, teaching, and assessing: A revision of Bloom’s taxonomy of educational objectives. Addison Wesley Longman, Inc, New York, 2001. ISBN 0321084055. .

[2] L. Bass, P. Clements, and R. Kazman. Software Architecture in Prac-tice, volume 3rd editio. Addison-Wesley Professional, Oct. 2012. ISBN 0321815734, 9780321815736.

[3] P. Clements, F. Bachmann, L. Bass, D. Garlan, J. Ivers, R. Little, P. Mer-son, R. Nord, and J. Stafford. Documenting Software Architectures: Views and Beyond. Addison-Wesley, 2010.

[4] L. Pruijt, C. K¨oppe, and S. Brinkkemper. On the Accuracy of Architec-ture Compliance Checking Support: Accuracy of Dependency Analysis

and Violation Reporting. In Proceedings of the International Confer-ence on Program Comprehension, ICPC’13, pages 172–181, San Fran-cisco, CA, USA, 2013. ISBN 9781467330923.

[5] L. Pruijt, C. K¨oppe, and S. Brinkkemper. Architecture Compliance Checking of Semantically Rich Modular Architectures: A Comparison of Tool Support. In Proceedings of the 29th International Conference on Software Maintenance, ICSM’13, pages 220–229. IEEE Computer Society Press, 2013. .

[6] L. Pruijt, C. K¨oppe, J. van der Werf, and S. Brinkkemper. HUSACCT: Architecture Compliance Checking with Rich Sets of Module and Rule Types. In Proceedings of the 29th IEEE/ACM International Conference on Automated Software Engineering (ASE 2014), pages 1–4, 2014. ISBN 9781450330138. . URL http://dl.acm.org/citation. cfm?id=2642937.2648624.

Referenties

GERELATEERDE DOCUMENTEN

The model of ​rationally ​ contains the general information that is shown on the top right of the decision sheet and the data present in all enhanced containers on the

challenges of the development process are analyzed. Chapter 4 introduces animation technology as an enabling technology for expressive interfaces. Chapter 5 analyzes the software

oName: Report Valid&amp;Priced To GUI oDescription: Send message to GUI oProcess Name: /ProcesseslLogging/MsgToGUI.process oProcess Name Dynamic Override: oSpawn: false oCustom

a) Concisely list and explain the steps of ADD, Attribute-Driven Design b) Give three reasons why it is hard to make purely rational design decisions. c) Concisely explain the

connector view and a module view. b) Provide one viewpoint specification for the Cubos case study. Explain why and for whom that viewpoint is relevant. c) Give the architectural

a) Concisely explain the main characteristic of a component &amp; connector view. b) Provide one viewpoint specification for the EASYMOVE case study. Explain why and for whom

As shown in the FAM, the Administration module consists of four main submodules: Registration, Validation, Storage and Notification.. After Registration, the data is sent to

Explain the main elements of the functional architecture model based on the above model (5p)... Draw a scenario as overlay that describes the main flows of TSD, explain your