Computer Science 491
Senior Seminar

Dickinson College
Fall Semester 2018
Grant Braught

Getting Around in a FOSS Project
Introduction

H/FOSS projects can consist of hundreds of thousands of lines of code distributed across hundreds or even thousands of files stored in tens of directories. This kind of scale and structure can make it difficult to find the code that responsible for a particular behavior (e.g. error, bug, warning). This activity walks you through the process of finding, understanding and fixing a readability issue and a bug in the Freeciv project that you built in the Building a FOSS Project Activity.

One important theme in this activity is that it pays to fully understand an issue before making a change. Rushing forward with changes based on a superficial understanding of the code is likely to introduce rather than fix bugs. We'll look at two instances where there seems to be a perfectly reasonable change to be made, but by digging deeper it is discovered that one would have introduced a bug, and one where the first intuition ultimately turns out to be correct but also with deeper understanding leads to more readable code and also prevents a potential future bug.

Prerequisites

Before starting it may be worthwhile to review the find and grep commands. Our Unix Tools Challenges Activity and the sites below are good starting points:

Assignment

When building Freeciv, a number of compile warnings are reported. One reports an unused variable in text.c and the other questionable uses of the logical not operator in the unittype.c and improvements.c. This point of this assignment is to work through the process of understanding and fixing the underlying issues that cause these warnings. In doing so you will practice skills and techniques that are applicable to any type of work in a large code base.

Getting Started

Compile Errors and Warnings

Finding the Responsible Code

Fixing a Bug


Acknowledgements: This assignment builds from and adapts ideas and content from the following activities created by others: