Category Archives: CS 401

De-lurking…

I have been lurking in the OpenMRS project for the last 6 months or so. I have read wiki pages, installed the development environment, cloned the repository and built the code, and listened in on a number of OpenMRS weekly developer meetings.

As I begin my sabbatical, I realized that it was time to finally introduce myself to the project members. So here’s what I posted to the OpenMRS Developers mailing list, and to OpenMRS Talk:

My name is Karl Wurst and I am a Professor of Computer Science at Worcester State University in Worcester, MA, USA (about 80 km west of Boston.)

Our university has recently created a concentration in Software Development for our Computer Science majors, and I am one of the primary instructors for the courses in this concentration. I am currently on sabbatical (no teaching responsibilities) from June through December 2014 and my plan is to participate in OpenMRS to improve my somewhat outdated Software Engineering skills.

I have installed the development environment, built the openmrs-core code, and now I will begin looking for tickets that I can work on. I am excited that the 1.10 beta release is imminent, and hope that I can be of some help in that sprint. I am also very interested in the development, testing, integration, and release processes as a way of seeing “real-life” examples of many of the tools and technologies that I have been reading about, but not had any hands-on experience with.

I am also part of the Foss2Serve/POSSE (foss2serve.org) group that is encouraging faculty to have students participate in Humanitarian FOSS projects as part of their coursework, and have been doing that primarily with our senior project course with varying amounts of success. I would like to have my students participate in OpenMRS beginning with the Spring 2015 semester (January through May 2015.) I want to get familiar with the project myself, first, so that I can direct them.

I also want to use OpenMRS for examples in our courses on software process and management, and testing and QA. We also have an installed server instance that we hope to use for the Health Informatics course that we teach for our Nursing students so that they can get some hands-on time with an EMR system.

I’ve already learned a lot just by exploring and listening. I’m looking
forward to learning even more by contributing.

A note to my students: Introducing yourself to a new group of people is hard, even for faculty members! I have put this introduction off for a while. I may be a Professor, but these people are real experts – they do this stuff all the time, and many of them do it for a living! But, as I’ve often found, once I forced myself to write my introduction and pressed the send button, I’ve gotten back only helpful, welcoming responses. Open Source communities really are welcoming groups that are genuinely happy to have you join, want your help, and will help you succeed. You’ll see…

From the blog On becoming an Eccentric Professor... » CS@Worcester by Karl R. Wurst and used with permission of the author. All other rights reserved by the author.

Fall 2014 Sabbatical

I am spending the Fall 2014 semester on sabbatical1. This is the proposal I submitted to request my sabbatical leave:

I will use my sabbatical to become more expert in the area of Software Development/Software Engineering. The Computer Science Department recently created a Concentration in Software Development, which has expanded our course offerings in this area from two courses to four courses. This expansion does not simply expand the number of hours we spend on Software Development topics, but adds many topics that we have not been covering at all. Many of these topics are outside the expertise of any of the faculty in the department.

I am the only member of the Computer Science Department who has worked as a professional software developer, but have not worked professionally in that field for over 20 years. Many of the current processes, techniques, and tools were not in use at that time. The members of the department have worked to learn these new skills so that we can teach them to our students, but have only an academic/theoretical knowledge of many of them – we lack the practical experience of using these skills in a professional environment.

During my sabbatical, I will learn the processes, techniques, and tools of modern software development, and apply them in a professional context by working as a full-time (but unpaid) developer within an open source software project. I will work with Dr. Heidi Ellis at Western New England University and Dr. Gregory Hislop at Drexel University to get the academic perspective on how to teach these skills to undergraduate students, and to take advantage of their experience working with, and their contacts within, open source projects.

Drs. Ellis and Hislop are both well-known software engineering researchers and software engineering education researchers. They have been on the forefront of work to help students develop professional software engineering skills by working with open source software projects. They have a particular interest in having students work within projects with a humanitarian aspect. I have done some work with them in this area over the last 4 years, but have not had the time to work exclusively and intensively on developing these skills myself. In addition, Dr. Hislop served on the committee that developed the SE 2004 software engineering curriculum for the ACM and IEEE, and is currently serving on the committee that is updating those standards. I have already tapped his expertise in developing our new curriculum, and plan to do so again as we develop the new courses in the curriculum.

Proposal
  1. Develop a list of processes, techniques, skills, and tools that are necessary for modern software development. Thislistwill bedevelopedin consultationwithDrs. EllisandHislop, by reviewingtheSLOs of our newly approved Software Development Concentration courses, and by reviewing the SE 2004 Curriculum and any publicly released drafts of the new ACM/IEEE Software Engineering curriculum. This list will include,atminimum:
    • Agile development processes
    • Automated build environments
    • Automated test environments
    • Version control systems
    • Software architectures
    • Design patterns
    • Requirements elicitation
    • Software licensing and intellectual property
    • Project planning and estimation
    • Risk management
    • Analysis techniques
    • Test planning, strategies and techniques
    • Test coverage
    • Code reviews
    • Quality assurance
    • Project and team management
  2. Select an appropriate humanitarian open source project to participate in. The project will be one which
    • Allows me to experience the full range of processes, techniques, skills and tools from the list above. (Or as many as possible.)
    • Allows me to use tool and language skills I already possess to minimize the number of new tools and languages I need to learn.
    • I can continue to use with students in the Software Development Capstone course, and with other courses in the concentration.
    • At this point, the two projects that seem most likely for my participation are:
      OpenMRS (http://openmrs.org/)
      “The global OpenMRS community works together to build the world’s leading open source enterprise electronic medical record system platform.
      We’ve come together to specifically respond to those actively building and managing health systems in the developing world, where AIDS, tuberculosis, and malaria afflict the lives of millions of people.
      Our mission is to improve health care delivery in resource-constrained environments by coordinating a global community to create and support this software.”
      Ushahidi (http://www.ushahidi.com/)
      “We are a non-profit tech company that specializes in developing free and open source software for information collection, visualization and interactive mapping. We build tools for democratizing information, increasing transparency and lowering the barriers for individuals to share their stories.
      “Ushahidi”, which means “testimony” in Swahili, was a website that was initially developed to map reports of violence in Kenya after the post-election fallout at the beginning of 2008. Since then, the name “Ushahidi” has come to represent the people behind the “Ushahidi Platform”. Our roots are in the collaboration of Kenyan citizen journalists during a time of crisis. The original website was used to map incidents of violence and peace efforts throughout the country based on reports submitted via the web and mobile phones. This website had 45,000 users in Kenya, and was the catalyst for us realizing there was a need for a platform based on it, which could be used by others around the world.”
  3. Participate in the selected project. Iwillparticipate in the selected project on a full-time (unpaid) basis, contributing to the project in whatever ways I can including:
    • Participation in planning and design meetings
    • Writing code
    • Testing
    • Writing documentation
    • Helping with support
  4. Participate in Western New England University course. I would like to observe or help teach a software engineering course at WNEU so that I can see what pedagogy is used in the course, and adapt it to our own courses.
  5. Blog about my experiences. I will write about my sabbatical experiences on my blog (http://blog.karl.w-sts.com/). This will allow me to document and reflect on what I am learning and how I can use it in our own courses.
Preparation for this Sabbatical
  • Participant in POSSE (Professors’ Open Source Summer Experience) in 2010, 2011, and 2013 – A workshop designed to prepare faculty to support students working within open source software projects. The summer 2013 workshop group is continuing to work together over the 2013-2014 academic year.
  • Participant in SoftHum (Software for Humanity) workshop in 2011 – A workshop with faculty working to design materials for use in their courses.
  • One of the organizers of Teaching Open Source Symposium in 2012
  • Participant in OpenFE Materials Sprint in 2013 – A workshop to develop materials for teaching POSSE workshops
Relevant Courses
  • Introduction to Programming
  • Software Construction, Design and Architecture
  • Software Process Management
  • Software Quality Assurance and Testing
  • Software Development Capstone
  • Software Development Process
Benefits to the Computer Science Department and to the University

The department will benefit by having a faculty member who has relevant professional experience in software development, with contacts within at least one open source software project, and with the academic experience of applying that experience to courses. I will be able to use that experience and those contacts in order to give students the opportunity to gain valuable practical experience working within a large software project on the same types of tasks and using the same kinds of skills that they will be expected to use in their professional careers.

The University will benefit through a strengthened Computer Science program, by having a higher profile in the software development world, and being recognized as an organization that has donated a semester’s-worth of work of a full-time faculty member to further the mission of a humanitarian project.

There have been some changes since I wrote the proposal and it was approved:

  1. IchoseOpenMRS as the project that I will be working within.WhileUshahidi seems like a very interesting project,OpenMRS seemed to fit better with my goals for the following reasons:
    • It is written primarily in Java, which is the language that we use most in our Computer Science courses. (Ushahidi is written primarily in PHP, which we do not teach at all.)
    • OpenMRS seems to have a more “formal” software development process and tooling, which I think covers more of the topics on the list of what I want to learn.
    • We can use OpenMRS as a tool in the Health Informatics course that we teach for the Nursing majors, to provide an Electronic Medical Record system for the Nursing students to try out.
  2. I participated in the Teaching Open Source Symposium at SIGCSE 2014 and in POSSE 2014.
  3. I increased my use of Open Source tools both in my own work, and introduced them in our first-year courses.
  4. Students in my Spring 2014 capstone course did some work within the OpenMRS project.
  5. I started attending OpenMRS online meetings to familiarize myself with the project.

I will be writing more about sabbatical as the summer and the semester move along.

  1. For those not familiar with the ways of academia, a sabbatical is a paid leave awarded every 7 years to allow a faculty member time for research or updating skills.

From the blog On becoming an Eccentric Professor... » CS@Worcester by Karl R. Wurst and used with permission of the author. All other rights reserved by the author.

Unit Test: @should annotations

Basically what I’ve been doing is introducing the “@should” javadoc annotation. Each api method will get one or more @should annotations that simply state a behavior of that method need testing, in other words, each @should annotations should be phrased. For instance:

  • @should not fail given null parameter
  • @should return empty list if no results

The example above would become unit test named (given the method was findPatient):

  • public void findPatient_shouldNotFailGivenNullParameter()
  • public void findPatient_shouldReturnEmptyListIfNoResults()

These are the step I followed to get started on this task:

  • Import the OpenMRS-core Repository from Eclipse
      • In Eclipse, choose File:Import
      • Choose Git: Projects from Git
      • Select Repository Source: URI
      • Browse the location of the local file on the PC (file: openmrs-core)
      • Select the master branch
      • Choose the directory you want to clone into
      • Select Use the New Project Wizard
      • Choose Java: Java Project
      • Enter a project name (To get all files imported, the given name has to be exactly the same as the local file name. In this case the project name should be: openmrs-core)
  •  Start searching all methods that do not have tests
      • In Git Bash, type command:  $grep –r ‘@should’ openmrs-core  (This command line will recurs into sub-directories to look for all “@should” instances)
      • Command:  $grep –r ‘@should’ openmrs-core > file.txt   (This line will save the output to a file text)
  • Browse ‘@should’ annotations in the packages  
      • The txt.file will output all packages that still have ‘@should’ annotations.
      • In Eclipse, look for such packages and start modifying them, so those methods become unit test names.
      • For example: /api/src/main/java/org/openmrs/somepackage/SomeObject.java:

In Eclipse: /api/src/main/java/org/openmrs/aop/AuthorizationAdvice.java:

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

Unit Testing

As a group we continue working and trying to find more detailed information about the assigned ticket. Unfortunately, the lack of communication and responses from the developers is limiting the progress of our project.

Last week, we did the JUnit Lab in class, which was very helpful in understanding how unit testing works. I had to install GitHub in my laptop to be able to open git files in Eclipse. To start working on the Lab, I had to fork JUnit-Lab Repository to my account and then I cloned it from Eclipse.

After going through and finish the lab, I tried to follow the same steps with the OpenMRS-core Repository. I ran into problems, but after so many attempts I finally got to clone the repository by importing the project from a local source. 

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

New Ticket: TRUNK-243

After two attempts to work on the OpenMRS’s project my group has now chosen a new ticket, the TRUNK-243. The description of this ticket explains that the current unit tests have bad names, so this ticket is about cleaning the unit test. I’ve been researching about unit test before to start working on the actual code, so this is what I have learned this week.

What is Unit Test?

Unit testing is a software development process designed to correct individual parts of code by isolating each part of the program. In other words, unit test is a piece of code that invokes a unit of work in the system and then checks a single assumption about the behavior of that unit of work.

Benefits of Unit Testing

  • Reduces the level of bugs in production code
  • Problems can be found early in the development cycle
  • Automated tests can be run as frequently as required
  • Facilitates change
  • Simplifies integration
  • Is a form of documentation
  • Can improves the design of code

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

OpenMRS Wiki

Up to this point, working with OpenMRS software has become frustrating. A quick recap… In a matter of minutes, our original ticket was claimed by someone else, so my group ended up losing such a great ticket to start off the project. After this misfortune, we chose another ticket, which was not very clear in the description of the problem. However, we had an answer and likewise the approval from one of the OpenMRS developers to start working on the issue.

Unfortunately, on March 11th, I received an email about the recent edits made to the wiki page.  The email states that some of the senior developers have expressed concerns & confusion about the accuracy of the edits.

Before proceeding with our work, we ensure that the outcome was what they were asking. It’s frustrating because all changes made by the group have been reverted back. Working on this project has been a waste of time, and at the end it seems my account has been restricted to access the wiki page.

After two attempts, looking into a new project will be a challenge.

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

Group Status Report

As a group, we started the week finding out that our original ticket, TRUNK-324, had been claimed by someone else. We had a quick meeting and agreed to work on the TRUNK-3009 instead. TRUNK-3009 is a documentation bug.

For this ticket we are supposed to look for all references in the wiki to Global Preferences, and change them to Settings. According to the description given in OpenMRS the “Global Properties” page was renamed and updated to just a “Settings” page for version 1.9. So if the wiki mentions GPs they need to be updated, as there are still hundreds of references to Global Properties on the wiki.

The description of the bug is somewhat vague, so before we start working on this one of our team member, Connor Kelly, put a comment on the page to make sure that our understanding of the ticket is what they want. The comment was as follows:

“My intention is to go through the whole wiki and replace any instance of “Global Properties” or “global properties” with “Settings (formerly Global properties)”, is my undesrtanding correct on this or am I missing something? I don’t want to mess up the whole wiki.”

On Saturday, March 8, 2014, we got an answer on the comment saying that the update should include that the change only affects version 1.9 and above.

We are now ready to get started on searching and replacing any string “global property” within the wiki page.

The change and what users will find while reading the wiki page is as follows:

Settings (formerly Global Properties 1.8 and below)

Finally, as a group we have agreed to split up the documentation section found in the left panel of the OpenMRS Wiki home page.

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

Week 3

Editing a wiki is easy I tend to edit gaming wikis. The issue tracker was odd to run thought at first as things a old a a few months could quickly pop up on you as well as not knowing if the issue is truly an issue anymore or was forgotten when finished.

From the blog Computer Science » CS401 by Renowneddragoon and used with permission of the author. All other rights reserved by the author.

OpenMRS Set Up

Setting up the system has been difficult. My laptop is running Windows 8.1, so that’s the first challenge I have.

First, when I tried to check which version of java I had installed, I got this output: “ ‘javac’ is not recognized as an internal or external command, operable program or batch file”. So, I decided to check: Program > Java > About > Version 7 (1.7.0-b147). The Developers Guide instructs to check the version as follow “javac –version” on the command line, but instead I entered “java -version” and it worked!

Then, I got stuck in the installation step. I downloaded and run the OpenMRS SDK installer. The wizard setup was completed without outputting any error. Once again, in order to get the output in the console I had to change “omrs-version” to uppercase, “OMRS-version”, otherwise the result would not have succeeded.

This time, the prompt line gave me an error: “JAVA_HOME not found in your environment. Please set the JAVA_HOME variable in your environment to match the location of your Java installation”

If you are running into the same problem, here is the solution:

  1. Locate the Java Runtime Environment (JRE) Installation Directory
    1.  If you didn’t change the installation path for the Java Runtime Environment during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
    2.  Inside that path will be one or more subdirectories such as C:\Program          Files\Java\jre7
  2. Set the JAVA_HOME Variable
    1. Right-click the My Computer icon on your desktop and select Properties.
    2. Click the Advanced tab.
    3. Click the Environment Variables button.
      1. Under System Variables, click New.
      2. Enter the variable name as JAVA_HOME.
      3. Enter the variable value as the installation path for the Java Development Kit. (e.g.C:\Program Files\Java\jre7)
    4. Click OK.
    5. Click Apply Changes.

Close any command window which was open before you made these changes, and open a new command window. If the changes do not take effect even after reopening the command window, restart Windows.

After fixing the JAVA_HOME, I checked if the SDK is working properly. The console output looks similar as the one on the Developers Guide.

Now the last step, running OpenMRS locally, it starts to create the directory, but nothing happens. It never launches the web server to be tested. If I click the link, the web page loads blank. I’m still trying to figure out what I missed!

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

Wiki & Git are FUN!

The third week of the semester has been very busy. Let’s start with the wiki editing that was started in class. This is the first time I have to edit a wiki. It was fun and easy to learn how to add and modify content. What I like about the wiki application is its simplicity, which allows any user to contribute text without being a web designer.

My wiki profile has information about the Issue Tracker Activity. This activity was useful in a way that I can get familiar with the OpenMRS Issue Tracker system, which is a system that allows browsing and filtering bugs. In this activity not only learned to browse and filter issues, but I also learned to find reports based on a specific project.

The second part of the assignment was the Git Videos and the tutorial, which gave me an insight of what Git is and how it works. Git is a Version Control System (VCS) with capability to keep track the history of every file, and changes made by a team member who is working or collaborating on a single project. VCS allows to revert files back to a previous state, revert the entire project, review changes made over time, see who last modified something that might be causing a problem, who introduced an issue and when, etc.

In summary, some features that Git provides are:

  • Configuration: Free download and installation; fast and easy setup.
  • Fast: Nearly all operations are performed locally (on local disk).
  • Distributed Version Control: if any server dies, any of the client repositories can be copied back up to the server to restore it.
  • Team Centric: Allows group of contributor working simultaneously within the same project.
  • Integrity: Contributor can’t lose information in transit or get file corruption without Git being able to detect it.
  • Merging Capability: Git is flexible when more than one user’s work needs to be brought together.
  • Opt in: You decide on which projects to participate.
  • Open Software: Let people offer contributions.
  • Backup: Every user has a full backup of all data. 

Finally, this week I went through the selection of 3 tickets within the issue tracker. I am very excited to work on projects related to database.

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.