CSC/ECE 517 Fall 2015/oss E1554 AAR: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Created page with "'''E1554 Refactoring TeamsController.rb''' This is description of the CSC/ECE 517 Fall2015 OSS project(E1554),we refactored teams_controller.rb,students_team_controller.rb,sign_u...")
 
No edit summary
Line 27: Line 27:


== What Needs to be Done ==
== What Needs to be Done ==
Make topic_transfering a function call, and make sure all those 4 scenario works.
*Make topic_transfering a function call, and make sure all those 4 scenario works.
Fix issue 540 which is scenario 4 above.
*Write tests for all those 4 scenarios.
Write tests for all those 4 scenarios.
*Record a video for those 4 scenarios, submit it to YouTube and submit the YouTube link to Expertiza.
Record a video for those 4 scenarios, submit it to YouTube and submit the YouTube link to Expertiza.
*Delete method in teams_controller.rb is complicated, “@team.destroy” should be called latest after all the records related to this team can be deleted.
Delete method in teams_controller.rb is complicated, here are some ideas to refactor: 1) “@team.destroy” should be called latest after all the records related to this team can be deleted; 2) destroying teams_users records can be extracted into a method in teams_users.rb; 3) line 95 -102 (if next_wait_listed_team...end) is duplicated at 3 places and should be extracted into a single method.
*write tests for delete method.
You should also write tests for delete method.

Revision as of 23:28, 30 October 2015

E1554 Refactoring TeamsController.rb This is description of the CSC/ECE 517 Fall2015 OSS project(E1554),we refactored teams_controller.rb,students_team_controller.rb,sign_up_topic.rb we extracted the duplicate code into a single function call,and we made sure when team is deleted its associated records are deleted first then the team gets deleted.


Expertiza

Expertiza[[1]] is a project built with Ruby on Rails.It is mainly used by an instructor to provide a peer reviewing systems among the students it also supports team projects submissions wikis etc.


What it Does

This class handle the basic creation and modification of student teams. There are also some complicated actions. E.g., if a team get destroyed (this may be caused by instructor force this team to be destroyed, the students all leave the team), the topic held by this team should be transferred to next team which is on the waiting list, if there is any. These are the scenarios where topic transferring may happen: 1) when instructor destroys a team 2) when the last person leave this team 3) when this team wants to switch topic 4) when instructor wants to increase the available slots for a topic.


Problem Statement

The same code for handling topic transferring used 3 times at the following places:

[scenario 1] teams_controller line 95 (if next_wait_listed_team), 
[scenario 2] student_teams_controller line 139 (if first_waitlisted_team) and 
[scenario 4] sign_up_topic line 117 (if next_wait_listed_team). 
Scenario 3’s code is not copied, and one can find the code at line 92 in sign_up_topic.rb.


What Needs to be Done

  • Make topic_transfering a function call, and make sure all those 4 scenario works.
  • Write tests for all those 4 scenarios.
  • Record a video for those 4 scenarios, submit it to YouTube and submit the YouTube link to Expertiza.
  • Delete method in teams_controller.rb is complicated, “@team.destroy” should be called latest after all the records related to this team can be deleted.
  • write tests for delete method.