CSC/ECE 517 Fall 2020/oss E2072 RLM

From Expertiza_Wiki
Jump to navigation Jump to search

This wiki page is for the description of changes made under E2072 OSS assignment for Fall 2020, CSC/ECE 517.

Peer Review Information

For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:

  • Instructor login: username -> instructor6, password -> password
  • Student login: username -> student4340, password -> password
  • Student login: username -> student4405, password -> password

Expertiza Background

Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU and supported by MIT and the National Science Foundation.

It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.

Description of the current project

The following is an Expertiza based OSS project which deals primarily with the AssignmentParticipant model and Review Mapping helper. It focuses on refactoring unkept, unused and misleading methods within the aforementioned files. The project’s goal is to enhance some of the methods in use and clean up others that were either outdated or in need of improvement. Some other parts of the application were modified as well to work with our changes in the Assignment Participant model.

Files modified in current project

Our project focused primarily on refactoring the assignment_partipant.rb Model file. The files modified for this project are:
1. assignment_participant.rb
2. review_mapping_helper.rb
3. assignment_participant_spec.rb
4. publishing_controller.rb
5. user.rb
6. quiz_assignment.rb
7. response.rb
8. response_spec.rb


Assignment Participant Model

This is a controller that helps students and instructors view grades and reviews, update scores, check for grading conflicts and calculate penalties. A couple of long and complex methods were refactored from this controller along with removal of some non-functional code and a few language changes to make it Ruby style. Three methods in particular, namely conflict_notification ,calculate_all_penalties and edit were found to be too long and were in need of refactoring into smaller, easier to manage methods. Few more compact methods were created for this purpose.

There were no existing test cases for the controller. We have added a spec file named 'grades_spec.rb' under the spec folder. As no changes were done for the model, no tests for the model were included.

ReviewMappingHelper

This is a helper class that contained methods to help calculate and display information regarding participant reviews and the volume of each review. One non-functional method was removed from the file and two other methods were updated to support sorting the volume of an arbitrary number of review rounds.

List of changes

We worked on the following work items(WIs)
WI1: Refactor self.grant_publishing_rights to assign_copyright
WI2: Determine whether reviews_by_reviewer method is still needed.
WI3: Refactor copy method name
WI4: Refactor assign_quiz
WI5: Refactor Review Score
WI6: Rewrite Score calculation within the scores method
WI7: Refactor Volume - # Distinct Words in a Review
WI8: Provide documentation for Compute_Assignment_Score


RSpec

Refactor assign_quiz Method

Removed assign_quiz spec test from assignment_participant_spec.rb to correlate with the deletion of the assign_quiz method itself.


Refactor copy Method Name

Refactored copy to copy_participant in all spec test instances (assignment_participant_spec.rb).


Refactor self.grant_publishing_rights to assign_copyright

Following refactor, a new spec test needed to be built for the modified assign_copyright method in assignment_participant_spec.rb.

  • Creates new RSA key-pair for a participant
  • Assigns the public key of this key-pair to the user.public_key attribute.
  • Tests if key matches using assign_copyright


In this test, we created a new RSA key pair in order to effectively test the functionality of the assign_copyright method. We then call the assign_copyright and pass the private key to this method. In order to test whether the function succeeded, we test to make sure that the permission_granted field is set to true for this participant.


Rewrite Scores Method As described in the previous section, during the rewrite of the scores method our team cleaned up the merge scores method as well, by creating a new update_max_or_min method and abstracting/DRYing out the code. We wanted to make sure to thoroughly test this new method by adding the following rspec tests:

1. Removed topic_total_scores tests
2. Removed calculate_scores tests

We verified that the current scores tests were testing the functionality well and no changes were made to these tests.

3. We added 6 new tests to the rspec file to test the new methods for update_max_or_min. As displayed below, we test updating the min, and the max, under three different conditions.

Reviews_by_reviewer Method Since we decided to remove this method because it is unused in the application (besides Collusion_cycle.rb), we removed the associated rspec tests as well:

Review Score We also removed the Rspec tests for review_score method which we removed as stated in the previous section.

Collusion Cycle
As discussed in previous section, we also removed some failing tests in collusion_cycle_spec.rb, as per request from Dr. Gehringer, which began failing after we removed methods Collusion Cycle called from assignment_participant.rb. These test removals are displayed below:

Response
As discussed in a previous section, the response.rb file had to be edited so that the methods in this file are able to perform the comment volumetric calculations for any given number of rounds. Because of the changes discussed in the previous section, we had to update the corresponding Rspec tests to work with the new return format.

UI Testing

Following steps needs to be performed to test the volume refactoring in the UI:
1. Login as instructor and enter anonymized view using the manage tag.
2. Go to the manage tab and enter the courses page
3. Choose a course and in any of the listed assignments, under the action section, click “view reports”
4. Select the view button
5. You should see the volume of reviews by round for each reviewer.

Scope for future improvement

1. We found that scores are calculated in many different places and in many different ways throughout the code. An interesting future project would be to identify where these different calculations are made, and refactor so they are all made in one place for the same type of scores. This will make the code more universal and easier to follow and understand.