CSC/ECE 517 Fall 2013/oss ans: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
== Appendix == | == Appendix == | ||
== External Links == | |||
:1. [http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza] | |||
:2. [http://152.7.99.43:3000/ VCL Link] | |||
:3. [https://github.com/nixtish/expertiza Git repository] | |||
:4. [https://docs.google.com/a/ncsu.edu/document/d/1Z0xjFZu-Zy-xm73YyUVUgFCtfWgRwhN1rZuThoyF-U0/edit Steps to setup Expertiza] |
Revision as of 03:14, 30 October 2013
E807 : Refactoring and testing response_controller.rb
Introduction
The response controller creates, edits, and displays responses, that is, rubrics to be filled out, or filled-out rubrics. Our project requirement entailed the following things to be done.
- Reduce the method complexity in the response controller.
- Remove duplicated code.
- There were “custom_create” and “custom_update” methods for “custom” (multipart) rubrics. We already had create and update methods that were handling the normal rubrics. Our job was to use polymorphism in order to eliminate the custom methods.
Refactoring carried out
As per the project requirements the following work was carried out :
- The duplicated code has been refactored and put in a separate method which is called wherever required. This prevents redundancy.
- The variables set up in controller become automatically available to the views. Hence the repeated code from controller and view for finding the topic id signed up by a user/team has been deleted from controller and incorporated only in the response view.
- The custom create and custom update methods have been removed. Their functionality has been merged with create and update methods as was mentioned in the requirement specification. Depending on the type of rubric rendered, the create and update method does the necessary updations.
Testing Done
Capybara tests were created for the response controller in order to carry out integration testing.
Future Work
Given the current state of the response controller there is still a lot of work that can be done in order to further improve the code. Based on our findings the following things can be done :
- The controller still has some code that is only there for some specific assignments. This is bad design and this code needs to be removed.
Appendix
External Links
- 1. Expertiza
- 2. VCL Link