Learning Software Engineering Principles
Learning Software Engineering Principles
Learning Software Engineering Principles
Abstract - Traditional lectures espousing software such as TextPad. They also typically do not get opportunities
engineering principles hardly engage students' attention to examine others’ code which prevents them from
due to the fact that students often view software understanding the challenges of writing code that others can
engineering principles as mere academic concepts easily comprehend and maintain. Just as reading good
without a clear understanding of how they can be used in writing is used as a basis to teach students to write well, we
practice. Some of the issues that contribute to this believe that examining the code written by software
perception include lack of experience in writing and professionals entails several benefits for aspiring software
understanding large programs, and lack of opportunities engineers.
for inspecting and maintaining code written by others. Therefore, the overarching goal of this project is to
To address these issues, we have worked on a project teach students a subset of basic software engineering
whose overarching goal is to teach students a subset of principles by focusing on the practical aspect of software
basic software engineering principles using source code engineering. For this purpose, we selected a subset of
exploration as the primary mechanism. We attempted to activities that we believe can enrich significantly the
espouse the following software engineering principles students experience when dealing with software. These tasks
and concepts: role of coding conventions and coding include browsing and exploring an open source code base,
style, programming by intention to develop readable and assessing the quality of the design based on computed
maintainable code, assessing code quality using software software metrics, applying reverse engineering techniques to
metrics, refactoring, and reverse engineering to recover synthesize higher abstractions, and performing refactoring
design elements. Student teams have examined the and assessing the impact of proposed changes to the code
following open source Java code bases: ImageJ, Apache base.
Derby, Apache Lucene, Hibernate, and JUnit. We have The software engineering course where this project is
used Eclipse IDE and relevant plug-ins in this project. incorporated into the syllabus is offered as a junior/senior
undergraduate level course. It should be noted that the intent
Index Terms – Eclipse, Open source software, Source code of our approach is not to provide any quantitative metrics on
exploration, Software engineering education. the tasks that the students were engaged in, but rather to
qualitatively assess the effect that the approach had on
INTRODUCTION students’ understanding of basic software engineering
Teaching software engineering (SE) principles and concepts concepts and principles at both conceptual and pragmatics
in a one-semester undergraduate software engineering levels.
course is a challenging task. Students often view software The remainder of the paper is organized as follows. In
engineering principles as mere academic concepts with less the next section, we describe the SE principles taught to our
practical value. We believe that this perception is a result of students. The open source software (OSS) and Eclipse plug-
the various projects they were involved with in the previous ins that were used in our project are discussed next.
computer science courses such as computer science I, Following this, the details of the procedure used in this
computer science II, data structures and algorithm analysis, project are provided. Related work in using open source
where the focus was on mere programming tasks rather than software in software engineering and computer science
analysis, design, implementation, and maintenance of education is described next. The last section concludes the
software systems. As a result, the largest programs that they paper.
have written did not exceed few hundred lines of Java code SOFTWARE ENGINEERING PRINCIPLES
with at most eight to ten classes. Though, they have a
conceptual understanding of how to structure a system into We used source code exploration of open source software
subsystems using constructs such as Java packages, they applications as the primary means to expose students to
have not applied these concepts due to the trivial nature of various software engineering concepts. The SE concepts we
the programming problems that they have worked on thus focused on in this paper include:
far. In addition, their exposure to Integrated Development • Familiarizing students with the contents of an open
Environments (IDE) is limited to the simpler ones such as source software applications at various levels of detail
DrJava and BlueJ, and in some cases it is just a simple editor using Eclipse IDE perspectives and views.
978-1-4244-1970-8/08/$25.00 ©2008 IEEE October 22 – 25, 2008, Saratoga Springs, NY
38th ASEE/IEEE Frontiers in Education Conference
S3H-18
Session S3H
• Assessing conformance with established coding software quantitatively so to enable classification,
conventions and style. comparison, and analysis tasks. In addition, metrics provide
• Programming by intention as a way to develop simple, support for planning, monitoring, controlling and evaluating
clear, readable, and maintainable code. the software process and/or product. In this paper, we focus
• Understanding and appreciating the role of software mainly on software product metrics such as size metrics,
metrics in assessing code quality. logic complexity metrics, cohesion, coupling, and certain
• Reverse engineering parts of the code to recover various OO metrics. These metrics can be automatically computed
design elements in the form of UML diagrams. using Eclipse plug-ins. The goal of this activity is to drive
• Understanding what and how of refactoring and home the point that there are quantitative aspects to the
applying some basic refactoring techniques to the target software engineering activities.
source code. V. Reverse Engineering
Reverse engineering is the process of analyzing a software
I. Source Code Browsing system to create representations of the system at higher
Eclipse IDE with JDT (Java Development Tools) [1] and levels of abstraction [7]. The primary goal of reverse
related plug-ins are used for the source code exploration engineering is to help software engineers understand a
activities of the open source software applications studied. poorly documented software system when solving
JDT offer four perspectives to understand various parts of a maintenance tasks. Reverse engineering has many key
project: Java, Java Browsing, Java Type Hierarchy, and objectives, but the ones that are directly relevant to our
Debug. A perspective in Eclipse workbench is a collection project consist of generating alternate views and
of editors and views. An editor allows you to read and/or synthesizing higher abstractions from the source code. These
write a particular file type. A view is a metadata presentation views are represented using UML. For this purpose, Eclipse
of information on the workbench. Some commonly used UML plug-ins were used. A secondary goal of this activity
views in JDT include Package Explorer, Outline, and is to emphasize the importance of producing and preserving
Hierarchy. Using these perspectives and views, one can gain analysis and design artifacts and their role in comprehending
good understanding of the various components that make up large software systems.
the source code of a software package. For most of our VI. Refactoring
students, this is the first time that they have been exposed to
software systems that are comprised of various packages and The goal of refactoring is to improve the design or internal
significant number of classes within packages. structure, make it easier to understand and cheaper to modify
[2, 3]. Refactoring is an on-going activity during
II. Coding Conventions and Style development and should be done when new functionality is
Coding conventions and style contribute to readability and added, defects are fixed, code is reviewed, and bad code
maintainability of an application. In this project, we used smells are detected [3]. Major IDEs available in the market
coding conventions for the Java language developed by Sun today provide some degree of support for performing
Microsystems. While browsing the source code, students refactoring activities on source code. Our project uses
were asked to qualitatively assess the extent to which their Eclipse IDE which provides good support for refactoring.
code adheres to the Sun coding conventions and consistency Students recognize that just as any good piece of writing
in style through manual inspection and/or using a relevant requires a few iterations and revisions, producing quality
Eclipse plug-in. The goal here is to impress upon the software requires continuous improvements throughout the
students that coding conventions and style are essential to development life cycle.
any real-world software system which is typically developed
by scores of software engineers. OPEN SOURCE SOFTWARE USED
III. Programming by Intention We have used the following open source software packages
in the source code exploration project:
Code readability is enhanced by making your intention clear • ImageJ – an image processing and analysis system
when you write code – programming by intention [2]. The (http://rsb.info.nih.gov/ij/) from the National Institutes
main idea of programming by intention is to make code as of Health (NIH).
understandable and intent-revealing as possible by • Apache Derby – an open source relational database
appropriately choosing the names of the identifiers used in a implemented entirely in Java
program such as classes, variables, methods, etc. Students (http://db.apache.org/derby/). This system has a small
recognize that producing quality software is a highly footprint that enables it to be embedded into real-time
intellectual activity, and never a mechanical task. applications.
IV. Software Metrics • Hibernate – an easy to use framework for mapping an
object-oriented domain model to a traditional relational
Software metrics measure various aspects of a piece of database (http://www.hibernate.org/).
software [5, 6]. They help characterize features of interest in