CPSC 219: A Lab Course on Software Development

Patrice Belleville
Department of Computer Science
University of British Columbia
#201--2366 Main Mall, Vancouver
B.C., Canada, V6T 1Z4

Abstract

In September 2000, the Department of Computer Science at the University of British Columbia offered for the first time the course CPSC 219: Software Development Laboratory. In this paper, I discuss the motivations that lead to the creation of this course, the factors that determined the selection of topics that are covered in the course, its organization, and finally the students' reactions.

Keywords: software development, course, laboratory, shells, scripting, makefiles, testing, debugging, Perl, Java, GUI.

1. Introduction

The course CPSC 219: Software Development Laboratory is a course whose purpose is to introduce students to several important tools and Software Engineering concepts: scripting, debugging, makefiles, graphical user interfaces, etc. This course is somewhat unusual for our Department in that it is a lab-based course: students have only one hour of lecture per week, but two hours of tutorials and two hours of laboratory. Most of the material for the course is thus available online.

The introduction of CPSC 219 into our curriculum was motivated by several factors.
Many instructors of third and fourth year courses mentioned that students lacked some important knowledge about tools that, when used properly, would allow them to complete assignments and projects faster and with less difficulty. These instructors felt that, if they could rely on the students knowing these tools, then they could assign projects that are more interesting, but would prove too challenging under the then prevailing conditions.

 

One of our upper-level requirements, CPSC 319, was a full-year Software Engineering project course. Because it lasted from September to April, this course caused scheduling difficulties for many students, particularly those in the Cooperative Education program who for one reason or another were not following the standard COOP schedule.

 

Many students in the Cooperative Education program found their first work-term difficult, as they had to learn a new environment and new tools, and had taken relatively few Computer Science courses (in most cases only four plus a course on Discrete Mathematics that has relatively little impact on the first COOP work term, even though it is extremely useful for other purposes).

It is to address these problems that CPSC 219 was created. It provides knowledge about tools and programming techniques that are essential to students going on work terms, or working on assignments and projects in their upper-level Computer Science courses. The introduction of CPSC 219 also solves the CPSC 319 scheduling problem. The old version of CPSC 319 was split into two halves that lasted one term each:
In the first half of the course, the students studied some of the tools that they now learn in CPSC 219, as well as other topics such as group project management.

 

In the second half of the course, the students were divided into groups, and did the actual project, from requirements analysis to implementation and testing.

Since all of the tools that the students previously learned about in the first half of CPSC 319 are now covered in CPSC 219, it is now possible to cover the project management topics, and do the group project, in a single term. This new version of CPSC 319 will be offered for the first time in January 2002. Moreover, starting this year, CPSC 219 has replaced CPSC 319 as program requirement.

The remainder of this paper is organized as follows: in Section 2, I discuss the process through which we developed the course and decided on the topics to be covered. Next, I describe the practical details of the first two offerings of the course. Finally, I summarize my experience in teaching the course, and discuss its future.

2. The development of the course

We started developing CPSC 219 in May 2000. Our goal was to help the students acquire fundamental, practical skills and knowledge that would assist them in completing medium-sized software engineering projects. Hence, we determined that part of the course would introduce the students to tools used in software development. On the other hand, we also wanted to discuss other concepts that were not yet part of our lower-level curriculum, but are needed for both work terms and upper-level courses. We thus decided that the course should cover the following broad topics (listed here in no particular order):
Unix.
Microsoft DOS/Windows and its development tools.
Scripting language.
Testing and Debugging.
Makefiles.
Graphical User Interfaces.

The choice of specific topics for scripting languages and graphical user interfaces was more difficult. For scripting languages, we decided quickly to include shell scripts (for both the Bourne and C shells), DOS batch files, and Perl. We also wanted to include Javascript, but we realized that the course had already as much contents as the students could possibly handle in one term. We thus had to leave it out.

We also had many discussions about the language that we would use to introduce Graphical User Interfaces. The first term of CPSC 319 had traditionally used Tcl/Tk for that purpose. The two students who helped us develop the course pointed out that, as far as they knew, very few students really used it afterwards (the author must confess that he has never programmed using Tcl/Tk). The alternative was to use Swing. Since the two languages used in our first year courses are Scheme and C++, we had to introduce an additional language in both cases. Moreover, we already have a set of Tcl/Tk course notes that covered exactly the elements we were interested in teaching (from CPSC 319), whereas we had no such notes for Swing. Despite this drawback, we decided to go ahead with Swing for three reasons:
It is likely to be much more useful (in a practical sense) than Tcl/Tk, although both could be used equally well to teach the concepts involved.

 

Students should be exposed to Java at some point during the course of their studies, and doing it at that point makes at least as much sense as doing it at any other time.

 

Finally, learning Java is relatively easy if one knows C++, and so not much time needs to be spent on it.

We thus ended up with seven different topics, which are:
Unix Concepts: File system structure, file and directory management commands (ls, cp, etc), man pages, editors such as Emacs and Vi, process control, file ownership and permissions, hard links and soft links, other Unix commands such as awk, chmod, find, grep, less, ln, sort, tar and uniq.

 

Shell Scripts and Batch files: variables, wildcards, expressions, control structures, redirection, piping (all of these for both the Bourne Shell and the C Shell). Writing simple shell scripts for file and directory management.

 

The Perl scripting language: variables and their types (scalars, arrays and hashes), context sensitivity, terms and operators, flow control, reference data types and their uses in complex data structures, subroutines, objects, file handles and file operations, pattern matching using regular expressions, and parsing.

 

Testing and Debugging: the testing process, selecting test cases, black box and white box testing, using the Gnu Debugger (GDB) and the Data Display Debugger (DDD).

 

Configuration Management: Makefiles, and Visual C++: review of separate compilation in C++, makefiles' purposes, rules and dependencies, variables, suffix and pattern rules, using makedepend to generate dependencies automatically, how to use multiple makefiles.

 

The Java programming language: primitive types, variables, operators, control flow, object references and their usage, defining new classes, predefined classes, exceptions, file input/output, abstract classes and interfaces, inner classes, applets.

 

Graphical User Interfaces using Swing: event handling concepts, containment hierarchies, top-level components (frames and dialogs), other components (panels, buttons, labels, menus, text fields, file choosers), listeners, layout managers (border, flow, box and grid).

Each of these is covered in either one or two weeks, depending on the number and difficulty of the concepts involved.

Unfortunately, not all of the sections of the online course notes were fully ready by September 1st, and hence many of them, as well as most of the labs, were finalized as the course progressed. The section on Graphical User Interfaces, in particular, is still, as of today, mostly links to the online Swing tutorials. While these tutorials are fairly complete, they also contain too much information for our purposes, and as a result are not as easily accessible to the students as we would like our online course material to be. We will remedy this during the summer by writing our own set of notes for Swing; the links to the online Swing tutorials will remain available for the students who are interested.

3. The first offering

We offered the course for the first time in September 2000 to a group of 125 students. There were thus 5 lab/tutorial section of 25 students each. The labs contained PCs running Microsoft's Windows NT. For the Unix portions of the course, the students used Xwin32 and connected to one of our Solaris servers.

In the one hour of lecture per week I had (minus the time spent on the quizzes), I covered as many of the concepts for a given section of the course as I could. Teaching assistants reviewed those by going through additional examples during the tutorials, and covered the concepts that had to be left out of the lecture due to time constraints. On average, the tutorials lasted about sixty to seventy-five minutes, out of the one hundred ten minutes allocated for them, and the students spent the remaining time working on their lab (labs are discussed in more details below).

3.1 Grading Scheme

In such a course, it would have been natural to have a large portion of the students' final grade come from their lab assignments. Unfortunately, doing so would not have been practical, due to the large amount of "help" that some students receive while doing their labs. For this reason, most of the final grade actually comes from examinations.

The original plan was to have eleven labs worth 20% of the final grade, a set of eight lab quizzes that would be written in the lab, also worth 20% of the final grade, a 50 minutes midterm worth 15%, and a final examination that would account for the remaining 45%. However I found out very quickly that this was impractical for three reasons:
It is nearly impossible for an instructor to come up with five different lab quizzes on a same topic that are of equal difficulty, and yet different enough so that students in a later lab section do not get any advantage over students in the earlier sections.

 

Having eight individual quizzes (even short ones) is an excessive burden on the students.

 

And finally, writing five quizzes in a week is more work than I could handle given my other responsibilities.

For these reasons, the number of quizzes was reduced from eight to four, and the quizzes were written in the lecture rather than in the labs (even though this meant less lecture time). The relative weights of the components remained unchanged. Also, the last two lab assignments were merged into a mini Swing project that the students could do in teams of two.

3.2 Labs assignments

The lab assignments were designed to track as closely as possible the concepts that we considered important for each section of the course. Here is a summary of the contents of the individual lab assignments, listed in the order in which they were assigned during the term.
Lab 1 (Basic Unix Concepts): this was an easy lab where the students were asked to perform a number of tasks for which they needed to use the file management commands described in the online course notes, as well as lookup some additional options that were described only in the manual pages for these commands. Finally, they needed to use both Vi and Emacs to edit a couple of small files.

 

Lab 2 (Shell Scripts and Batch Files): in this lab, the students had to write two shells scripts and a DOS batch file. The first shell script performed file manipulations recursively in a directory and all of its subdirectories. The second shell script was a menu-driven file-management utility, where the file management actions themselves were relatively simple, but required that permissions and existence of files be checked. The students wrote two versions of each script: one for the Bourne Shell, and one for the C Shell. The batch file simply copied selected files from one place to another.

 

Lab 3 (Advanced Unix Concepts): this lab asked the students to perform a number of tasks using chmod, find, etc. They also had to write pipelines, and observe how file permissions worked by trying to read a file created by their neighbor. Finally, the last part of the lab asked them to write a simple AWK program.

 

Lab 4 (The Perl Scripting Language, part 1): in this lab, the students started by gaining first-hand experience with variables, subroutines and parameters by writing a simple subroutine to compute Fibonacci numbers. Next they learned about arrays and references by writing two versions of insertion sort: one that returns a new sorted array, and one in which the array is passed by reference and mutated. Finally, the last problem was meant to familiarize the students with hashes, by asking them to count the number of times each word occurs in a sentence stored as a string.

 

Lab 5 (The Perl Scripting Language, part 2): this lab was divided in two parts: in the first part, the students had to write simple file-manipulation scripts that involved pattern matching. In the second part, they wrote a simple class and a driver program for it.

 

Lab 6 (Testing and Debugging): this lab was also divided in two parts: first the students were asked to provide test cases for a simple C++ class, and implement a driver program to perform the tests, providing both the expected output and the actual one. Then they were guided through a sequence of exercises where they debugged a number of programs using both GDB and DDD.

 

Lab 7 (Makefiles and Visual C++): in the first part of the lab, the students wrote makefiles for a few different (small) projects, using suffix and pattern rules, automatic variables, etc. Then they were asked to write a small Console Application, to compile it, to run it and to save its output to a file.

 

Lab 8 (The Java Programming Language, part 1): the students were asked to write two programs: a program that consists of a simple class and a driver program, and a program to read text from a file and print out the list of words, along with the number of occurrences of each word. Both programs were meant to give the students some practical experience writing Java programs. Apart from File I/O there was nothing that they hadn't already done in C++.

 

Lab 9 (The Java Programming Language, part 2): in this lab, the students first wrote a simple program to give them practice with interfaces and inheritance (some of them had not seen inheritance previously, as it is traditionally introduced in another one of our second year courses, which they can take before, after, or concurrently with CPSC 219). Then they wrote a second, larger, program that tied a number of things together (inheritance, abstract classes, and exceptions).

 

Lab 10 (Designing a GUI using Swing): The objective of this lab was to give the students practice designing and implementing graphical user interfaces. Hence, they first had to design the graphical user interface for a simple day planner program, and then they implemented it using Swing.

This was a two-weeks lab that could be done individually or in teams of two. In their last lab session of the year, I asked the students to demo their projects to me. Part of the marks were given for the user interface, while others went to the actual code behind it.

Most of the labs were of appropriate length and difficulty, apart from labs #2 and #10. Lab #2 was much too long, and many students spent over 20 hours on it. This was partly because of problems with the syntax to which they were unaccustomed, partly because I failed to realize that one part of the question was much harder to do with the Bourne Shell than with the C Shell. Lab #10 was also too long, although this time the main reason was the amount of searching through the online Java documentaton that the students had to do in order to deal with Calendar dates and File Input/Output.

3.3 Student's reactions

The reactions of the students who took the course in the first term it was offered were overall positive, although most of them acknowledged that there were problems. The most significant comments were:
I found the things we learned are very useful in my COOP job.
We really need more than one hour of lecture per week to go over all the concepts.
There was too much syntax to learn.

The first comment tells us that we at least partially met our initial goals. The second one points to a problem that I am still grappling with: how to best make use of the limited amount of lecture time? Using transparencies seem to help a bit, but some concepts require time and can not be gone over quickly without losing too many students. The problem may also lie partially with the students who, like the instructor, are used to courses with three hours of lecture per week, and are finding the adaptation a bit difficult.

The third comment points to a more significant problem with the current contents of the course: the students have to use two different shell scripts, DOS batch files, Perl, Java and C++, in a period of only thirteen weeks. This is a lot of syntax to deal with, and too much time seems to be spent on this (in all course activities) that would be better used dealing with the underlying concepts.

4. Changes between the first and second offering

There was unfortunately too little time before the second offering of the course to deal thoroughly with the problems discussed in the previous section. First, there were only two weeks between the final examination on December 18th and the first lecture on January 2nd. Second, many of the comments were on the regular teaching evaluations, which I did not get back until mid-February. Only minor adjustments could thus be made. There were two types of adjustments: to the schedule, and to the lab contents.

The adjustment to the schedule was the move of the Testing and Debugging topics to the third week of the course (between Shell Scripting and Advanced Unix Concepts) from its original position after the Perl Scripting Language. I determined that the skills acquired during that lab, in particular the use of debuggers, would be useful in the two labs on the Perl scripting language. The change also inserted an easier topic in between two harder ones, and provided a change of pace that the students benefited from.

The changes to the lab contents aimed at rectifying the problems identified with the labs on Basic Scripts and Graphical User Interfaces. The former was shortened a fair bit by asking the students to write only the first of the two shell scripts using both shells (C and Bourne), and by moving the DOS Batch file to the following lab. The Graphical User Interfaces lab, on the other hand, remained the same, but we foreshadowed the non-Swing specific parts of the lab in the second lab on the Java programming language. That lab now asked the students to design an appointment class and read appointment objects from and write appointment objects to a file. This helped familiarize the students with some of the classes they would need in the Swing lab (Calendar, Date and DateFormat being the most obvious of them), as well as provided them with most of the code to load and save the array of appointments.

Despite these changes, the students still found the two labs time-consuming. I attribute this to two factors: for the lab on Shell Scripting, the main factor was the somewhat unusual (for the students) syntax and the lack of any decent error checking on the part of the shells. For the lab on Graphical User Interfaces, I attribute it to the fact that it was the very end of the term, and that many students assessed its length as if it were a one-week lab.

4.1 Student's reactions

At the end of the second term, I once again surveyed the students to get as much specific feedback about the course as possible. They were asked
whether or not they had already taken or were taking our second year Data Structures course (to help evaluate their other answers),

 

how many hours of lecture per week they though the course needed,

 

and to rank each of the topics covered in the course according to the following criteria:
usefulness of the topic itself,
helpfulness of the lectures in introducing the topic,
helpfulness of the online notes to help them learn the concepts,
how hard they found the lab,
how long they found the lab, and
how helpful the online notes were in assisting them do the lab.

Unfortunately, there has not yet been enough time to fully analyze the results of this survey. Moreover, the teaching evaluations will not become available to me until the month of June. However, preliminary results show that most students would like more than one hour of lecture per week (most said 2 or 3), and that they thought that most topics were useful.

5. Conclusions and Future Plans

Our main goal for the next year is to address the problems discussed in the previous section, especially the problem related to the choice of topics. A student hired for the summer, who in fact took the course this past term, will help with this. She will also perform a much needed proofreading of the online course notes, and help in writing new course notes where needed (in particular for the section on Graphical User Interfaces and Swing).

One change that we are currently contemplating would be a reduction of the time spent on Unix, and the elimination of one of the two shell scripts (Bourne Shell and C Shell). An additional topic of interest could then be discussed using either Perl or Java (and thus without introducing additional syntax). Should Java replace C++ in our first-year curriculum (which we will be revising in the next few months, although it is too early to know what changes will be made), the two weeks currently spent on Java could be reduced to one or less, and additional topics could be covered in the time thus freed.

Finally, our long-term plans are to determine whether or not the current format of the course is optimal, and to study the impact of CPSC 219 on the ability of students to carry out medium-sized software engineering projects (for instance in fourth-year courses). We might also consider offering another, somewhat less intensive, version of the course targeted at students other than those in our Computer Science programs.

Additional details about CPSC 219 are available on the course Web site at:

http://www.ugrad.cs.ubc.ca/spider/cs219
It contains all of the online course notes, the slides used in class, and the labs from the most recent term. This site is publically accessible; no password is required.

Acknowledgements

Several people made invaluable contributions throughout the development of the course and its first offerings, and I would be remiss if I did not thank them. Thus, thanks go to Anne Lavergne and George Tsiknis who proofread several early version of the online course notes. I am also especially indebted to Daniel Ferstay and Christina Wong, who developed the online course notes last summer, came up with ideas for many of the labs used in these first two terms, and provided additional support as Teaching Assistants. Their hard work and their knowledge of the fairly eclectic material covered in this course was an essential part of its success. Finally, I would like to thank the students who took the first two offerings of the course for their feedback, and for being willing to act as guinea pigs.

Patrice Belleville
Last modified: Fri Apr 20 00:57:50 PDT 2001