CSC/ECE 517 Fall 2016/E1644. Refactor and test Teams Controller

From Expertiza_Wiki
Revision as of 23:35, 28 October 2016 by Bsinha (talk | contribs)
Jump to navigation Jump to search

E1644. Refactor and Test 'Teams_Controller' Controller<ref>Project Description document https://google.com</ref>

This page provides a brief description of the Expertiza project. The project is aimed at refactoring and testing the 'Teams_Controller' Controller, which contains the methods to create new teams, list the existing teams, create new teams by inheriting existing teams, deleting existing teams and creating multiple teams at once by assigning them random topics. The project entailed, refactoring some part of the controller to improve the readability of code and then creating test cases in RSpec<ref>RSpec https://en.wikipedia.org/wiki/RSpec</ref> to verify the methods it possesses.


Introduction to Expertiza

Expertiza is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using Ruby on Rails framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.

Why refactoring?

Refactoring<ref>Refactoring https://en.wikipedia.org/wiki/Code_refactoring</ref> is restructuring of code without the need of changing any external behavior. It reduces complexity and improves readability. It also becomes easy to extend the application with respect to different modules and their functionalities. Some common techniques to refactor are:

  • Moving methods to appropriate modules
  • Breaking methods into more meaningful functionality
  • Creating more generalized code.
  • Renaming methods and variable.
  • Inheritance

Project Description

Refactor Teams_Controller controller. The following tasks have been performed as per the requirements.

  • Refactor variable -> @signUps to snake case.
  • Writing tests for Create method.
  • Writing tests for Delete method.
  • Writing tests for List method.
  • Writing tests for Inherit method

Refactoring

Testing the Teams_Controller