What I’ve learned during my 6 months internship on Koha

Hea, Koha usage statistic gathering platform

 

Every summer we, at BibLibre, host interns who will work for the communities of the software we support. Julian Fiol, an engineering student from Polytech Marseille, worked during 6 months on Koha.

I did my final internship at BibLibre, from March 9 to August 28, 2015 inside the development department and here is a summary of my work.

I worked on Koha, the first Open Source ILS (Integrated Library System) used by hundreds of library around the world.

My internship focused on three points:

Adding unit tests

Some Koha modules lack of unit tests to fully validate the code.

During the first two months of my internship, I added 1623 new unit testing Koha in 8 different modules to validate the code already written. These tests allowed to expand the Koha total coverage from 48.4% to 59.1%.

These modules are the following:

Modules Bug (Bugzilla)
C4::Boolean 13814
Koha::Borrower 13882
C4::OAI::Sets 13940
C4::Accounts 13942
C4::Review 13969
C4::Creators::Lib 14059
C4::UsageStats 14097
C4::External::OverDrive 14147

 

It was a great opportunity for me to learn Koha’s code. I have also been able to understand the importance of each module and learn the Perl language.

I also wrote a coverage script (bug 13899) to easily and accurately see which modules  and which lines of code are not yet 100% covered by the tests.

I then looked into test automation with Selenium, Selenium IDE and Cucumber. To simulate some action via the Koha interface you have to perform a lot of actions and clicks that can before tedious.

Cucumber has been choosed by the community for its better readability tests. I then developed test automation scenarios with Cucumber (bug 13849) allowing for example to create a biblio.

Optimizing performances

The second part of my internship consisted in the study of the performance improvement of Koha.

I was able to win (on my machine):

  • 2 seconds on the C4::Circulation module on Plack mode
  • between 120 and 1400 ms on Koha search page (bug 14476) depending on the number of results found. I also improved the code to prevent it from unnecessarily calculates the ‘Notes’ and ‘subject’ of biblios while XSLT is already doing it (bug 14496).
  • 500 ms on the pages using YAML file by caching these files (bug 14207).

This part of my intership made me realize the importance of optizing the code. I also discovered profiling tool such as Devel::NYTProf.

Hea

The last part of my internship as been about promoting Hea, a platform gathering usage statistics from Koha users worldwide which had been initiated by Biblibre during the hackfest Koha in 2014.

I added the ability to enable data sharing within the parameters of Koha and in the Koha installer (bug 14608). I also added a cronjob automatically sending these statistics every month (bug 13585).

I also completed Hea’s wiki to explain which data were collected, proving that sharing its data does not compromize libraries and their users privacy.

I have added 4 system preferences to Hea:

  • UsageStatCountry (Library’s country)
  • UsageStatType (Library type)
  • UsageStatName (Library name)
  • UsageStatUrl (Library url)

UsageStatCountry and UsageStatType have been added to the existing statistics. UsageStatName and UsageStatUrl are displayed on a separate page because it these are not statistic information per say.

These improvements have increased the number of Hea users from ​​75 to 251 (on September 1, 2015).

Conclusion

This internship with BibLibre brought me a lot in terms of independence and expertise.

Having to use almost only software and languages ​​that did not I knew or mastered, I learned a lot about Perl, JavaScript, jQuery, AJAX, MySQL, Git (which I became totally fan!), Vim Bugzilla …

I also came to realize the importance of testing and optimizing its work. This will be very useful for the future, to produce clean and efficient code.

These six months allowed me to approach the world of free software and community based development with its advantages and disadvantages.

It allows more work done, faster with the invaluable assistance of the community. It also provides better software maintenance since everyone can participate. Some guidelines are in place to have that can be identified in a code easier, everyone does not code “in its own way.”

For cons, the downside is that community work is based on the sharing of ideas and opinions, which can slow the development of new features, the time that everyone agree on the direction to take.

Anyway I was delighted to join the Koha community and meet people from BibLibre, all friendly and always there to help! I highly recommend this company and hope that other students from Polytech continue to come do their internship at BibLibre 🙂

Share

Leave a Reply

Your email address will not be published. Required fields are marked *