Reflections: RMH Homebase

I had a really great time working with the RMH homebase. It gave me a chance to work in some both familiar and unfamiliar territory. Over the course of the semester I have been working on another project in Drupal. Drupal, is written in PHP like the RMH homebase, and requires a SQL database to be set up for testing. With Drupal I learned how to use LAMP in linux. By the time I needed to use it in the RMH homebase, I was ready. Now there were some new unfamiliar experiences that I enjoyed tackling.

  • SimpleTest- It seemed many of my classmates, as well as myself, have not seen nor used SimpleTest before for unit testing in PHP/SQL. Thanks to advice in my classmates’ blogs I was able to set it up and get it to run for my LAMP server.
  • Refactoring– Many classes at the college go over errors and syntax in code, and they go over documentation and style, but they never teach us how to adapt. When I sat down to look at the RMH homebase code, I got a chance to try and familiarize myself with another programmer’s code. Not just that, I had to refactor it. Refactoring on such a large scale was difficult at first, but the netbeans IDE has a neat feature that allows you to search all the files within a project for certain terms. Also simply trying to understand an unfamiliar complex system quickly was a challenge. By reading the comments thoroughly, and exposing myself to as much code as possible, I was able to really familiarize myself with the key aspects of the code.
  • Considering all angles– Lastly, complex systems, like RMH homebase, taught me that you must look at every aspect of a system, every detail, every inch, and every bit to fully understand the problem and address all possible issues. For example, the login manager completed its task correctly, but it did not complete it with good security. Finishing a task does not mean the task is complete.

These experiences helped to make me a better programmer and software engineer in more ways than one. I am glad to have had the opportunity to work on the homebase and look forward to taking these lessons into my future career.

RMH: The Final Countdown

This week we had to do 8.1 in our open source software book. This will be our last exercise in RMH. For this exercise we need to do three parts relating to the login system.

a. Suggest a more secure definition of default password assignment in RMH Homebase (currently the default password is the same as the login).

A great way to make a secure login is to take certain elements of a person to define the defualt password, such as a mixture of their id, name, and birthdate.\

b. When a person forgets their person, suggest a way it can be changed without needing to contact a house manager.

The easiest way for a person to recover their password is to provide secure information only that person will know, such as full name and birth date.

c. Revise login_form.php and implement your changes to the login. Be sure to test the revision and ensure it works in all cases.

I decided to mix the id, with the user’s last name. For example the password for id: 276, name:davidson would be davidson276. Then, to recover the password the user must type in their last name and their id number. Since the two are conceptually similar, they required less testing. All the tests from my SimpleTest passed.


This exercise was a great way to wrap up RMH for the semester. I will talk more about my over all experiences in my next post.

RMH homebase UPGRADED!

This week we finally got to upgrade our RMH homebase code to 2.0. This version includes some extra documentation, organization, functionality, and database tables. The following exercises refine this functionality and focus on SQL implementation.


7.1 Find examples of where the following criteria are broken in the dbDates.


>Every entry in the table has exactly one value of the appropriate type.

68 $shifts=$d->get_shifts();

69 foreach ($shifts as $key => $value) {

70 insert_dbShifts($d->get_shift($key));


$shifts is stored into value when it contains several different values and data types. This problem adds to the complexity of updating the values in the table, since you do not always know what types are being put into the table and in what order.


>No attribute in the table is redundant with the primary key.


58 $query=”INSERT INTO dbDates VALUES

59 (\””.$d->get_id().”\”,\””.

60 get_shifts_text($d).”\”,\””.$d->get_chef_notes().”\”,\””.$d->get_mgr_notes().”\”)”;


These values are all subsets of the primary key $shift. This can make it much more complex to search. If the primary key was only id, the search would be much easier.


7.2 Develop the functions get_shift_month, get_shift_day, get_shift_year, get_shift_start, and get_shift_end.


For this exercise I will only show the get_shift_month method, in order to prevent redundancy in this post:


function get_shift_month($id)

$shiftMonth = explode("-",$id);

return $shiftMonth[0];


This getter extracts the month from an array within the shift. Shifts follow the format MM-DD-YY-start-end. By creating an array separated at each dash, we can extract every value in an array created using explode() and return it to the parent function.


7.3 Design, implement, and test the calendar month view from the back of the book. This feature would allow the user to view all the shifts for an entire month. This feature requires us to add in a new module known as dbMonths. The simplest design I could use is code reuse. By using the code in dbWeeks and replacing the weeks with months. Below is the implementation of months:







* Drops the dbMonths table if it exists, and creates a new one

* Table fields:

* [0] id: mm-dd-yy

* [1] dates: array of RMHDate ids

* [2] status: “unpublished”, “published” or “archived”

* [3] name: name of the month

* [4] end: timestamp of the end of the month


function setup_dbMonths() {


mysql_query(“DROP TABLE IF EXISTS dbMonths”);

$result=mysql_query(“CREATE TABLE dbMonths (id CHAR(8) NOT NULL, dates TEXT,

status TEXT, name TEXT, end INT, PRIMARY KEY (id))”);


echo mysql_error();





* Inserts a month into the db

* @param $m the month to insert


function insert_dbMonths($m) {

if (! $m instanceof Month) {

die (“Invalid argument for dbMonths->add_week function call”);



$query = “SELECT * FROM dbMonths WHERE id =\””.$m->get_id().”\””;

$result = mysql_query ($query);

if(mysql_num_rows($result)!=0) {




$query=”INSERT INTO dbMonths VALUES







if (!$result) {

echo (“unable to insert into dbMonths: “.$m->get_id(). mysql_error());

return false;


else foreach($m->get_dates() as $i)


return true;




* Deletes a week from the db

* @param $m the week to delete


function delete_dbMonths($m) {

if (! $m instanceof Month)

die (“Invalid argument for delete_dbMonths function call”);


$query=”DELETE FROM dbMonths WHERE id=\””.$m->get_id().”\””;



if (!$result) {

echo (“unable to delete from dbMonths: “.$m->get_id(). mysql_error());

return false;


else foreach ($m->get_dates() as $i)


return true;




* Updates a week in the db by deleting it and re-inserting it

* @param $m the week to update


function update_dbMonths($m) {

if (! $m instanceof Month)

die (“Invalid argument for dbMonths->replace_week function call”);

if (delete_dbMonths($m))

return insert_dbMonths($m);

else return false;




* Selects a week from the database

* @param $id week id

* @return mysql entry corresponding to id


function select_dbMonths($id) {

if(strlen($id)!=8) {

die (“Invalid month id.”);


else {

$timestamp = mktime(0,0,0,substr($id,0,2),substr($id,3,2),substr($id,6,2));

$dow = date(“N”,$timestamp);

$id=date(“m-d-y”,mktime(0, 0, 0, substr($id,0,2), substr($id,3,2)-$dow+1, substr($id,6,2)));



$query = “SELECT * FROM dbMonths WHERE id =\””.$id.”\””;

$result = mysql_query ($query);

if (!$result) {

echo ‘Could not run query: ‘ . mysql_error();

$result_row = false;





return $result_row;




* retrieves a Month from the database

* @param $id = id of the week to retrieve

* @return the desired week, or null


function get_dbMonths($id) {


if($result_row) {




foreach($dates as $i){



$m=new Month($d, $result_row[2], $result_row[3], $result_row[4], $result_row[5]);


return $m;




* the full contents of dbMonths, used by addMonth to list all scheduld weeks

* @return mysql result array of weeks


function get_all_dbMonths() {


$query=”SELECT * FROM dbMonths”;



return $result;




* generates a string of date ids

* @param $dates array of dates for a week

* @return string of date ids, * delimited


function get_dates_text($dates){


for($i=1;$i<7;++$i) {



return $d.”\””;





After creating the module, I made the new module testdbMonths to help make assertions on the values of the database. The new code produced the correct results from the database and no bugs were overtly present.


These exercises were a great chance to try out SQL and PHP on open source software. I look forward to the final leg of the RHM source code exercises in chapter 8!

24th Annual Scientific Research Poster Session

This semester our team will be contributing our work on Drupal to the 24th Annual Scientific Research Poster Session. The session is an opportunity for students at College of Charleston to display long term research projects that they have worked on throughout their undergraduate career.  Below is an abstract I wrote descibing our work and detailing our main goal of the project. This abstract is also being submitted for the poster session. (details here)


Applications of Open Source Software in Computer Science Education
Matthias Burrell, Stephen Davidson, Jennifer Green, James Rajabi, and Tatiana Taylor, Department of Computer Science

Open source software has a wide variety of popular uses within culture today, but education is not one of them. Most schools rely on capstones or smaller projects to teach software engineering techniques and experiences. The purpose of this project is to demonstrate how working on software of a significantly large scale, namely open source projects, provides a better learning experience for the student. This project also exposes the student to a greater variety of challenges and obstacles, much more than standard computer science education methods. Our open source experience came from the use of the website management software, Drupal. By experiencing the open source process first hand, our team was able to collectively show the advantages of open source style eduation in the software engineering fields. The experience we had provided substantial evidence for the benefits of open source. Through community involvement within Drupal, submitting bug fixes and patches, and discussing Drupal issues within the community’s IIRC channels, we accrued a brevity of experience that will be invaluable for all of our team members into the future. We saw this project as proof that open source software is an effective method for teaching student software engineers the core principles of engineering.


This week was the Palmetto Open Source Software Conference (POSSCON). This event was a blast and I would like to take a chance to recount some of my favorite events, speakers, and moments. I arrived at around eight on Thursday. After checking in and receiving my official POSSCON badge, I headed with my classmates to the main lounge called Richland. Here we got to see a speech by keynote speaker, Scott McNealy, founder of Sun Microsystems. The speech was pretty informative. He went over the history of open source software and outlined many of the issues facing open source software including leadership and organization. Personally though, I disagreed with him that open source had slowed down or that it needs a big industry leader with lots of capital to thrive. As another speaker asserted when I asked about what McNealy had said, John “maddog” Hall said that he has seen no slow down in open source, and that the very design of open source prevents it from needing a large leader. The accessibility of open source software keeps it running strong.

Mentioning John, I got to visit several other speakers presentations. John’s was the most interesting. He was doing a BOF during the lunch period in the Richland hall. I already mentioned what I had asked. Others asked about copyright and patent. Richland felt that patents were necessary but needed a great deal of reform. Likewise, to him copyrights have way too long of a shelf life, and they also need reforms to adapt to the new age of technology. He also was quite humurous. He made sure to point out that Linus is pronounced ‘Lee-nus’ (an earlier speaker had said it could pronounced either way). Jokes like this made me a huge fan. He was both an interesting and informative speaker.

I also visited a kickstarter presentation by a young entrepreneur. Ian Daniher has started his own hardware business at age 20. The software used on his hardware is completely open source and versitle. This presentation was really great because of how young Ian is. Hearing of such a young man developing such an awesome idea is quite inspirational. Having toyed with self-development, hearing the business side of the hardware was not only interesting but different from any of the other speakers. He even demonstrated his device for us. The device known as CEE displayed electronic and heat signature in wave length form to the monitor. Ian showed the program’s versatility and ease of change. It was impressive to say the least.

The third speaker I took a look at was from the Department of homeland security. Security and open software seem like a paradoxical combination, but Douglas Maughan Ph. D proved this paradox wrong. He had a power point set up describing how open source software is used in the daily operation of homeland security. In fact he claimed that all the research done on open source software has proven it is actually more secure than its proprietary brothers. This fact alone was shocking. I was really glad I came to see his thoughts.

After seeing these stellar speakers, I and my classmates collected our belongings and made the short trip back to Charleston. The conference was a blast and I hope to go back next year. I took a significant amount away from the conference. I see the prevalence of open source much better now, and I appreciate what it has to offer more. I will take these lessons with me into whatever field I enter into or in whatever project I will undertake.

POSSCON is upon us!

POSScon is up and coming! This Thursday I will be heading to the Palmetto Open Source Software conference in Columbia, SC. This conference is a great opportunity to meet other employees within the business of open source software, and to hear their opinions on the effects of open source software in the industry. Here are a few presenters I look forward to seeing, as well as a few questions to ask while I am there.

Michael Weinberg

Mr. Weinberg will be discussing the intellectual property ramifications of 3D printing. This talk interests me because 3D printing seems like a viable next step in the chain of newer printing technology. I would like to see his thoughts on the practical matter of developing 3D printers instead of the theoretical and laboratory side of development.

Question: What kind of restrictions could be placed on 3D printers to protect copyright and are they even reasonable/practical solutions?

Kevin Whinnery

Kevin will be talking about mobile development and the open source community surrounding it. Mobile development is a field I am interested in getting into, and I would find it advantageous to hear his thoughts in this field in regards to open source.

Question: How much harder is it to organize an open source community for mobile development rather than stationary? Are there any noticeable differences within the communities?

Jesse Andrews

One of the keynote speakers for this day will be Jesse Andrews. He will be discussing the effect of the cloud upon open source software. Many of the cloud developers have very rigid APIs that hinder development and innovation. Jesse wants to talk about ways to handle this issue. As another newer technology, I look forward to hearing about the cloud’s effect on open source software. It should be an intriguing presentation.

Question: How do the APIs of cloud development on mobile compare to the ones imposed on stationary development? Is one worse than the other?

Exercises in developing domain classes: Part I

Today’s post is a continuation of exercises in RMH Homebase. For these exercises we will be taking a class and further refining it. In this case we will be looking at the person class.

6.1 Define a new pair of functions to set and retrieve the value of variables $employer, $contact_person, and $contact_phone.

Added in variables:

class Person {

private $employer;

private $contact_person;

private $contact_phone;

Added in getters and setters:

function get_employer(){

return $this->employer;


function get_contact_person(){

return $this->contact_person;


function get_contact_phone(){

return $this->contact_phone;


function set_employer($e){



function set_contact_person($cpe){



function set_contact_phone($cph){



6.2 Add four new parameters and corresponding assignments to the constructor for the Person class, so that the status, employer, contact person, and contact person’s phone are properly intitialized. Use the following prototype for your new constructor:

function __construct($f, $l, $a, $c, $s, $z, $p1, $p2, $e, $t, $status, $employer, $contact, $contact_phone, …)

Here is the new initializer:

function __construct($f, $l, $a, $c, $s, $z, $p1, $p2, $e, $t, $status, $employer, $contact, $contact_phone, …){

$this->status = $status;

$this->employer = $employer;

$this->contact_person = $contact;

$this->contact_phone = $contact_phone;

6.3 Modify set_status function to check the the $value passed is valid. Describe unit testing implications of your design decision.

function set_status($st){

if (strcmp($st, “active”)==0 || strcmp($st, “inactive”)==0)

$this->status = $st;


$this->status = “error: bad input”;


This basic design allows for an simple set of test cases. {“active”, “inactive”, “test”}

The first two should change the status and the last should change the status to error. The other test cases needed are longer strings, blank strings, and numeral strings.

6.4 Refactor the person class by removing all the mutators that are not called from anywhere in the code base.

After removing a few mutators I rebuilt the RMH Homebase and tested to make sure the program was working. There were no visible signs of bugs after playing around with it for a hour.