CSC/ECE 517 Fall 2015/oss E1555 GMR: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(47 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Apotomo''' is a platform-specific [[Widget (GUI)|widget]] framework for [[Ruby_on_Rails|Ruby on Rails]], designed to simplify the components and code of the view section of the [[MVC]] [[Design_pattern|design pattern]]. Apotomo is built on, and was built by the same engineer as, the Cells Project.<ref>https://github.com/apotonick/cells</ref>
This is wiki page for the E1555 OSS assignment for Fall 2015, CSC/ECE 517.


== Design goals and overview ==
== Peer Review Information ==


'''Apotomo''' assists developers by reducing the amount of dynamic code needed to build the view component of a Ruby on Rails project, as well as making the view component code re-usable. <br />
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:
* Instructor login: username -> instructor6,  password -> password
* Student  login: username -> student5762,  password -> password
* Student login: username -> student5763,  password -> password
* Student login: username -> student5764,  password -> password


'''View Code Reduction:''' Apotomo usage is based upon Apotomo widgets (which are Ruby classes), and all Apotomo widgets inherit from the Apotomo:Widget base class.  Even though these Apotomo widgets are rendered in and utilized for the view components, Apotomo widgets move conventional view code into the Apotomo widget class, thus "clearing up" and reducing the code in the view component.
Please make note that new accounts and password resets are disabled on the Expertiza deployment; That functionality is outside the scope of the assignment, and it is unnecessary to review that functionality.


'''Code Re-usability:''' Apotomo widgets improve code re-usability by moving code from the view files into newly created "mini-controllers" for the Apotomo widgets.  These "mini-controllers" can be used in an endless number of views in a website. For example, consider an implementation project for an E-Commerce site. Each page of the E-Commerce site would need a "# of items in shopping bag" widget on each page, with some dynamic elements or behaviors. Without Apotomo, a developer may need to have repeated code in all views for pages with the "# of items in shopping bag" widget. But, with Apotomo, the developer could simply create a ShoppingCart > Apotomo:Widget "mini-controller" class, and then reference the class repeatedly in endless number(s) of controller actions and views.
== Expertiza Background==


== Configuration ==
Expertiza is an open-source web-application with functionality to facilitate the submission and peer review of assignments in an academic setting. Expertiza supports team based assignments, student and instructor roles, allocation of assignments to students (e.g. sign-ups) with number limits.
* Install [[Ruby (programming language)|Ruby]] 1.9.3/2.0.0 and [[Ruby on Rails|Rails]] 3/4 as a prerequisite.
* Clone the source code located at [[GitHub]].<ref>https://github.com/apotonick/apotomo</ref>
* Install the Apotomo gem by running
gem install apotomo
* Modify the Gemfile in your project by adding the below line if not added
gem 'apotomo'
* You can find the sample tutorial at the official Apotomo site. <ref name="websitede">http://apotomo.de/.</ref>


== Version History ==
== Assignment Scope & Description ==
Some of the important release versions have been listed below:
For this assignment, 7 Work Items were assigned, requiring the modification and testing of the Expertiza Ruby on Rails code.
* v1.3.2 Latest Bug fix release Jun 11, 2015
* v1.3.0 Version release Jun 3, 2014
* v1.2.0 Version release Oct 12, 2011
* v1.1.0 Version release Mar 1, 2011
* v1.0.0 Version release Nov 17, 2010
* v0.1.0 Initial Apotomo GEM release
For details and packages, refer to releases page in the Apotomo website. <ref>https://github.com/apotonick/apotomo/releases</ref>


== Usage ==
Of the 7 Work Items in the scope of our assignment: 3 of the Work Items involved making code changes to Expertiza, 3 other Work Items involved testing those changes, and one final Work Item had a deliverable of a recorded online video. Below is a list of the Work Items in scope, each with a "WI#" identifier, which will be used henceforth to reference the respective Work Item.


'''Apotomo''' can be utilized to create modern rich application based widgets. It provides a component based application on which widgets can be built. These widgets can directly respond to Ruby events and the development is hassle free. Just a small amount of code can give us a great deal of functionality with Apotomo, eg. a small blog entry widget, tweeting from your website,  status updates, etc.
* '''WI1''': Generate _team_name() exists in 2 places: team.rb line 41 and team_helper.rb line 62. Remove the one which is not used.
* '''WI2''': Write test cases for the remaining generate _team_name() method.


A dummy of how your <<Widget_name>>.rb file could look like:<syntaxhighlight lang="ruby">
* '''WI3''': Test and fix (if any of them are broken) if export_fields(), import() and export() works for both assignment_team.rb and course_team.rb.
class <<YourWidget>> < Apotomo::Widget
* '''WI4''': Write tests for team exporting and importing for both assignment team and course team.
  responds_to_event :<<event_name>>
* '''WI5''': Record a video which demos team exporting and importing, submit it to youtube and submit the youtube link to Expertiza.
  def <<process>>
      ...
  end
end
</syntaxhighlight>The text inside << >> can be replaced with the appropriate names and events as desired by the user and required as per the application. Do not use the << >> when replacing with the original text.


== Licenses ==
* '''WI6''': In add_member method, testing if the team can have more members (using “can_add_member” as flag variable) should be extracted to a single method.  This method should be used by join_team_requests_controller.rb too.
* '''WI7''': Write tests for adding members when both the team is full and not.


'''Apotomo''' is an open source tool copyrighted to Nick Sutterer under
Please note that below sections discuss the work done within the scope of each Work Item, but Work Item WI5 is not discussed. Please view the link in the submitted Expertiza assignment.
MIT license. The source code is stored at the GitHub repository location. <ref name="websitede"/>
 
== Solutions Implemented and Delivered ==
 
* Work Item 1 ('''WI1'''): The generate_team_name() method was removed from the [https://github.com/guru1989/expertiza/blob/master/app/helpers/team_helper.rb team_helper.rb]  file. This method was removed because, during analysis and testing it was found that the Generate_team_name method (line 159) in the [https://github.com/guru1989/expertiza/blob/master/app/models/team.rb Team.rb] model file was being executed.
 
* Work Item 3 ('''WI3'''): In the [https://github.com/guru1989/expertiza/blob/master/app/models/course_team.rb models/course_team.rb] file, updated the export function (line 39) to export the team members' names consecutively instead of with a space in between them. Making this change now made the export_participants method unnecessary, so that method was deleted. (The export_all_assignment_team_related_to_course function was also changed in the same manner, but that function is deprecated.) The add_member function (line 177) was added as a overriding function in the course_team function class, such that it doesn't check if the team is full.
 
* Work Item 6 ('''WI6'''): In the [https://github.com/guru1989/expertiza/blob/master/app/models/team.rb /models/team.rb file], the add_member method (line 69) was refactored to check if the team can have more members. Additionally, the full? method (line 60) was customized such that it was more useful. The [https://github.com/guru1989/expertiza/blob/master/app/controllers/join_team_requests_controller.rb controllers/join_team_requests_controller.rb] controller-file was modified to add additional checks for handling the case of sending a team request to a team which is already full. (line 50)
 
== Testing Details ==
 
* Work Item 2 ('''WI2'''): The [https://github.com/guru1989/expertiza/blob/master/test/unit/team_test.rb /test/unit/team_test.rb] file was added, and the included test cases tested the generate_team_name() method functionality. The purpose of each test case is listed in a comment prior to the actual case. In summary, the cases test for name generation, additional name generation, name generation of a zero-length string, name generation of a null string, and name generation after a loop of 20 generated names.
 
* Work Item 4 ('''WI4'''): The [https://github.com/guru1989/expertiza/blob/master/test/unit/course_team_test.rb /test/unit/course_team_test.rb] file was updated to cover more test cases. The [https://github.com/guru1989/expertiza/blob/master/test/fixtures/courses.yml courses.yml] and [https://github.com/guru1989/expertiza/blob/master/test/fixtures/teams_users.yml team_users.yml] fixture files were added for better support. The cases test the retrieval if course information, general importing, importing of participants, exporting, field exporting, and testing a failed duplicate import.
 
* Work Item 7 ('''WI7'''): the [https://github.com/guru1989/expertiza/blob/master/test/controllers/teams_users_controller_test.rb test/controllers/teams_users_controller_test.rb] file was added, and the enclosed test cases tested the functionality of attempting to add members to a team, and whether the process was successful or not. The following list of fixture files were also added to assist in testing: [https://github.com/guru1989/expertiza/blob/master/test/fixtures/assignments.yml assignments.yml], [https://github.com/guru1989/expertiza/blob/master/test/fixtures/nodes.yml nodes.yml], [https://github.com/guru1989/expertiza/blob/master/test/fixtures/users.yml users.yml], [https://github.com/guru1989/expertiza/blob/master/test/fixtures/participants.yml participants.yml], [https://github.com/guru1989/expertiza/blob/master/test/fixtures/teams.yml teams.yml], [https://github.com/guru1989/expertiza/blob/master/test/fixtures/roles.yml roles.yml]. The test cases test for successful member adds, failed member adds, and participant and non-participant adds.
 
=== UI Testing ===
 
This [https://www.youtube.com/watch?v=WW21k_3YMJw video], which was created as one of the deliverables of the assignment, provides a good instruction to the forms and pages associated with the functionality in scope.
 
To test the functionality under '''WI1''': log in as admin or instructor, navigate to Manage Courses, tab to assignments, for an existing assignment choose the icon to the right which navigates to creating and managing teams. Click 'Create Team'.
 
To test the functionality under '''WI3''', please view the video above.
 
To test the functionality under '''WI6''', log in as admin or instructor, click on the Assignments tab in Manage Content,  for an existing assignment choose the icon to the right which navigates to creating teams. For an existing team, choose the green '+', then add a user's account name.
 
== Suggested Future Improvements ==
 
* Perform analysis on the remaining generate_team_name methods to validate whether or not the two remaining versions need to continue to exist in the code.
* Perform analysis to consider adding a more robust Teams view. Or, consider more clear functionality on how to go about getting to the Team functionality.
* Consider a full-on usability/UX overhaul. The application as a whole has good functionality, but the UX is somewhat limiting.
* Improve Deployment SOP.
* The two below scenarios result in errors:
 
Scenario 1: Assignment Teams
Login as instructor -> Click Assignments Tab -> For some assignment, click Create Team button on the right
Here adding a non participant to a team results in a flash message.
Adding a non user (invalid username) results in a crash.
Scenario 2: Course Teams
Login as instructor -> Click Courses Tab -> For some course, click Create Team button on the right
Here most of the functionalities seem to be broken.
Here clicking the "Create team" option results in a crash.
Adding members to existing teams also does not work.
 
== Deployment to VCL Steps ==
 
Deployment of Expertiza on Heroku:
 
* Reserved a VCL machine with environment [CSC517, F15] Ruby on Rails / Expertiza
* Cloned a copy of Expertiza from GitHub.
* Did bundle install. (Faced some issue here and was fixed by running a command. Got help from Piazza posts)
* Created the DB in dev environment and loaded all data from scrubbed db provided by TA.
* Ran the server binding the ip to the ip of the machine.


==References==
==References==
{{reflist}}
{{reflist}}

Latest revision as of 04:03, 6 November 2015

This is wiki page for the E1555 OSS assignment for Fall 2015, CSC/ECE 517.

Peer Review Information

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

  • Instructor login: username -> instructor6, password -> password
  • Student login: username -> student5762, password -> password
  • Student login: username -> student5763, password -> password
  • Student login: username -> student5764, password -> password

Please make note that new accounts and password resets are disabled on the Expertiza deployment; That functionality is outside the scope of the assignment, and it is unnecessary to review that functionality.

Expertiza Background

Expertiza is an open-source web-application with functionality to facilitate the submission and peer review of assignments in an academic setting. Expertiza supports team based assignments, student and instructor roles, allocation of assignments to students (e.g. sign-ups) with number limits.

Assignment Scope & Description

For this assignment, 7 Work Items were assigned, requiring the modification and testing of the Expertiza Ruby on Rails code.

Of the 7 Work Items in the scope of our assignment: 3 of the Work Items involved making code changes to Expertiza, 3 other Work Items involved testing those changes, and one final Work Item had a deliverable of a recorded online video. Below is a list of the Work Items in scope, each with a "WI#" identifier, which will be used henceforth to reference the respective Work Item.

  • WI1: Generate _team_name() exists in 2 places: team.rb line 41 and team_helper.rb line 62. Remove the one which is not used.
  • WI2: Write test cases for the remaining generate _team_name() method.
  • WI3: Test and fix (if any of them are broken) if export_fields(), import() and export() works for both assignment_team.rb and course_team.rb.
  • WI4: Write tests for team exporting and importing for both assignment team and course team.
  • WI5: Record a video which demos team exporting and importing, submit it to youtube and submit the youtube link to Expertiza.
  • WI6: In add_member method, testing if the team can have more members (using “can_add_member” as flag variable) should be extracted to a single method.  This method should be used by join_team_requests_controller.rb too.
  • WI7: Write tests for adding members when both the team is full and not.

Please note that below sections discuss the work done within the scope of each Work Item, but Work Item WI5 is not discussed. Please view the link in the submitted Expertiza assignment.

Solutions Implemented and Delivered

  • Work Item 1 (WI1): The generate_team_name() method was removed from the team_helper.rb file. This method was removed because, during analysis and testing it was found that the Generate_team_name method (line 159) in the Team.rb model file was being executed.
  • Work Item 3 (WI3): In the models/course_team.rb file, updated the export function (line 39) to export the team members' names consecutively instead of with a space in between them. Making this change now made the export_participants method unnecessary, so that method was deleted. (The export_all_assignment_team_related_to_course function was also changed in the same manner, but that function is deprecated.) The add_member function (line 177) was added as a overriding function in the course_team function class, such that it doesn't check if the team is full.
  • Work Item 6 (WI6): In the /models/team.rb file, the add_member method (line 69) was refactored to check if the team can have more members. Additionally, the full? method (line 60) was customized such that it was more useful. The controllers/join_team_requests_controller.rb controller-file was modified to add additional checks for handling the case of sending a team request to a team which is already full. (line 50)

Testing Details

  • Work Item 2 (WI2): The /test/unit/team_test.rb file was added, and the included test cases tested the generate_team_name() method functionality. The purpose of each test case is listed in a comment prior to the actual case. In summary, the cases test for name generation, additional name generation, name generation of a zero-length string, name generation of a null string, and name generation after a loop of 20 generated names.
  • Work Item 4 (WI4): The /test/unit/course_team_test.rb file was updated to cover more test cases. The courses.yml and team_users.yml fixture files were added for better support. The cases test the retrieval if course information, general importing, importing of participants, exporting, field exporting, and testing a failed duplicate import.

UI Testing

This video, which was created as one of the deliverables of the assignment, provides a good instruction to the forms and pages associated with the functionality in scope.

To test the functionality under WI1: log in as admin or instructor, navigate to Manage Courses, tab to assignments, for an existing assignment choose the icon to the right which navigates to creating and managing teams. Click 'Create Team'.

To test the functionality under WI3, please view the video above.

To test the functionality under WI6, log in as admin or instructor, click on the Assignments tab in Manage Content, for an existing assignment choose the icon to the right which navigates to creating teams. For an existing team, choose the green '+', then add a user's account name.

Suggested Future Improvements

  • Perform analysis on the remaining generate_team_name methods to validate whether or not the two remaining versions need to continue to exist in the code.
  • Perform analysis to consider adding a more robust Teams view. Or, consider more clear functionality on how to go about getting to the Team functionality.
  • Consider a full-on usability/UX overhaul. The application as a whole has good functionality, but the UX is somewhat limiting.
  • Improve Deployment SOP.
  • The two below scenarios result in errors:

Scenario 1: Assignment Teams Login as instructor -> Click Assignments Tab -> For some assignment, click Create Team button on the right Here adding a non participant to a team results in a flash message. Adding a non user (invalid username) results in a crash.

Scenario 2: Course Teams Login as instructor -> Click Courses Tab -> For some course, click Create Team button on the right Here most of the functionalities seem to be broken. Here clicking the "Create team" option results in a crash. Adding members to existing teams also does not work.


Deployment to VCL Steps

Deployment of Expertiza on Heroku:

  • Reserved a VCL machine with environment [CSC517, F15] Ruby on Rails / Expertiza
  • Cloned a copy of Expertiza from GitHub.
  • Did bundle install. (Faced some issue here and was fixed by running a command. Got help from Piazza posts)
  • Created the DB in dev environment and loaded all data from scrubbed db provided by TA.
  • Ran the server binding the ip to the ip of the machine.

References