Main Page

Google Summer of Code 2019 Work Product Submission

August 26, 2019

Profile

Student

Alexandra Livadas

Organization

INCF – International Neuroinformatics Coordinating Facility

Project Title

Improve LORIS Automated Testing

Mentors

Christine Rogers, Shen, Krishna, Rida, Mélanie, John

Project Description and Overview

This project aims to improve the automated testing of the LORIS codebase and to set the LORIS team up for success in their testing development. This was accomplished by writing a large number of unit tests and by creating documentation that will help developers in the future.

Deliverables

1. Familiarization with the LORIS codebase and its test suite.
This deliverable was mainly accomplished during the month of May.
2. Improvements on the pre-existing code coverage and on the testability of the codebase.
This deliverable was accomplished throughout the coding period, specifically in any PRs listed below in which I 'added' to a library's unit tests. To improve code testability, I fixed some specific code smells in the libraries I wrote tests for. I also created documentation to help improve the testability and spoke about code smells and best practice in my presentation to the LORIS team.
3. Add more tests to increase the pre-existing code coverage.
This deliverable was also accomplished throughout June, July, and August and is reflected in my testing-related PRs. As a result, I updated and wrote tests for two-thirds of the php core libraries such that their methods are now at about 91.3% test coverage.
4. Produce documentation to assist other developers in writing better tests and more "testable" code.
This deliverable was completed throughout the summer, but was focused on in August. The documentation can be viewed in the Documentation section below.

My Summer Timeline

May
My main focus throughout May was on setting up my LORIS and test development environment. I also took this time to get to know my mentors and create a detailed roadmap for the summer with their help. In order to familiarize myself with the LORIS workflow, I created a few very small, mostly documentation-related PRs. I also began to help with manual testing for the 21.0 release, which was a good way to learn about the LORIS codebase and about what automated testing was lacking.
June
Throughout June, I helped test the 21.0 release and was assigned a couple modules to review and create issues for. I spent a lot of time working on my unit test environment set-up and on learning how to develop PHPUnit automated tests specifically for LORIS. I contributed my first three unit test PRs.
July
In July, I did the bulk of my testing-related coding. I opened five unit testing PRs throughout the month, which are listed below.
August
In August, my main focus was getting all of my open PRs reviewed, updated, and merged. I also created two more testing PRs and completed all my documentation.

My GitHub Fork of LORIS

This contains all of the branches that I worked on for my pull requests.

My Merged Pull Requests

The list on GitHub

Testing PRs

1. Unit tests for the Breadcrumb library
Opened on May 31, Merged on June 05. 1 test written, 1/1 methods covered.
2. Unit tests for the BreadcrumbTrail library
Opened on June 11, Merged on June 12. 1 test written, 1/1 methods covered.
3. Unit tests for the Utility library
Opened on June 12, Merged on August 13. 27 tests written, 19/29 methods covered.
4. Adding to unit tests for the LorisForm library
Opened on July 02, Merged on August 13. 107 tests written, 46/51 methods covered.
5. Adding to unit tests for the Candidate library
Opened on July 10, Merged on August 07. 20 tests written, 20/27 methods covered.
6. Unit tests for the User library
Opened on July 18, Merged on August 13. 23 tests written, 19/22 methods covered.
7. Adding to unit tests for the Settings library
Opened on July 25, Merged on August 13. 1 test written, 1/6 methods covered.
8. Adding to unit tests for the Visit and VisitController libraries
Opened on July 26, Merged on July 30. 1 test written, 1/3 methods covered.
9. Adding to unit tests for the NDB_Config library
Opened on August 08, Merged on August 13. 5 tests written, 2/13 methods covered.

Documentation PRs

1. Formatting the test_instruments README
Opened on May 15, Merged on July 22. This was my first PR and was used as an introduction to the LORIS PR workflow.
2. Formatting the installdb.php script
Opened on May 17, Merged on July 17
3. Updating set-up instructions for Docker in the testing environment
Opened on August 12, Merged on August 13
4. Unit Testing Guide markdown file
Opened on August 22.

My Open Pull Requests

These PRs were still being reviewed at the time of this submission. They will be merged sometime after August 26, 2019.

1. Unit tests for the NDB_Page library
Opened on August 14. 26 tests written, 26/33 methods covered.

Testing Documentation

Test Development Log
This document goes over my progress this summer in detail, including the specific methods I covered, the number of tests I wrote per library, and detailed metrics of my code coverage.
Unit Testing Guide
This document is a guide on how to set up a testing environment and write unit tests for the LORIS codebase
Roadmap for Ongoing Test Development
This document provides a suggested roadmap for the LORIS team to reduce manual testing and improve automated test coverage
LORIS General Troubleshooting Guide
This document includes tips and best practices that should be useful to LORIS developers in the future and will evolve as this documentation is expanded by the LORIS team.

July 30th Presentation

On July 30th, I gave a presentation to the larger LORIS developer team, to update them on my progress and to let them know what I would be working on for the rest of the summer! I also went through some specific testing and “code smell” examples that I thought would be useful to them. It was a good way to get feedback on my work and to discuss potential tasks for August!

My Overall Experience

This summer has been a truly amazing experience. I was lucky to be able to work in the office with the rest of the LORIS team rather than working remotely. This made communicating and working with the LORIS team a lot easier. It also made the summer that much more fun, since I was able to be a part of the team and get to know all of my mentors in person. I’ve learned a lot about PHP and automated testing in general. This project also gave me insight into what it is like to work on an open-source project in academia. This has been a wonderful summer and I feel as though I have gained a lot of experience and knowledge from my time as a GSOC student!

Thank you so so much to all of my mentors and to the rest of the LORIS team for being so kind, supportive, and welcoming! I had a lot of fun :smile:

:star: :star: :star: :star: :star: 5/5 would GSOC again!