CSC/ECE 517 Spring 2017/oss E1713

From Expertiza_Wiki
Revision as of 03:33, 23 March 2017 by Nvinchh (talk | contribs) (Added descriptions)
Jump to navigation Jump to search

E1713. Refactor penalty_helper.rb and late_policies_controller.rb
This project is intended to improve the code quality and reduce technical debt within the Expertiza system by refactoring the penalty_helper.rb module, refactoring the late_policies_controller.rb controller, and adding test coverage for both files.

Introduction

Expertiza

Expertiza is an open source web application which allows an instructor to manage assignments. It has various features viz. creating new assignments, customizing existing assignments, automatically allocating submissions for peer review etc. It has been developed using the Ruby on Rails framework, and the code is available on Github.

Project Goals

In this project, the files late_policies_controller.rb and penalty_helper.rb were to be refactored. The methods contained in these files were too long, and needed to be either shortened, or used polymorphically, or deleted altogether if they were not being used. They also were to be refactored semantically if the code did not follow good Ruby coding practices.

Late policies and penalties functionality

Explanation about the functionality impacted by our files.

Change specifics

Overview of the goal of our changes (out of the Google Doc and from our session with Dr. Gehringer).

late_policies.controller.rb

Specific changes identified and made here, including the motivation behind making those changes.

penalty_helper.rb

This is a helper class which contains methods which calculate the different penalties, and are then brought together in one Hash object. The aim was to keep the methods below 25 lines of code if possible. Out of the numerous methods in the file, there were 3 substantial methods, namely calculate_penalty, calculate_submission_penalty, and compute_penalty_on_reviews crossed the 25 line limit.


Functional and integration testing

Motivation behind testing including the technologies used for testing.

penalty_helper_spec.rb

Specific changes identified and made here, including the motivation behind making those changes.

late_policies_controller_spec.rb

Specific changes identified TO BE made here, including the motivation behind making those changes.

Peer review validation

Instructions on how our reviewers should validate the impacted functionality to ensure that it still works.