ECE
417/617 Elements of
Software Engineering
|
|
Spring 2012
In this course students will learn to build high-quality, reliable, and
extensible software systems that are too large for a single programmer.
Emphasis is placed upon good programming practices (object-oriented design and
clean, well-documented code), teamwork skills (planning, communicating, and
interacting), and bringing the project to completion (testing and
verification). A semester-long project complements the theory with practice.
Syllabus
Week
| Topic
| Assignment
|
1
| introduction / overview |
hw01 due 1/23 |
2
| C++ and Visual Studio IDE |
hw02 due 1/30 |
3
| More C++, object-oriented programming, and CVS |
Individual project, attempt #1 due 2/6 |
4
| Software life cycles |
hw03 due 2/13 |
5
| Software process and modeling (UML) |
hw04 due 2/20 (and string class) |
6
| Project management |
hw05 due 2/27 |
7
| Agile methods |
Individual project, attempt #2 due 3/5 |
8
| Requirements |
hw06 due 3/12 (and string class, attempt #2) |
9
| System design |
|
10
| [Spring break] |
hw07 due 3/26 |
11
| Testing |
hw08 due 4/2 |
12
| Risk analysis |
hw09 due 4/9 |
13
| User interfaces |
hw10 due 4/16 |
14
| Formal methods |
hw11 due 4/23 |
15 | Ergonomics |
|
The final exam is scheduled for Thursday 5/03, 3:30 - 5:00.
Required text:
Recommended
books:
Suggested readings:
- Gary Pollice,
Teaching Software Development vs. Software Engineering,
2005
-
Software's Chronic Crisis, Sept. 1994
- Bugs in the news: Rover, MS Server, Mars Climate Orbiter, Mars
Spirit, Toyota
- Walter Royce,
Successful Software Management Style: Steering and
Balance, IEEE Software, 20(5):40-47, 2005
- Michael Cusumano and Richard Selby,
How Microsoft Builds Software
(another
copy accessible from off campus),
Communications of the ACM, 40(6), June 1997
- Robert Guth, Battling Google,
Microsoft Changes How it Builds Software,
Wall Street Journal, Sept. 23, 2005
- Fred Brooks, The Mythical Man-Month After 20 Years, IEEE Software,
12(5):57-60, Sept. 1995 (review of
the book)
- Eric Raymond,
The Cathedral and the Bazaar, 1999
- Cliff Jones et al.,
Verified Software: A Grand Challenge,
IEEE
Computer, 39(4), April 2006
- Barry Boehm,
Making a Difference in the Software Century, IEEE Computer,
41(3), March 2008
- Articles in
Additional software engineering resources
- Introduction
- Condensed Crash Course on C++
- Practice with C++: Writing a
Concrete Class
- Concurrent Versions System (CVS)
- The Software Process
- Modeling
- Design
- User Interface Design
- Testing
- Project Management
- Software Practice
- Formal Methods
- Repetitive Strain Injury (RSI)
A main part of the class is a semester-long project in which the entire class
participates. The project is written in C++ using Microsoft's Visual
Studio integrated development environment (IDE). The code is checked into
a central repository using the concurrent versions system (CVS). There is
also an individual project designed to ensure that each participant is capable
of contributing to the group project. Individual project
The individual project for this semester is explained
here. Individual projects
will be checked into CVS in the directory
class/imageguide/spring2012/individual_projects. Correction: To make life easier for you all, use the assign server
instead of CVS for the individual projects.
To turn in your assignment, send an email to
assign@assign.ece.clemson.edu
(and cc the instructor and grader) with the subject line "ECE417-1,#n"
(without quotes but with the # sign), where 'n' is the assignment number.
Note:
- Use "ECE417" even if you are actually enrolled in ECE617.
- Use n=1 for the first submission, i.e., use "ECE417-1,#1". Then
use n=2 for the second submission, i.e., use "ECE417-1,#2".
You must send this email from your Clemson account, because the assign server is
not smart enough to know who you are if you use another account. E.g.,
do not use @g.clemson.edu. If you are using Gmail, it is not sufficient to
change the 'send mail as:' to @clemson.edu. Instead, from 'Mail Settings'
you need to go to 'Accounts and Import', 'Send mail as:', 'Send mail from
another address', type in your userid@clemson.edu, select 'Send through
clemson.edu SMTP servers', type 'smtp.clemson.edu' along with your userid and
password, select 'Secured connection using SSL', then 'Add account'.
Some helpful hints:
- To create a new application in VS2010, File -> New -> Project -> Visual C++ -> MFC Application
(click Application Type and select Dialog based, which
is the simplest choice)
- To add a button or other UI widget, go to 'Resource View' tab. Click
on dialog, then use Toolbox (small rectangle on the side of the window).
Then right-click on button, and 'Add event handler'.
- To test whether a function is being called, use AfxMessageBox(L"hello").
The 'L' is for unicode strings. To display a variable, use
CString::Format, like this:
CString str;
str.Format(L"x = %d", x);
AfxMessageBox(str);
- To draw a line, use CClientDC, like this:
CClientDC dc(this);
CPen pen(PS_SOLID, 1, RGB(255,0,0));
CPen* oldpen = dc.SelectObject(&pen);
dc.MoveTo(0,0);
dc.LineTo(100,100);
- To draw in OnPaint method, use CPaintDC instead of CClientDC.
Recommendation: Write a function called Redraw(CDC& dc), then a function
called Redraw() { CClientDC dc; Redraw(dc); }. In OnPaint, call {CPaintDC
dc; Redraw(dc); }, but everywhere else just call Redraw();.
- To get the text from an edit box or any other widget derived from CWnd,
use CString str; m_edit.GetWindowText(str); if m_edit is your edit box.
- For more information, browse MSDN. For example, if you search for "CClientDC"
in Google, the first link is:
http://msdn.microsoft.com/en-us/library/dc7zsf0y%28v=vs.80%29.aspx .
From this link, you will see that CClientDC derives from CDC. Then click
on "CDC Class", then "CDC Class Members". Now you will be at this site:
http://msdn.microsoft.com/en-US/library/4acfw2ha%28v=vs.80%29.aspx , which
lists all the methods of the CDC base class. You can browse to learn the
interfaces of the different methods. An easy one to start with is
FillSolidRect. To fill a polygon, use CDC::Polygon.
Deadlines:
- Individual project is due
Feb. 6 at 11:59pm.
- Second
submission due
March 5 at 11:59pm.
Class project
This
semester our client is
Dr. David
Kwartowitz and his lab in Bioengineering. Our goal is to
to design, plan, document, and implement an open-source application
to provide an infrastructure for image guidance, to be used by medical and
bioengineering researchers. The
code is released under the GNU General Public License. Students are divided into groups to develop different components of the
application. Each group is responsible for dividing up the work among its members, scoping
the work to be done, and keeping track of the accomplishments of each member as
well as the accuracy of the time estimates. For each milestone the group
should submit the source code itself (via CVS); a summary of the work done
including a detailed task list with the responsible individuals, estimation
times, and completion dates (hardcopy brought to class); and a list of
tasks/goals for the next milestone. If an individual is not pulling his or
her weight, the group has the right to fire that individual from the group; such
decisions should be communicated to the instructor as soon as they are made.
Group project grading
Deadlines:
- Project preferences due Feb 13
- Project plan (draft) due Feb 22
- Project plan (final) due Feb 29
- Milestone 1 is April 11
- Milestone 2 is April 18
- Final project demo and milestone is April 25
Coding conventions
Writing code that compiles and runs is not enough. An important part of
software engineering is writing code that is also easy to read by other
programmers, not only those in your team but also those whom you've never met.
Since we will be reading each other's code, it is important for us to have
an agreed-upon set of conventions. The following list has been compiled using some of the more
common approaches adopted in the industry.
- Spelling and syntax:
- class, struct, namespace, function, method: InterCaps style
(first letter of each word capitalized), also known as CamelCaps
- typedef: same as class
- local variables, function parameters:
all_lowercase_with_underscore_between_words
- member variables of a class: same as local variables, but with
'm_' prefix
- macros, enums:
ALL_UPPERCASE_WITH_UNDERSCORES_BETWEEN_WORDS
- global variables (avoid these of course): same as local
variables, but with 'g_' prefix
- private methods: iInterCaps (intercaps but with a leading
underscore i)
- filename (if one file per class): ClassName.[h,cpp]
- braces { }: in the same column (C++-style), not opening brace at
end of line (Kernigan & Ritchie C-style)
- number of spaces in a tab: 2 (but insert spaces, not tabs!)
- Comments and parameter passing:
- Functions that do not modify the member variables of a class are
declared const
- Function parameters that are not modified (except native types) are
declared with const&
- Function parameters that are modified are declared with a pointer (*)
and come after all the inputs
- Functions local to a file are enclosed in an unnamed namespace to keep
its linkage internal to the file. Like private methods, these follow
the iInterCaps style.
- Just before each class declaration, a comment briefly describes the
purpose and functionality of the class, any non-obvious peculiarities, and
the author's name in
JavaDoc /
Doxygen format (starts with two asterisks, keywords start with @)
- Each header file starts with #ifndef #define, and ends with #endif;
double-underlines lead and trail name of file in ALL CAPS WITH UNDERSCORES;
Example:
#ifndef __BLEPO_IMAGE_H__
#define __BLEPO_IMAGE_H__
...
#endif __BLEPO_IMAGE_H__
- Licensing:
- At the top of each file that you write or modify (do not worry about
automatically generated files that you do not touch), include the GNU GPL
license:
/*
* Copyright (c) 2011 Clemson University.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
Example:
/**
This class keeps track of time.
@author Ima Coder
*/
class TimeManager
{
public:
typedef int SecondType;
TimeManager();
double GetTime(int day, const TimeStamp& another_time);
private:
double m_day_of_the_week;
};
Among the many standards on the web, Todd's very extensive and helpful
C++ coding
standard is similar to that above and also contains some insightful points
about software engineering in general. Wallach has a shorter
coding convention
list. Lott maintains an
extensive list of conventions, some of which are quite extensive :). Linus
Torvald's
conventions for the Linux kernel makes a fun read, though it's geared toward
C rather than C++. And, for something completely different, don't forget to
check out Microsoft's
Hungarian notation.
CVS (concurrent versions system) instructions
CVS is a command-line tool for managing source code revisions using a single
repository. WinCvs is a popular GUI for CVS that makes it much easier to
use. (Other interfaces exist, such as
tortoisecvs). To start using CVS through WinCvs, do the following:
- Download and install WinCvs/MacCvs/gCvs
on your development machine
- Run WinCvs (wincvs.exe) -- assuming version 2.0
- Click Admin.Login
- Under Login settings tab,
- Set CVSROOT to :pserver:yourid@cvs.ces.clemson.edu:/pub/cvsprojects/ece417
(Replace yourid with your student id)
- Click Admin.Preferences
- Under CVS tab,
- Set Home folder to somewhere on your machine
- Under WinCvs tab,
- Enter path of external diff program, and click checkbox (For
Windiff, go to C:\Program Files\Microsoft Visual Studio\Common\Tools\windiff.exe;
other diff programs are
WinMerge for Win32 or
xxdiff for Unix)
- Your password will be given to you in class or emailed to you. If you wish to change it, please
email a different password to the grader so we can put it into the CVS passwd
file. Note: CVS has poor security, so do not use an important
password for this project. Instead, send something that you don't
mind having compromised.
- Click Admin.Login, select the CVSROOT (if it is not already chosen),
and type your password (this will store your password locally in your Home
folder/.cvspass). You only need to login this one time (unless of
course you ever explicitly log out).
- Click Remote.Checkout module
- Enter module name: name, where name is
defined below
- Enter local folder where you would like to store the checked out
files
- Whenever a command succeeds, you will see *****CVS exited
normally with code 0*****
- Ignore the warning that you don't have TCL or Python.
- Now CVS is ready for you to add your own files, modify them, etc.!
- To add a file (this means to put an existing file under CVS control),
- Create a file on your local machine in a directory under CVS control (or
move an existing file there)
- In WinCVS, navigate to the directory and click on the file.
- Click 'Add selected' (the little button up top with the red plus on it)
Note: If the file is binary, then click 'Add selected binary', but you
should only rarely do this, since CVS is not really designed for binary files.
- Right-Click on the file or folder and select 'Commit...', then type in a
brief log message and say 'OK'
- To add a folder, do the same thing. However, note that if you add a
folder with no files in it, then most people will never see it. This is
because the default for 'Update...' is to "Prune empty directories" (see the
Globals tab of the Update popup dialog)
- To remove a file (this will remove the file from CVS control, *and* delete
it from your local machine),
- In WinCVS, navigate to the directory and click on the file.
- Click 'Remove selected' (the little button up top with the black 'X' on
it)
- Right-Click on the file or folder and select 'Commit...', then type in a
brief log message and say 'OK'
- Note that CVS never actually deletes anything from the server; it just
flags it as deleted. This is so you can retrieve an earlier version
later if you accidentally deleted a file. So if you accidentally added a
humongous file, notify the administrator so the file can be actually deleted
rather than hogging up disk space needlessly.
- To commit your changes to a file (once you are ready to share your edits
with other users of the repository)
- In WinCVS, navigate to the directory and click on the file.
- Right-Click on the file or folder and select 'Commit...', then type in a
brief log message and say 'OK'
- To update (this will merge any changes that others have committed with
your own local copy),
- Right-Click on the file or folder and select 'Update...', Click the middle
check box that says, "Create missing directories that exist in the
repository", then say 'OK'
- If CVS indicates a conflict (via a red 'C' next to the filename in the
output window), then you will need to resolve the conflict by hand.
Search in the file for "<<<<<<<".
- For reference, see the on-line CVS
Cederqvist
manual or Redbean
manual
Alternatively, if you would prefer to just use the command-line version (not
recommended),
- Download and install the cvs client
on your development machine
- Use a text editor to create a ~/.cvsrc file that contains a single line
that looks like this:
cvs -d :pserver:yourid@cvs.ces.clemson.edu:/pub/cvsprojects/ece417
(Replace yourid with your student id)
- type cvs login at the command prompt, along with your password
(this will store your password locally in your ~/.cvspass file)
- cd to the directory in which you want to copy files from the repository
- type cvs checkout name, where name is defined below
- Now CVS is ready! For reference, see one of the manuals above
Replace name with
class/imageguide (Spring 2011 or 2012),
class/rootfly (Spring 2005, 2007, 2008, 2009, or 2010),
or class/seebreeze (Spring 2006).
For the grader:
- To encrypt a password, use
/usr/local/bin/perl -e 'print crypt("MyPassword","St") . "\n";'
replacing MyPassword with the password you would like to encrypt. (You
may need to use /usr/bin/perl if the above does not work.)
- To print a history of all checkouts and updates, cvs history -x UO -a
VC++ 6.0 coding resources
When
checking in code, be sure to check in all the files needed to compile your
project (such as .h, .c, .cpp, .rc, .vcproj, .vcxproj, .sln, .dsp, .dsw). Also check in the res directory that contains .ico and .rc2 files. The .ico
file is binary, while all others are text-based. Do NOT check in all the
other files that Visual Studio creates automatically, such as .aps, .clw, .ncb,
.opt, .plg, .suo, or the Debug or Release or
ipch
directories. When in doubt, check out your code to a new temporary directory
and verify that it compiles and runs.
Instructor: Stan Birchfield,
209 Riggs Hall, 656-5912, email: stb at clemson
Office hours: Wednesdays 4-5 or by appointment
Grader: Satish Ravindran, email: satishr
Lectures: 2:30 - 3:45 MW, 226 Riggs Hall