CSC/ECE 517 Fall 2022 - E2259. Refactor signup sheet controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 43: Line 43:


-- Wei-Chi
-- Wei-Chi
1. Rename "sign_up" to be "signup" when it is used as adjective or noun for variable/method/controller name.
https://github.com/weichic-ncsu/expertiza/commit/7fb2cceacbe459e5847141baea501bbd71952f12
https://github.com/weichic-ncsu/expertiza/commit/1152bac5c77cb9cf07f7de820e8677ba9a2a47ed
https://github.com/weichic-ncsu/expertiza/commit/3a5c6131c169812e455c20406809650a8a512646


-- Juan
-- Juan

Revision as of 21:17, 25 October 2022

This wiki page is for the information regarding the changes made for the E2223 OSS assignment for Spring 2022, CSC/ECE 517.

Team

Mentor

  • Ed Gehringer (efg)

Team Members

  • Juan Benavides (jdbenavi)
  • Wei-Chi Chen (wchen37)
  • Swetha Sairamakrishnan (jkini)

Introduction

Expertiza is a open source project developed on Ruby on Rails. This web application is maintained by the student and faculty at NC State. This application gives complete control to the instructor to maintain the assignments in their class. With multiple functionalities such as adding topics, creating groups, and peer reviews, Expertiza is a well developed application that can handle all types of assignments. To learn more about the full functionality Expertiza has to offer, visit the Expertiza wiki.

Peer Review Information

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

  • We have deployed the project -------------------
  • Instructor login: username -> instructor6, password -> password
  • Student login: username -> student5899, password -> password

About Controller

The sign up sheet controller

  • Allows an instructor to add/remove topics
  • Allows an instructor to assign/remove students to topics
  • Allows an student to see the list of available topics which can be bid on for given OSS assignment.

Issues

  • Naming is inconsistent. When used as a verb, “sign up” is two words. When an adjective or a noun, it should be one word, e.g., “signup_sheet_controller.” Cf. “sign_up_as_instructor”. Please make the naming consistent. Of course, this will result in changes in calling methods as well. [Mostly fixed by previous version of project.]
  • Update method has a plethora of instance variables defined before updating. These might not be necessary (e.g., look at update method of bookmarks_controller). Decide whether so many instance variables are really needed. Refactor the variables not needed out.
  • Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]
  • Several method names can be improved (including: load_add_signup_topics, list, ad_info etc.)
  • What are differences between signup_as_instructor and signup_as_instructor_action methods? Investigate if they are needed and improve the method names if both are needed. Provide comments as to what each method does.
  • The list method is too long and is sparsely commented. Provide comments and identify if the method can be split or made cleaner by moving code to models or helper methods.
  • Refactor participants variable in load_add_signup_topics

[In retrospect, the meaning of this is not clear. The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing. It used to be that participants (individual students) signed up for topics. Now, only teams can sign up for topics. So @participants does not make sense. Signup_as_instructor_action has if-else ladder. It can be made more elegant. [If it is worth keeping this method at all.]

  • Delete_signup and delete_signup_as_instructor have much in common and violate the DRY principle. delete_signup_as_instructor

Solutions

-- Swetha


-- Wei-Chi 1. Rename "sign_up" to be "signup" when it is used as adjective or noun for variable/method/controller name.

https://github.com/weichic-ncsu/expertiza/commit/7fb2cceacbe459e5847141baea501bbd71952f12 https://github.com/weichic-ncsu/expertiza/commit/1152bac5c77cb9cf07f7de820e8677ba9a2a47ed https://github.com/weichic-ncsu/expertiza/commit/3a5c6131c169812e455c20406809650a8a512646

-- Juan

Testing

RSpec
As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run:
rspec spec/controllers/signup_sheet_controller_spec.rb


Physical Testing
  1. edit this stuff:

Edge Cases and Pre-Conditions

  1. When dropping topic if submission already done.
  2. When deadline from dropping topic has passed.
  3. Deleting topic when topic cannot be found.
  4. Signup in case when user cannot be found.

Login as instructor

  1. Hover on Manage Tab
  2. Click on Assignments Tab
  3. Click on Edit Button for "OSS project & documentation" assignment
  4. Select the Topic Tab
  5. Click the Green Check for any topic
  6. Enter a student UnityID and click submit

Login as student

  1. Click on OSS project/Writing assignment 2
  2. Click on Signup sheet
  3. The list must be visible, which indicates functionality is as before after refactoring list function.