CSC/ECE 517 Spring 2019 - Project E1925. Refactor E1858. Github metrics integration: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


===Problem Statement===
===Problem Statement===
'''Expertiza''' provides '''teammate reviews''' to gauge how much each team member contributed, this information could be generated from data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  Currently, Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.
'''Expertiza''' provides '''teammate reviews''' to gauge how much each team member contributed, this information could be generated from data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link.  Currently, Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.


:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.
:1. '''Teammate Reviews''' functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.
:2. '''Github Metrics''' under '''View Submissions''' page should include a bar chart that shows the number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.


While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.
While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.


===Project Task===
===Project Task===
Extract Github metadata of the submitted repos and pull requests.
Extract Github metadata of the submitted repos and pull requests.
#The metadata should be stored in the local Expertiza DB (we have a sample design here, which you may use or modify). For each participant, record should include at least  include:
#The metadata should be stored in the local Expertiza DB (we have a sample design here, which you may use or modify). For each participant, record should include at least  include:
Line 27: Line 25:
#Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.
#Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.


This task has been partially implemented by another group for project''' E1858. Github Metrics Integration''' in 2018 Fall semester. Detailed document about project E1858 on framework design and implementation can be found in [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration here] and the PR for Project E1858 is shown in [https://github.com/expertiza/expertiza/pull/1179 Here]. However, their work has been rejected with the feedback "They have integrated the github metrics into expertiza to show the number of commits, pull requests status, etc against every project. They have also integrated it into the metrics.  Looks like they covered the edge cases. The code looks good but needs comments as it is pretty complex. The documentation feels like it is flooded with code, if there was a description of the changes, it would have been better. Extensive tests, but it might be good to see if additions to existing tests really belong in those same tests". The goal of our current project is to resolve issues existing in their previous work, refactor codes they created and modify their code following "DRY" principles. The ultimate goal is to have the '''Github Metric Integration''' work in Expertiza.
===Team===
*swang28(Shuai Wang)
*zwu17(Ziwei Wu)
*hlu6(Hao Lu)
*ychen239(Yuhan Chen)
*zhu6 (Zhewei Hu, mentor)
=='''Plan of Work'''==
After understanding the project E1851, We found some issues in this project and give our solutions below.
===Add New Controller===
'''Problem:''' The related codes for Github related functionalities are most implemented under "Grades_Controller". This design obviously violates a good design pattern because Grade_Controller involves too many functions.
'''Solution:''' To improve it, we should create a separate "Github_Metrics_Controller" which is specifically responsible for functions related to Github Metrics.Following the MVC architecture, we will also need to create corresponding '''Models''' and '''Views''' for the new controller.
===Move JavaScript Code===
'''Problem:''' There are some JavaScript codes in inappropriate positions.
'''Solution:'''


This task has been partially implemented by another group for project''' E1858. Github Metrics Integration''' in 2018 Fall semester. However, their work has been rejected with the feedback "They have integrated the github metrics into expertiza to show the number of commits, pull requests status, etc against every project. They have also integrated it into the metrics.  Looks like they covered the edge cases. The code looks good but needs comments as it is pretty complex. The documentation feels like it is flooded with code, if there was a description of the changes, it would have been better.Extensive tests, but it might be good to see if additions to existing tests really belong in those same tests". The goal of our current project is to resolve issues existing in their previous work, refactor codes they created and modify their code following "DRY" principles. The ultimate goal is to have the '''Github Metric Integration''' work in Expertiza.


===Issues in Project E1858 ===
===Problem3===
Lots of codes in their current implementation violate ruby's "DRY" principles, such as redundant codes, meaningless names, long coding block and so on. We will refactor their code and fix code smells with the help of code climate platform.
===Solution3===


Detailed document about project E1858 on framework design and implementation can be found from  [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration E1858 wiki page]. After familiar with their work, we summarize a few issues needs our concerning.
===Problem4===
They missed some testing for their new added functions.
===Solution4===


* The related codes for Github related functionalities are most implemented under "Grades_Controller". This design obviously violates a good design pattern because Grade_Controller involves too many functions. To improve it, we should create a separate "Github_Metrics_Controller" which is specifically responsible for functions related to Github Metrics. Following the MVC architecture, we will also need to create corresponding '''Models''' and '''Views''' for the new controller.


* Lots of codes in their current implementation violate ruby's "DRY" principles, such as redundant codes, meaningless names, long coding block and so on. We will refactor their code and fix code smells with the help of code climate platform.
=='''Test Plan'''==


* There are some JavaScript codes in inappropriate positions.
===Rspec Test===


* They missed some testing for their new added functions.
===UI Test===


=='''Refactors and Improvements'''==
=='''Refactors and Improvements'''==
Line 67: Line 92:


=='''References'''==
=='''References'''==
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Project E1858 wiki]


[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]


[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Project E1858 wiki]
 
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]


[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]
[https://github.com/expertiza/expertiza/pull/1179 Project E1858 PR Link]


[https://developer.github.com/v3/ GitHub API documentation]
[https://developer.github.com/v3/ GitHub API documentation]

Revision as of 01:58, 9 April 2019

Introduction

Problem Statement

Expertiza provides teammate reviews to gauge how much each team member contributed, this information could be generated from data from external tools like Github (for example, number of commits, number of lines of code modified, number of lines added, number of lines deleted.) from each group’s submitted repo link. Currently, Expertiza provides Teammate Reviews under View Scores functionality for each assignment.

1. Teammate Reviews functionality in the View Scores page gauges teammate views on how much other team members contributed to the project. We need to augment this data with data from external tools like GitHub in order to validate that feedback. New metrics will be appended under each student data under the same functionality.
2. Github Metrics under View Submissions page should include a bar chart that shows the number of commits by the team throughout the assignment timeline. This will help instructors to get a team overview, and aid grading process.

While this data will not have marks associated directly, it will prove useful to the instructor in differentiating the performance of team members and hence awarding marks as per contribution. Overall data for the team, like the number of committers and number of commits may also help instructors to predict which projects are likely to be merged.

Project Task

Extract Github metadata of the submitted repos and pull requests.

  1. The metadata should be stored in the local Expertiza DB (we have a sample design here, which you may use or modify). For each participant, record should include at least include:
    • Committer id
    • Total number of commits
    • Number of files changed
    • Lines of code changed
    • Lines of code added
    • Lines of code removed
    • Lines of code added that survived until final submission [if available from Github]
  2. The code should sync the data with Github whenever someone (student or instructor) looks at a view that shows Github data.
  3. The data for teams should be shown in the instructor’s View Scores window, in a new tab, probably between Reviews and Author Feedback.
    • Design a good view for showing data on individuals. Please discuss this with the project mentor(s).
    • It seems to me that this should be on the Teammate Reviews tab, right below the grid for teammate reviews. The reason for this is that we’d like to see all the data on an individual in a single view. For teams, by contrast, there is already a pretty large grid, and potentially multiple grids for multiple rounds, so adding a new grid is more likely to clutter the display.
  4. Create a bar chart for the # of lines changed for each assignment team on “view_submissions” page. The x-axis should be the time starting from the assignment creation time, till the last deadline of the assignment, or current time, whichever is earlier.

This task has been partially implemented by another group for project E1858. Github Metrics Integration in 2018 Fall semester. Detailed document about project E1858 on framework design and implementation can be found in here and the PR for Project E1858 is shown in Here. However, their work has been rejected with the feedback "They have integrated the github metrics into expertiza to show the number of commits, pull requests status, etc against every project. They have also integrated it into the metrics. Looks like they covered the edge cases. The code looks good but needs comments as it is pretty complex. The documentation feels like it is flooded with code, if there was a description of the changes, it would have been better. Extensive tests, but it might be good to see if additions to existing tests really belong in those same tests". The goal of our current project is to resolve issues existing in their previous work, refactor codes they created and modify their code following "DRY" principles. The ultimate goal is to have the Github Metric Integration work in Expertiza.

Team

  • swang28(Shuai Wang)
  • zwu17(Ziwei Wu)
  • hlu6(Hao Lu)
  • ychen239(Yuhan Chen)
  • zhu6 (Zhewei Hu, mentor)


Plan of Work

After understanding the project E1851, We found some issues in this project and give our solutions below.

Add New Controller

Problem: The related codes for Github related functionalities are most implemented under "Grades_Controller". This design obviously violates a good design pattern because Grade_Controller involves too many functions.

Solution: To improve it, we should create a separate "Github_Metrics_Controller" which is specifically responsible for functions related to Github Metrics.Following the MVC architecture, we will also need to create corresponding Models and Views for the new controller.

Move JavaScript Code

Problem: There are some JavaScript codes in inappropriate positions.

Solution:


Problem3

Lots of codes in their current implementation violate ruby's "DRY" principles, such as redundant codes, meaningless names, long coding block and so on. We will refactor their code and fix code smells with the help of code climate platform.

Solution3

Problem4

They missed some testing for their new added functions.

Solution4

Test Plan

Rspec Test

UI Test

Refactors and Improvements

To refactor and improve project E1858, we will achieve the following tasks:

  • Run the E1858 code on the lastest Expertiza environment.
  • Clean the redundant and inaccurate code.
  • Refactor the old code into the correct controller(could be a new controller).
  • Move the Javascript code into the correct position.
  • Writing the new helper code.
  • Design the new interface page.
  • Wrting the new test case.

<Refactor>: grades_controller

File location: app/controllers/grades_controller.rb

Project E1858 Issues

Issues description here.

Project E1925 Improvements

Detialed improvemnts work here.

<Refactor>: grades_helper

File location: app/helpers/grades_helper.rb

Project E1858 Issues

Issues description here.

Project E1925 Improvements

Detialed improvemnts work here.

References

Expertiza_wiki

Project E1858 wiki

Project E1858 PR Link

GitHub API documentation