CSC/ECE 517 Fall 2024 - E2477. Reimplement suggestion controller.rb
Project Description
Suggestions are a way for students to propose a topic to work on. If approved by an instructor or TA, the suggested topic becomes the student's and the student's team's assignment. If the student is not on a team yet, a new one is created.
Problem Statement
The suggestion_controller.rb in Expertiza is responsible for managing all operations related to submitting and approving suggestions for new project topics proposed by students or teams. However, this controller currently violates the Single Responsibility Principle by directly interacting with members of other Model classes. To enhance maintainability and clarity, this functionality should be appropriately distributed among dedicated classes.
Objectives
- Enhance Documentation: Add comprehensive comments throughout the controller, clearly explaining the purpose and functionality of custom methods
- Reimplement Notification Method: Simplify the notification method by refining its control logic and reducing complexity for better readability and efficiency. Additionally, "notification" is a poor name; it should be renamed to a verb that clearly indicates the action being performed
- Clarify Method Names:
- Rename reject_suggestion to reject for clarity
- Rename update_suggestion to update to better reflect its functionality
- Rename approve_suggestion to approve for clarity
- Refactor Email Sending Logic: Move the send_email method to the Mailer class located in app/mailers/mailer.rb to separate concerns and streamline the code
- Address DRY Violations: In views/suggestion/show.html.erb and views/suggestion/student_view.html.erb, identify and resolve the DRY (Don't Repeat Yourself) violation by merging these two files into a single view to enhance maintainability
- Update Tests: Revise existing tests to ensure they pass after the changes. Additionally, improve test coverage for the controller by adding new tests to verify the updated functionality
- During the reimplementation, review the structure and functionality of existing suggestion-related classes for insights and best practices. Remember, this is a complete reimplementation, not a refactor
Since this is a reimplementation project, some functionalities may be altered. Ensure that all changes are properly tested and that existing tests are updated to reflect these modifications.
Development Strategy
Testing Plan
Team Members
- Anthony Spendlove (aspendl@ncsu.edu)
- Sean McLellan (spmclell@ncsu.edu)
- Dhananjay Raghu (draghu@ncsu.edu)
Mentor: Piyush Prasad (pprasad3@ncsu.edu)
External Links
- Project repo
- Project board
- [# Pull request]