CSC/ECE 517 Spring 2020 - E2000. Refactor stage deadlines in assignment.rb

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

Expertiza is a web application designed to assemble teams of students for projects and also aid them in providing meaningful reviews of each others work. The goal of this project is to refactor existing code for Expertiza, in particular, several methods for controlling assignments are being updated. Previous efforts to update the products didn't succeed due to build fails and so the primary current goal is to identify the offending code changes and update them so the system passes all testing. In addition, testing should be expanded to further account for the changes that were made to the program during the Spring 2019 refactor.

Background

Expertiza was developed with ruby on rails. Its primary goal is to provide students a platform to create teams and provide feedback on each others' work. As such, assignments from the teacher play an important organizational role. In particular, this project focuses on how project deadlines relate to their current stage. Currently there are five methods(non-exhaustive) that control assignment behavior with respect to stages:

  • current_stage_name(topic_id = nil)
  • find_current_stage(topic_id = nil)
  • get_current_stage(topic_id = nil)
  • link_for_current_stage(topic_id = nil)
  • stage_deadline(topic_id = nil)

These five methods were refactored into two methods in a Spring 2020 project: Refactor stage deadlines in Assignment. The methods were successfully reduced down to two:

  • get_current_stage(topic_id = nil)
  • stage_deadline(topic_id = nil)

The primary changes to the methods can be found in app/model/assignments.rb; however, major changes were also made to update the testing scripts, and lastly to update calls to the improved methods.