<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sbhoyar</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sbhoyar"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sbhoyar"/>
	<updated>2026-05-21T21:43:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121533</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121533"/>
		<updated>2018-12-16T03:45:54Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
Previously, view submission does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for viewing GitHub metrics of teams and team members of an assignment. &lt;br /&gt;
&lt;br /&gt;
'''Pre-Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Team should have submitted the assignment with a PR link or GitHub repository.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The instructor should login.&lt;br /&gt;
&lt;br /&gt;
*The instructor should browse teams for an assignment.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the solution supports:&lt;br /&gt;
*# Number of commits per user and total per team.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, we only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately (changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with (people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
* We also considered if we needed to account for different branches. We only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories (like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used github-omniauth gem for authentication/authorization purposes.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository. We excluded expertiza and servo projects as right now a PR link is expected. Future enhancements can look into getting separate GitHub submission links.&lt;br /&gt;
&lt;br /&gt;
* We also show the status of check runs in the View Github metrics view to help instructors view the status of various tools on the repos/PRs without having to go to the actual GitHub page. &lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter4.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter3.png|none|frame|&lt;br /&gt;
At present, view submission shows group assignments are submitted as a single submission and 'view github metric' link shows work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
[[File:Ooddafter10.png|none|frame|The Github summary]]&lt;br /&gt;
&lt;br /&gt;
===='''Code Change in Grades_Controller'''====&lt;br /&gt;
* Added below new functions to implement Github Integration in View Submission page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def get_statuses_for_pull_request(ref)&lt;br /&gt;
    url = &amp;quot;https://api.github.com/repos/expertiza/expertiza/commits/&amp;quot; + ref + &amp;quot;/status&amp;quot;&lt;br /&gt;
    ActiveSupport::JSON.decode(Net::HTTP.get(URI(url)))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_pull_request_data(pull_links)&lt;br /&gt;
    pull_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;pull_request_number&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      github_data = get_pull_request_details(hyperlink_data)&lt;br /&gt;
      parse_github_data_pull(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_repository_data(repo_links)&lt;br /&gt;
    repo_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens[4]&lt;br /&gt;
      next if hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;servo&amp;quot; || hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;expertiza&amp;quot;&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens[3]&lt;br /&gt;
      github_data = get_github_data_repo(hyperlink_data)&lt;br /&gt;
      parse_github_data_repo(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_github_data&lt;br /&gt;
    team_links = @team.hyperlinks&lt;br /&gt;
    pull_links = team_links.select do |link|&lt;br /&gt;
      link.match(/pull/) &amp;amp;&amp;amp; link.match(/github.com/)&lt;br /&gt;
    end&lt;br /&gt;
    if !pull_links.empty?&lt;br /&gt;
      retrieve_pull_request_data(pull_links)&lt;br /&gt;
    else&lt;br /&gt;
      repo_links = team_links.select do |link|&lt;br /&gt;
        link.match(/github.com/)&lt;br /&gt;
      end&lt;br /&gt;
      retrieve_repository_data(repo_links)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_check_run_statuses&lt;br /&gt;
    @head_refs.each do |pull_number, ref|&lt;br /&gt;
      @check_statuses[pull_number] = get_statuses_for_pull_request(ref)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def view_github_metrics&lt;br /&gt;
    if session[&amp;quot;github_access_token&amp;quot;].nil?&lt;br /&gt;
      session[&amp;quot;participant_id&amp;quot;] = params[:id]&lt;br /&gt;
      session[&amp;quot;github_view_type&amp;quot;] = &amp;quot;view_submissions&amp;quot;&lt;br /&gt;
      redirect_to authorize_github_grades_path&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    @head_refs = {}&lt;br /&gt;
    @parsed_data = {}&lt;br /&gt;
    @authors = {}&lt;br /&gt;
    @dates = {}&lt;br /&gt;
    @total_additions = 0&lt;br /&gt;
    @total_deletions = 0&lt;br /&gt;
    @total_commits = 0&lt;br /&gt;
    @total_files_changed = 0&lt;br /&gt;
    @merge_status = {}&lt;br /&gt;
    @check_statuses = {}&lt;br /&gt;
&lt;br /&gt;
    @token = session[&amp;quot;github_access_token&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
&lt;br /&gt;
    retrieve_github_data&lt;br /&gt;
    retrieve_check_run_statuses&lt;br /&gt;
&lt;br /&gt;
    @authors = @authors.keys&lt;br /&gt;
    @dates = @dates.keys.sort&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def authorize_github&lt;br /&gt;
    redirect_to &amp;quot;https://github.com/login/oauth/authorize?client_id=#{GITHUB_CONFIG['client_key']}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_github_data_repo(hyperlink_data)&lt;br /&gt;
    data = {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          ref(qualifiedName: \&amp;quot;master\&amp;quot;) {&lt;br /&gt;
            target {&lt;br /&gt;
              ... on Commit {&lt;br /&gt;
                id&lt;br /&gt;
                  history(first: 100) {&lt;br /&gt;
                    edges {&lt;br /&gt;
                      node {&lt;br /&gt;
                        id author {&lt;br /&gt;
                          name email date&lt;br /&gt;
                        }&lt;br /&gt;
                      }&lt;br /&gt;
                    }&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        }&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    make_github_api_request(data)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_pull_request_details(hyperlink_data)&lt;br /&gt;
    response_data = make_github_api_request(get_query(true, hyperlink_data))&lt;br /&gt;
&lt;br /&gt;
    @has_next_page = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
    @end_cursor = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    while @has_next_page&lt;br /&gt;
      new_response_data = make_github_api_request(get_query(false, hyperlink_data))&lt;br /&gt;
      response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;].push(*new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;])&lt;br /&gt;
      @has_next_page = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
      @end_cursor = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    response_data&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def process_github_authors_and_dates(author_name, commit_date)&lt;br /&gt;
    @authors[author_name] ||= 1&lt;br /&gt;
    @dates[commit_date] ||= 1&lt;br /&gt;
    @parsed_data[author_name] ||= {}&lt;br /&gt;
    @parsed_data[author_name][commit_date] = if @parsed_data[author_name][commit_date]&lt;br /&gt;
                                               @parsed_data[author_name][commit_date] + 1&lt;br /&gt;
                                             else&lt;br /&gt;
                                               1&lt;br /&gt;
                                             end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_pull(github_data)&lt;br /&gt;
    team_statistics(github_data)&lt;br /&gt;
    pull_request_object = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;]&lt;br /&gt;
    commit_objects = pull_request_object[&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit = commit_object[&amp;quot;node&amp;quot;][&amp;quot;commit&amp;quot;]&lt;br /&gt;
      author_name = commit[&amp;quot;author&amp;quot;][&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit[&amp;quot;committedDate&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_repo(github_data)&lt;br /&gt;
    commit_history = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;ref&amp;quot;][&amp;quot;target&amp;quot;][&amp;quot;history&amp;quot;]&lt;br /&gt;
    commit_objects = commit_history[&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit_author = commit_object[&amp;quot;node&amp;quot;][&amp;quot;author&amp;quot;]&lt;br /&gt;
      author_name = commit_author[&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit_author[&amp;quot;date&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def make_github_api_request(data)&lt;br /&gt;
    uri = URI.parse(&amp;quot;https://api.github.com/graphql&amp;quot;)&lt;br /&gt;
    http = Net::HTTP.new(uri.host, uri.port)&lt;br /&gt;
    http.use_ssl = true&lt;br /&gt;
    http.verify_mode = OpenSSL::SSL::VERIFY_PEER&lt;br /&gt;
    request = Net::HTTP::Post.new(uri.path, 'Authorization' =&amp;gt; 'Bearer' + ' ' + session[&amp;quot;github_access_token&amp;quot;])&lt;br /&gt;
    request.body = data.to_json&lt;br /&gt;
    http.request(request)&lt;br /&gt;
    response = http.request(request)&lt;br /&gt;
    ActiveSupport::JSON.decode(response.body.to_s)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def organize_commit_dates&lt;br /&gt;
    @dates.each_key do |date|&lt;br /&gt;
      @parsed_data.each_value do |commits|&lt;br /&gt;
        commits[date] ||= 0&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @parsed_data.each {|author, commits| @parsed_data[author] = Hash[commits.sort_by {|date, _commit_count| date }] }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def team_statistics(github_data)&lt;br /&gt;
    @total_additions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;additions&amp;quot;]&lt;br /&gt;
    @total_deletions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;deletions&amp;quot;]&lt;br /&gt;
    @total_files_changed += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;changedFiles&amp;quot;]&lt;br /&gt;
    @total_commits += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;totalCount&amp;quot;]&lt;br /&gt;
    pull_request_number = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;number&amp;quot;]&lt;br /&gt;
    @head_refs[pull_request_number] = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;headRefOid&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @merge_status[pull_request_number] = if github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;merged&amp;quot;]&lt;br /&gt;
                                           &amp;quot;MERGED&amp;quot;&lt;br /&gt;
                                         else&lt;br /&gt;
                                           github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;mergeable&amp;quot;]&lt;br /&gt;
                                         end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_query(is_initial_page, hyperlink_data)&lt;br /&gt;
    commit_query_line = if is_initial_page&lt;br /&gt;
                          &amp;quot;commits(first:100){&amp;quot;&lt;br /&gt;
                        else&lt;br /&gt;
                          &amp;quot;commits(first:100, after:&amp;quot; + @end_cursor + &amp;quot;){&amp;quot;&lt;br /&gt;
                        end&lt;br /&gt;
    {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name:\&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          pullRequest(number: &amp;quot; + hyperlink_data[&amp;quot;pull_request_number&amp;quot;] + &amp;quot;) {&lt;br /&gt;
            number additions deletions changedFiles mergeable merged headRefOid&lt;br /&gt;
              &amp;quot; + commit_query_line + &amp;quot;&lt;br /&gt;
                totalCount&lt;br /&gt;
                  pageInfo{&lt;br /&gt;
                    hasNextPage startCursor endCursor&lt;br /&gt;
                    }&lt;br /&gt;
                      edges{&lt;br /&gt;
                        node{&lt;br /&gt;
                          id  commit{&lt;br /&gt;
                                author{&lt;br /&gt;
                                  name&lt;br /&gt;
                                }&lt;br /&gt;
                               additions deletions changedFiles committedDate&lt;br /&gt;
                        }}}}}}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Bar chart for # of commits changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of commits changed per team member since the start of the assignment, also bottom of the page shows summary from Github submissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  describe '#get_statuses_for_pull_request' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_pull_request_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_pull_request_details).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_pull)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets pull request details for each PR link submitted' do&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1261&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1293&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;mamaMiya&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_pull on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_pull).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_repository_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_github_data_repo).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_repo)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets details for each repo link submitted, excluding those for expertiza and servo' do&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;website&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;OODD&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Edward&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;, &amp;quot;https://github.com/Shantanu/expertiza]&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_repo on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_repo).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_github_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:retrieve_pull_request_data)&lt;br /&gt;
      allow(controller).to receive(:retrieve_repository_data)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves PR data only' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_pull_request_data).with([&amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have not been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves repo details ' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_repository_data).with([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_check_run_statuses' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;check_status&amp;quot;)&lt;br /&gt;
      controller.instance_variable_set(:@headRefs, {&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;qwerty&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;asdfg&amp;quot;})&lt;br /&gt;
      controller.instance_variable_set(:@check_statuses, {})&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets and stores the statuses associated with head commits of PRs' do&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;asdfg&amp;quot;)&lt;br /&gt;
      controller.retrieve_check_run_statuses&lt;br /&gt;
      expect(controller.instance_variable_get(:@check_statuses)).to eq({&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when user has logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = &amp;quot;qwerty&amp;quot;&lt;br /&gt;
        allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;status&amp;quot;)&lt;br /&gt;
        allow(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        allow(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the GitHub access token for later use' do&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
        expect(controller.instance_variable_get(:@token)).to eq(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_github_data to retrieve data from GitHub' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_check_run_statuses to retrieve check runs data' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121532</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=121532"/>
		<updated>2018-12-16T03:44:58Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
Previously, view submission does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
==='''Use Case Diagram'''===&lt;br /&gt;
[[File:UC_1.png|none|frame|1. Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. 2. Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for viewing GitHub metrics of teams and team members of an assignment. &lt;br /&gt;
&lt;br /&gt;
'''Pre-Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Team should have submitted the assignment with a PR link or GitHub repository.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The instructor should login.&lt;br /&gt;
&lt;br /&gt;
*The instructor should browse teams for an assignment.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submissions' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metrics table appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the solution supports:&lt;br /&gt;
*# Number of commits per user and total per team.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, we only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately (changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with (people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
* We also considered if we needed to account for different branches. We only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories (like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Solution Design'''==&lt;br /&gt;
&lt;br /&gt;
* The Github metrics that need to be integrated with Expertiza were finalized as below. These metrics are captured on a per-user basis:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# Pull Request Status ( includes code climate and Travis CI Build status)&lt;br /&gt;
*#User Github metrics:&lt;br /&gt;
*## Committer ID&lt;br /&gt;
*## Committer Name&lt;br /&gt;
*## Committer email ID&lt;br /&gt;
	&lt;br /&gt;
* A new link &amp;quot;Github Metrics&amp;quot; is provided under “View Submissions” for an assignment in the instructor view.This link opens a new tab and shows a stacked bar chart for number of commits per user vs submission timeline from assignment creation date to the deadline.&lt;br /&gt;
* In &amp;quot;View Scores&amp;quot; for an assignment in the instructor view, under Teammate Reviews tab, a new table for Github Metrics is added, which shows following Github metrics per user:&lt;br /&gt;
:Student Name/ID, Email ID, lines of code added, lines of code deleted, number of commits&lt;br /&gt;
&lt;br /&gt;
* For GitHub integration, we have used GitHub GraphQL API v4. We have used github-omniauth gem for authentication/authorization purposes.&lt;br /&gt;
&lt;br /&gt;
* We parse the link to PR to get data associated with it. We have also handled projects which do not have PR link, but just a link to the repository. We excluded expertiza and servo projects as right now a PR link is expected. Future enhancements can look into getting separate GitHub submission links.&lt;br /&gt;
&lt;br /&gt;
* We also show the status of check runs in the View Github metrics view to help instructors view the status of various tools on the repos/PRs without having to go to the actual GitHub page. &lt;br /&gt;
&lt;br /&gt;
=='''Implemented Solution'''==&lt;br /&gt;
&lt;br /&gt;
==='''Files Modified'''===&lt;br /&gt;
&lt;br /&gt;
* app/controllers/auth_controller.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/views/assignments/list_submissions.html.erb&lt;br /&gt;
* app/views/grades/_tabbing.html.erb&lt;br /&gt;
* app/views/grades/_teammate_reviews_tab.html.erb&lt;br /&gt;
* app/views/grades/view.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* config/application.rb&lt;br /&gt;
* config/initializers/load_config.rb&lt;br /&gt;
* config/initializers/omniauth.rb&lt;br /&gt;
* config/routes.rb&lt;br /&gt;
&lt;br /&gt;
==='''Files Added'''===&lt;br /&gt;
&lt;br /&gt;
* app/views/grades/view_github_metrics.html.erb&lt;br /&gt;
* config/github_auth.yml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''First Change'''===&lt;br /&gt;
&lt;br /&gt;
* A new table &amp;quot;Github Metrics&amp;quot; is added under Manage-&amp;gt; Assignments -&amp;gt; View Scores -&amp;gt; Teammate Reviews. Below is the screenshot of the implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter4.png|none|frame|The GitHub metrics table shows results for each team member]]&lt;br /&gt;
&lt;br /&gt;
==='''Second Change'''===&lt;br /&gt;
* The second change is in the View Submissions page, where we have added a link &amp;quot;Github Metrics&amp;quot; to a new page.&lt;br /&gt;
&lt;br /&gt;
[[File:Ooddafter3.png|none|frame|&lt;br /&gt;
At present, view submission shows group assignments are submitted as a single submission and 'view github metric' link shows work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
* The new page appears after clicking on the link &amp;quot;Github metrics&amp;quot;, that shows bar chart for # of commits per day. We have also added other relevant information about Pull Request, such as total commits, lines of code added, lines of code modified, PR merge status, check status.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture_3.png|none|frame|The bar chart]]&lt;br /&gt;
[[File:Ooddafter10.png|none|frame|The Github summary]]&lt;br /&gt;
&lt;br /&gt;
===='''Code Change in Grades_Controller'''====&lt;br /&gt;
* Added below new functions to implement Github Integration in View Submission page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def get_statuses_for_pull_request(ref)&lt;br /&gt;
    url = &amp;quot;https://api.github.com/repos/expertiza/expertiza/commits/&amp;quot; + ref + &amp;quot;/status&amp;quot;&lt;br /&gt;
    ActiveSupport::JSON.decode(Net::HTTP.get(URI(url)))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_pull_request_data(pull_links)&lt;br /&gt;
    pull_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;pull_request_number&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens.pop&lt;br /&gt;
      github_data = get_pull_request_details(hyperlink_data)&lt;br /&gt;
      parse_github_data_pull(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_repository_data(repo_links)&lt;br /&gt;
    repo_links.each do |hyperlink|&lt;br /&gt;
      submission_hyperlink_tokens = hyperlink.split('/')&lt;br /&gt;
      hyperlink_data = {}&lt;br /&gt;
      hyperlink_data[&amp;quot;repository_name&amp;quot;] = submission_hyperlink_tokens[4]&lt;br /&gt;
      next if hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;servo&amp;quot; || hyperlink_data[&amp;quot;repository_name&amp;quot;] == &amp;quot;expertiza&amp;quot;&lt;br /&gt;
      hyperlink_data[&amp;quot;owner_name&amp;quot;] = submission_hyperlink_tokens[3]&lt;br /&gt;
      github_data = get_github_data_repo(hyperlink_data)&lt;br /&gt;
      parse_github_data_repo(github_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_github_data&lt;br /&gt;
    team_links = @team.hyperlinks&lt;br /&gt;
    pull_links = team_links.select do |link|&lt;br /&gt;
      link.match(/pull/) &amp;amp;&amp;amp; link.match(/github.com/)&lt;br /&gt;
    end&lt;br /&gt;
    if !pull_links.empty?&lt;br /&gt;
      retrieve_pull_request_data(pull_links)&lt;br /&gt;
    else&lt;br /&gt;
      repo_links = team_links.select do |link|&lt;br /&gt;
        link.match(/github.com/)&lt;br /&gt;
      end&lt;br /&gt;
      retrieve_repository_data(repo_links)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def retrieve_check_run_statuses&lt;br /&gt;
    @head_refs.each do |pull_number, ref|&lt;br /&gt;
      @check_statuses[pull_number] = get_statuses_for_pull_request(ref)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def view_github_metrics&lt;br /&gt;
    if session[&amp;quot;github_access_token&amp;quot;].nil?&lt;br /&gt;
      session[&amp;quot;participant_id&amp;quot;] = params[:id]&lt;br /&gt;
      session[&amp;quot;github_view_type&amp;quot;] = &amp;quot;view_submissions&amp;quot;&lt;br /&gt;
      redirect_to authorize_github_grades_path&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    @head_refs = {}&lt;br /&gt;
    @parsed_data = {}&lt;br /&gt;
    @authors = {}&lt;br /&gt;
    @dates = {}&lt;br /&gt;
    @total_additions = 0&lt;br /&gt;
    @total_deletions = 0&lt;br /&gt;
    @total_commits = 0&lt;br /&gt;
    @total_files_changed = 0&lt;br /&gt;
    @merge_status = {}&lt;br /&gt;
    @check_statuses = {}&lt;br /&gt;
&lt;br /&gt;
    @token = session[&amp;quot;github_access_token&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    @team = @participant.team&lt;br /&gt;
    @team_id = @team.id&lt;br /&gt;
&lt;br /&gt;
    retrieve_github_data&lt;br /&gt;
    retrieve_check_run_statuses&lt;br /&gt;
&lt;br /&gt;
    @authors = @authors.keys&lt;br /&gt;
    @dates = @dates.keys.sort&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def authorize_github&lt;br /&gt;
    redirect_to &amp;quot;https://github.com/login/oauth/authorize?client_id=#{GITHUB_CONFIG['client_key']}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_github_data_repo(hyperlink_data)&lt;br /&gt;
    data = {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          ref(qualifiedName: \&amp;quot;master\&amp;quot;) {&lt;br /&gt;
            target {&lt;br /&gt;
              ... on Commit {&lt;br /&gt;
                id&lt;br /&gt;
                  history(first: 100) {&lt;br /&gt;
                    edges {&lt;br /&gt;
                      node {&lt;br /&gt;
                        id author {&lt;br /&gt;
                          name email date&lt;br /&gt;
                        }&lt;br /&gt;
                      }&lt;br /&gt;
                    }&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        }&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    make_github_api_request(data)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_pull_request_details(hyperlink_data)&lt;br /&gt;
    response_data = make_github_api_request(get_query(true, hyperlink_data))&lt;br /&gt;
&lt;br /&gt;
    @has_next_page = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
    @end_cursor = response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    while @has_next_page&lt;br /&gt;
      new_response_data = make_github_api_request(get_query(false, hyperlink_data))&lt;br /&gt;
      response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;].push(*new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;])&lt;br /&gt;
      @has_next_page = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;hasNextPage&amp;quot;]&lt;br /&gt;
      @end_cursor = new_response_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;pageInfo&amp;quot;][&amp;quot;endCursor&amp;quot;]&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    response_data&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def process_github_authors_and_dates(author_name, commit_date)&lt;br /&gt;
    @authors[author_name] ||= 1&lt;br /&gt;
    @dates[commit_date] ||= 1&lt;br /&gt;
    @parsed_data[author_name] ||= {}&lt;br /&gt;
    @parsed_data[author_name][commit_date] = if @parsed_data[author_name][commit_date]&lt;br /&gt;
                                               @parsed_data[author_name][commit_date] + 1&lt;br /&gt;
                                             else&lt;br /&gt;
                                               1&lt;br /&gt;
                                             end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_pull(github_data)&lt;br /&gt;
    team_statistics(github_data)&lt;br /&gt;
    pull_request_object = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;]&lt;br /&gt;
    commit_objects = pull_request_object[&amp;quot;commits&amp;quot;][&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit = commit_object[&amp;quot;node&amp;quot;][&amp;quot;commit&amp;quot;]&lt;br /&gt;
      author_name = commit[&amp;quot;author&amp;quot;][&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit[&amp;quot;committedDate&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def parse_github_data_repo(github_data)&lt;br /&gt;
    commit_history = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;ref&amp;quot;][&amp;quot;target&amp;quot;][&amp;quot;history&amp;quot;]&lt;br /&gt;
    commit_objects = commit_history[&amp;quot;edges&amp;quot;]&lt;br /&gt;
    commit_objects.each do |commit_object|&lt;br /&gt;
      commit_author = commit_object[&amp;quot;node&amp;quot;][&amp;quot;author&amp;quot;]&lt;br /&gt;
      author_name = commit_author[&amp;quot;name&amp;quot;]&lt;br /&gt;
      commit_date = commit_author[&amp;quot;date&amp;quot;].to_s&lt;br /&gt;
      process_github_authors_and_dates(author_name, commit_date[0, 10])&lt;br /&gt;
    end&lt;br /&gt;
    organize_commit_dates&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def make_github_api_request(data)&lt;br /&gt;
    uri = URI.parse(&amp;quot;https://api.github.com/graphql&amp;quot;)&lt;br /&gt;
    http = Net::HTTP.new(uri.host, uri.port)&lt;br /&gt;
    http.use_ssl = true&lt;br /&gt;
    http.verify_mode = OpenSSL::SSL::VERIFY_PEER&lt;br /&gt;
    request = Net::HTTP::Post.new(uri.path, 'Authorization' =&amp;gt; 'Bearer' + ' ' + session[&amp;quot;github_access_token&amp;quot;])&lt;br /&gt;
    request.body = data.to_json&lt;br /&gt;
    http.request(request)&lt;br /&gt;
    response = http.request(request)&lt;br /&gt;
    ActiveSupport::JSON.decode(response.body.to_s)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def organize_commit_dates&lt;br /&gt;
    @dates.each_key do |date|&lt;br /&gt;
      @parsed_data.each_value do |commits|&lt;br /&gt;
        commits[date] ||= 0&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @parsed_data.each {|author, commits| @parsed_data[author] = Hash[commits.sort_by {|date, _commit_count| date }] }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def team_statistics(github_data)&lt;br /&gt;
    @total_additions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;additions&amp;quot;]&lt;br /&gt;
    @total_deletions += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;deletions&amp;quot;]&lt;br /&gt;
    @total_files_changed += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;changedFiles&amp;quot;]&lt;br /&gt;
    @total_commits += github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;commits&amp;quot;][&amp;quot;totalCount&amp;quot;]&lt;br /&gt;
    pull_request_number = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;number&amp;quot;]&lt;br /&gt;
    @head_refs[pull_request_number] = github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;headRefOid&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    @merge_status[pull_request_number] = if github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;merged&amp;quot;]&lt;br /&gt;
                                           &amp;quot;MERGED&amp;quot;&lt;br /&gt;
                                         else&lt;br /&gt;
                                           github_data[&amp;quot;data&amp;quot;][&amp;quot;repository&amp;quot;][&amp;quot;pullRequest&amp;quot;][&amp;quot;mergeable&amp;quot;]&lt;br /&gt;
                                         end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_query(is_initial_page, hyperlink_data)&lt;br /&gt;
    commit_query_line = if is_initial_page&lt;br /&gt;
                          &amp;quot;commits(first:100){&amp;quot;&lt;br /&gt;
                        else&lt;br /&gt;
                          &amp;quot;commits(first:100, after:&amp;quot; + @end_cursor + &amp;quot;){&amp;quot;&lt;br /&gt;
                        end&lt;br /&gt;
    {&lt;br /&gt;
      query: &amp;quot;query {&lt;br /&gt;
        repository(owner: \&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;owner_name&amp;quot;] + &amp;quot;\&amp;quot;, name:\&amp;quot;&amp;quot; + hyperlink_data[&amp;quot;repository_name&amp;quot;] + &amp;quot;\&amp;quot;) {&lt;br /&gt;
          pullRequest(number: &amp;quot; + hyperlink_data[&amp;quot;pull_request_number&amp;quot;] + &amp;quot;) {&lt;br /&gt;
            number additions deletions changedFiles mergeable merged headRefOid&lt;br /&gt;
              &amp;quot; + commit_query_line + &amp;quot;&lt;br /&gt;
                totalCount&lt;br /&gt;
                  pageInfo{&lt;br /&gt;
                    hasNextPage startCursor endCursor&lt;br /&gt;
                    }&lt;br /&gt;
                      edges{&lt;br /&gt;
                        node{&lt;br /&gt;
                          id  commit{&lt;br /&gt;
                                author{&lt;br /&gt;
                                  name&lt;br /&gt;
                                }&lt;br /&gt;
                               additions deletions changedFiles committedDate&lt;br /&gt;
                        }}}}}}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Change 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate Reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data per team member based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Change 2: Bar chart for # of commits changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor (instructor6/password)&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Click on the &amp;quot;Github metrics&amp;quot; link for the team whose metrics you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A new page opens and shows # of commits changed per team member since the start of the assignment, also bottom of the page shows summary from Github submissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''RSpec Tests'''===&lt;br /&gt;
&lt;br /&gt;
* Following feature tests were added to the Grades_Controller_Spec.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  describe '#get_statuses_for_pull_request' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(Net::HTTP).to receive(:get) {&amp;quot;{\&amp;quot;team\&amp;quot;:\&amp;quot;rails\&amp;quot;,\&amp;quot;players\&amp;quot;:\&amp;quot;36\&amp;quot;}&amp;quot;}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'makes a call to the GitHub API to get status of the head commit passed' do&lt;br /&gt;
      expect(controller.get_statuses_for_pull_request('qwerty123')).to eq({&amp;quot;team&amp;quot; =&amp;gt; &amp;quot;rails&amp;quot;, &amp;quot;players&amp;quot; =&amp;gt; &amp;quot;36&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_pull_request_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_pull_request_details).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_pull)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets pull request details for each PR link submitted' do&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1261&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;expertiza&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_pull_request_details).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;pull_request_number&amp;quot; =&amp;gt; &amp;quot;1293&amp;quot;,&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;mamaMiya&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_pull on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_pull).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_pull_request_data([&amp;quot;https://github.com/expertiza/expertiza/pull/1261&amp;quot;, &amp;quot;https://github.com/Shantanu/mamaMiya/pull/1293&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_repository_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_github_data_repo).and_return({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;})&lt;br /&gt;
      allow(controller).to receive(:parse_github_data_repo)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets details for each repo link submitted, excluding those for expertiza and servo' do&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;website&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Shantanu&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      expect(controller).to receive(:get_github_data_repo).with(&lt;br /&gt;
          {&lt;br /&gt;
              &amp;quot;repository_name&amp;quot; =&amp;gt; &amp;quot;OODD&amp;quot;,&lt;br /&gt;
              &amp;quot;owner_name&amp;quot; =&amp;gt; &amp;quot;Edward&amp;quot;&lt;br /&gt;
          })&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;, &amp;quot;https://github.com/Shantanu/expertiza]&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'calls parse_github_data_repo on each of the PR details' do&lt;br /&gt;
      expect(controller).to receive(:parse_github_data_repo).with({&amp;quot;pr&amp;quot; =&amp;gt; &amp;quot;details&amp;quot;}).twice&lt;br /&gt;
      controller.retrieve_repository_data([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Edward/OODD&amp;quot;])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_github_data' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:retrieve_pull_request_data)&lt;br /&gt;
      allow(controller).to receive(:retrieve_repository_data)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves PR data only' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_pull_request_data).with([&amp;quot;https://github.com/Shantanu/website/pull/1123&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when pull request links have not been submitted' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        teams_mock = double&lt;br /&gt;
        allow(teams_mock).to receive(:hyperlinks).and_return([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.instance_variable_set(:@team, teams_mock)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'retrieves repo details ' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_repository_data).with([&amp;quot;https://github.com/Shantanu/website&amp;quot;, &amp;quot;https://github.com/expertiza/expertiza&amp;quot;])&lt;br /&gt;
        controller.retrieve_github_data&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#retrieve_check_run_statuses' do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;check_status&amp;quot;)&lt;br /&gt;
      controller.instance_variable_set(:@headRefs, {&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;qwerty&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;asdfg&amp;quot;})&lt;br /&gt;
      controller.instance_variable_set(:@check_statuses, {})&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it 'gets and stores the statuses associated with head commits of PRs' do&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      expect(controller).to receive(:get_statuses_for_pull_request).with(&amp;quot;asdfg&amp;quot;)&lt;br /&gt;
      controller.retrieve_check_run_statuses&lt;br /&gt;
      expect(controller.instance_variable_get(:@check_statuses)).to eq({&amp;quot;1234&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;, &amp;quot;5678&amp;quot; =&amp;gt; &amp;quot;check_status&amp;quot;})&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#view_github_metrics' do&lt;br /&gt;
    context 'when user hasn\'t logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        @params = {id: 900}&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = nil&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the current participant id and the view action' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(session[&amp;quot;participant_id&amp;quot;]).to eq(&amp;quot;900&amp;quot;)&lt;br /&gt;
        expect(session[&amp;quot;github_view_type&amp;quot;]).to eq(&amp;quot;view_submissions&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'redirects user to GitHub authorization page' do&lt;br /&gt;
        get :view_github_metrics, @params&lt;br /&gt;
        expect(response).to redirect_to(authorize_github_grades_path)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when user has logged in to GitHub' do&lt;br /&gt;
      before(:each) do&lt;br /&gt;
        session[&amp;quot;github_access_token&amp;quot;] = &amp;quot;qwerty&amp;quot;&lt;br /&gt;
        allow(controller).to receive(:get_statuses_for_pull_request).and_return(&amp;quot;status&amp;quot;)&lt;br /&gt;
        allow(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        allow(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'stores the GitHub access token for later use' do&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
        expect(controller.instance_variable_get(:@token)).to eq(&amp;quot;qwerty&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_github_data to retrieve data from GitHub' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_github_data)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it 'calls retrieve_check_run_statuses to retrieve check runs data' do&lt;br /&gt;
        expect(controller).to receive(:retrieve_check_run_statuses)&lt;br /&gt;
        get :view_github_metrics, {id: '1'}&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Added''' Solution Design for the final implemented design&lt;br /&gt;
* '''Added''' Implemented Solution to show feature additions to Expertiza&lt;br /&gt;
* '''Added''' Feature test cases for Grades controller&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120595</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120595"/>
		<updated>2018-11-21T02:21:09Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* '''Removed''' &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* '''Updated''' &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* '''Updated''' &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* '''Updated''' &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120591</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120591"/>
		<updated>2018-11-21T02:19:29Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Change-log for reviewers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for Reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120472</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120472"/>
		<updated>2018-11-21T00:37:52Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Change-log for reviewers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Introduction&amp;quot; to explain how the Github data will affect grading. &lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will exactly take.&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120470</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120470"/>
		<updated>2018-11-21T00:35:40Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''Teammate Reviews''' under '''View Scores''' functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will take.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120469</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120469"/>
		<updated>2018-11-21T00:35:07Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will take.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120461</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120461"/>
		<updated>2018-11-21T00:26:32Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will take.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120460</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120460"/>
		<updated>2018-11-21T00:25:32Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Changelog for reviewers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Change-log for reviewers'''==&lt;br /&gt;
This section will be removed in the final draft. It is just here for convenience of reviewers to know which sections were majorly updated from last review.&lt;br /&gt;
&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will take.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120459</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120459"/>
		<updated>2018-11-21T00:22:05Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;br /&gt;
&lt;br /&gt;
=='''Changelog for reviewers'''==&lt;br /&gt;
* Updated &amp;quot;Plan of Action&amp;quot; section to include which files and functions will be exactly updated.&lt;br /&gt;
* Removed &amp;quot;View submission&amp;quot; changes as per updated requirements(by the Professor).&lt;br /&gt;
* Updated &amp;quot;Design Considerations&amp;quot; with results of further investigation and our conclusions as to which approach we will take.&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120447</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120447"/>
		<updated>2018-11-21T00:05:47Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in an instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120444</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120444"/>
		<updated>2018-11-21T00:05:14Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades controller(grades_controller.rb)'''. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the same controller. It will return the GitHub data which will be stored in a instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120441</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120441"/>
		<updated>2018-11-21T00:03:57Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem '''Octokit''' to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use '''omniauth-github''' gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the '''Grades''' controller. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the '''view''' action in the controller. It will return the GitHub data which will be stored in a instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the '''_teammate_reviews_tab.html.erb''' partial under '''grades''' view-folder. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the '''bar-chart''' function in the '''grades''' controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120436</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120436"/>
		<updated>2018-11-20T23:59:19Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing was to determine what metrics we are looking for exactly. These are what the requirements document suggested:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing was to narrow down what hosting service for version control we would use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also considered whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all). We have decided to go with parsing the links as giving the link to PR is anyway mandatory.&lt;br /&gt;
&lt;br /&gt;
* An important question was whether we needed to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this would likely cause issues with stale information and would have been difficult to maintain.&lt;br /&gt;
*# Having a db was redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach was to take snapshots of metrics and store them in the db right on the submission deadline of projects. This would allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects would put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might have been good for grading purposes but wouldn't have helped with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data and will be getting the GitHub data on-demand directly using the GitHub API.&lt;br /&gt;
*# All that said, we might will maintain some meta-data in our db around what metrics we are retrieving(like LOCs, commiters, frequencies etc.)&lt;br /&gt;
* We also considered if we needed to account for different branches. The plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show. We will be keeping this in mind when we implement the views.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it would have been very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, we will be showing a new table below it to display the metrics. This will allow the instructor full view of how teammate rated each other and how that maps to factual information from GitHub.&lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem Octokit to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use omniauth-github gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the Grades controller. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the &amp;quot;view&amp;quot; action in the controller. It will return the GitHub data which will be stored in a instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the &amp;quot;_teammate_reviews_tab.html.erb&amp;quot; partial under &amp;quot;grades&amp;quot; view. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the &amp;quot;bar-chart&amp;quot; function in the &amp;quot;grades&amp;quot; controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120434</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120434"/>
		<updated>2018-11-20T23:51:23Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* In line with our investigation, we will be using the official gem Octokit to get GitHub data from API. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we will alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* Unfortunately, GitHub only allows 60 public GET requests per hour and 5000 if authenticated. We thus intend to use omniauth-github gem to integrate GitHub OAuth to authenticate the instructor.&lt;br /&gt;
* There is [https://developer.github.com/v3/ ample] documentation for GitHub API. The GitHub API returns JSON and we have been able to retrieve sample data using it.&lt;br /&gt;
* The &amp;quot;Teammate Review&amp;quot; section will get an additional table, in the View Scores page. We will be introducing our logic in the Grades controller. A new function will be created that will use the Octokit functions to retrieve the required data for the entire team.&lt;br /&gt;
* Our new function will be called from the &amp;quot;view&amp;quot; action in the controller. It will return the GitHub data which will be stored in a instance variable accessible to the views. &lt;br /&gt;
* We then implement the view. To show the GitHub metrics, we will be modifying the &amp;quot;_teammate_reviews_tab.html.erb&amp;quot; partial under &amp;quot;grades&amp;quot; view. The instance variable will be accessible here and will be used to pass data to the table.&lt;br /&gt;
* For charting, we will use the &amp;quot;bar-chart&amp;quot; function in the &amp;quot;grades&amp;quot; controller, also used in a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
* The table will be shown below the actual &amp;quot;Teammate Review&amp;quot; table as per the requirements.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120416</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120416"/>
		<updated>2018-11-20T23:22:13Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# We have decided against using our own tables for this data.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120144</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120144"/>
		<updated>2018-11-17T01:14:10Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing our end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120113</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120113"/>
		<updated>2018-11-16T02:56:47Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120083</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120083"/>
		<updated>2018-11-15T03:00:05Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120082</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120082"/>
		<updated>2018-11-15T02:59:36Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120081</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=120081"/>
		<updated>2018-11-15T02:53:25Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like GitHub.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from GitHub. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like GitHub. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on GitHub is a solution, but that is inefficient from instructor's/reviewer's perspective as there are many assignments, submissions, and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to the complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “GitHub Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of the number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support GitHub integration due to its popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use GitHub.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for GitHub repository link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with [https://docs.google.com/document/d/1gqKM6pOo02MnRIDRGOxgdKy0EmyWMp0uiK_czQzTsF8/edit this] schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with GitHub and then show the results. So we end up hitting GitHub API anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on the server. Also, for open source projects, this would mean that we don’t have the latest data to work with(people will keep committing past the deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing GitHub metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public GitHub profiles as students may use a different name. So instead of appending GitHub data to Teammate reviews table, it would be easier to just add a new tab called &amp;quot;GitHub Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the project's repositories(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get GitHub data and if we are allowed to use them. The idea is to always get the latest data from GitHub and show it to the user. For grading purposes, we could alternate a view between the latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from GitHub. There is [https://developer.github.com/v3/ ample] documentation for this. The GitHub API returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “GitHub Metrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock-up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, a suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'GitHub contribution metric' in teammate review. ]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'GitHub contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing, and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able to see the team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in the figure.&lt;br /&gt;
*Instructor will be able to see the work done by each student in 'Teammate Review Tab' with new metric appended at the end, as shown in the figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling GitHub data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the GitHub metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|The GitHub metrics are colored in blue]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|The GitHub metrics column shows the line graphs for every team]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: GitHub metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;GitHub metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different GitHub metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different GitHub metrics (e.g.  lines of code added/changed/removed etc.) portrayed in a different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by the overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added GitHub metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ GitHub API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119959</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119959"/>
		<updated>2018-11-14T03:30:44Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Current Scenario */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like Github. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows peer review amongst teammates. Currently, however, there is no way to validate and verify these reviews.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119958</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119958"/>
		<updated>2018-11-14T03:23:48Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give a more realistic view of the work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like Github. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. 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.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
As number of commits and LOCs(lines of code) will keep of changing and stale data does not seem to be of significant benefit for analysis, we will be concentrating on latest state of project repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119955</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119955"/>
		<updated>2018-11-14T03:19:47Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like Github. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119953</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119953"/>
		<updated>2018-11-14T03:18:48Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submissions''' functionality provides a list of submissions of all the teams for a particular assignment. We can add a new column to show work distribution within the whole team using external tools like Github. A new column will display this information using line-graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''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.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119951</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119951"/>
		<updated>2018-11-14T03:12:29Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Detail Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Design Detail'''===&lt;br /&gt;
&lt;br /&gt;
===='''First Change'''====&lt;br /&gt;
&lt;br /&gt;
====='''Approach 1'''=====&lt;br /&gt;
&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
====='''Approach 2'''=====&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
===='''Second Change'''====&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119950</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119950"/>
		<updated>2018-11-14T03:08:30Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119948</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119948"/>
		<updated>2018-11-14T02:51:58Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
====='''Use Case Diagram Details'''=====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
==='''Database Design'''===&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119945</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119945"/>
		<updated>2018-11-14T02:48:55Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Use case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
===='''Use case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119943</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119943"/>
		<updated>2018-11-14T02:38:19Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Current Scenario */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
===='''Use case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119942</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119942"/>
		<updated>2018-11-14T02:37:51Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Current Scenario */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
===='''Use case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119941</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119941"/>
		<updated>2018-11-14T02:37:37Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Current Scenario */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done by the team as a whole. This does not show work contribution per teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. Currently, however, there is no way to back those review up. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is a solution, but that is inefficient from instructor/reviews perspective considering the large number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
===='''Use case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119939</id>
		<title>CSC/ECE 517 Fall 2018- Project E1858. Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration&amp;diff=119939"/>
		<updated>2018-11-14T02:32:14Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
&lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution Design'''==&lt;br /&gt;
==='''Design Considerations'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
==='''Plan of action'''===&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
===='''Use case Diagram'''====&lt;br /&gt;
[[File:Ssdtusecasemerge.png|none|frame|Use Case diagram of two approaches to append 'Github contribution metric' in teammate review. ==]]&lt;br /&gt;
[[File:Ssdtusecase323.png|none|frame|Use Case diagram explaining approach to add new column 'Github contribution metric' in 'View submission ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
===='''Use Case Diagram Details'''====&lt;br /&gt;
'''Actors:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
*Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
'''Database:'''&lt;br /&gt;
&lt;br /&gt;
*The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
'''Pre Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
*The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
'''Primary Sequence:'''&lt;br /&gt;
&lt;br /&gt;
*The student should login.&lt;br /&gt;
&lt;br /&gt;
*The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
*The student should submit teammate-reviews.&lt;br /&gt;
&lt;br /&gt;
'''Post Conditions:'''&lt;br /&gt;
&lt;br /&gt;
*Instructor will be able see team contribution done by each team member in 'View Submission' page using graph diagrams, as shown in figure.&lt;br /&gt;
*Instructor will be able see work done by each student in 'Teammate Review Tab' with new matric appended at the end, as shown in figure.&lt;br /&gt;
&lt;br /&gt;
==='''Design Principles'''===&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==='''Detail Design'''===&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtviewscore.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
[[File:Ssdtviewsub.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtfinalss11.png|none|frame|caption]]&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications, as we doing our research around exporting data using API's and displaying.&lt;br /&gt;
As number of commits and number of line changing will keep of changing and stale data does not seem of significant benefit for future analysis, we are concentrating more on fetching current data repositories.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119659</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119659"/>
		<updated>2018-11-13T06:42:36Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Current Scenario'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119658</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119658"/>
		<updated>2018-11-13T06:41:52Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''View Submissions''' and '''Teammate Reviews''' (under View Scores) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119653</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119653"/>
		<updated>2018-11-13T06:28:42Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Plan of action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119652</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119652"/>
		<updated>2018-11-13T06:28:29Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119647</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119647"/>
		<updated>2018-11-13T06:25:35Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
&lt;br /&gt;
'''Subtask 1: Github metrics in teammate reviews'''&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 1:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Github metrics&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) View data based on different Github metrics (e.g.  lines of code added/changed/removed etc.) for each teammate&lt;br /&gt;
&lt;br /&gt;
'''Test plan for proposed solution 2:'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View scores&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team for which you wish to view scores&lt;br /&gt;
&lt;br /&gt;
5) Go to &amp;quot;Teammate reviews&amp;quot; tab&lt;br /&gt;
&lt;br /&gt;
6) Select the student for whom you wish to view teammate review&lt;br /&gt;
&lt;br /&gt;
7) Below the usual criteria, view criteria for different Github metrics (e.g.  lines of code added/changed/removed etc.) portrayed in different color scheme (light blue)&lt;br /&gt;
&lt;br /&gt;
'''Subtask 2: Line chart for # of lines changed by overall team'''&lt;br /&gt;
&lt;br /&gt;
1) Log in as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to assignments through Manage --&amp;gt; Assignments&lt;br /&gt;
&lt;br /&gt;
3) Select &amp;quot;View submissions&amp;quot; icon for the assignment of your choice&lt;br /&gt;
&lt;br /&gt;
4) Select the team whose submissions you wish to view&lt;br /&gt;
&lt;br /&gt;
5) A newly added Github metrics column is added to show # of lines changed since the start of the assignment&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/Main_Page Expertiza_wiki]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader E1815:_Improvements_to_review_grader]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1179 Expertiza_PR_1179]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=HHdta64VHcY Expertiza_PR_1179_Video]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/v3/ Github API documentation]&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119642</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119642"/>
		<updated>2018-11-13T06:23:58Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase12.png|none|caption&lt;br /&gt;
File:Ssdtusecase22.png|none|caption&lt;br /&gt;
File:Ssdtusecase32.png|none|caption&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader&lt;br /&gt;
&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/1179&lt;br /&gt;
&lt;br /&gt;
https://www.youtube.com/watch?v=HHdta64VHcY&lt;br /&gt;
&lt;br /&gt;
https://developer.github.com/v3/&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119638</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119638"/>
		<updated>2018-11-13T06:20:05Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdtusecase12.png|none|caption]]&lt;br /&gt;
[[File:Ssdtusecase22.png|none|caption]]&lt;br /&gt;
[[File:Ssdtusecase32.png|none|caption]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119636</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119636"/>
		<updated>2018-11-13T06:17:22Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase1.png|none|frame|image3&lt;br /&gt;
File:Ssdtusecase2.png|none|frame|image2&lt;br /&gt;
File:Ssdtusecase3.png|none|frame|image1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively). We intend to follow the same when implementing out end-point for pulling Github data.&lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119635</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119635"/>
		<updated>2018-11-13T06:14:54Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase1.png|none|frame|image3&lt;br /&gt;
File:Ssdtusecase2.png|none|frame|image2&lt;br /&gt;
File:Ssdtusecase3.png|none|frame|image1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119634</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119634"/>
		<updated>2018-11-13T06:14:39Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Use case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Use case Diagram'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase1.png|none|frame|image3&lt;br /&gt;
File:Ssdtusecase2.png|none|frame|image2&lt;br /&gt;
File:Ssdtusecase3.png|none|frame|image1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119633</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119633"/>
		<updated>2018-11-13T06:14:15Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdtusecase1.png|none|frame|image3&lt;br /&gt;
File:Ssdtusecase2.png|none|frame|image2&lt;br /&gt;
File:Ssdtusecase3.png|none|frame|image1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119624</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119624"/>
		<updated>2018-11-13T05:54:16Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Ssdt_usecase1.png|Item 1&lt;br /&gt;
File:Ssdt_usecase2.png|a link to [[Help:Contents]]&lt;br /&gt;
File:Ssdt_usecase3.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119621</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119621"/>
		<updated>2018-11-13T05:51:19Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|none|frame|&lt;br /&gt;
== At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate. ==&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_123.png|none|frame|&lt;br /&gt;
== Teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews. ==&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* With respect to showing Github metrics in the View scores page, it will be very difficult to map Expertiza users and their names to public Github profiles as students may use different name. So instead of appending Github data to Teammate reivews table, it would be easier to just add a new tab called &amp;quot;Github Metrics&amp;quot; and show the results there. &lt;br /&gt;
&lt;br /&gt;
* The instructors will need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Cases==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119618</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119618"/>
		<updated>2018-11-13T05:43:15Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
*At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_12.png|border]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Also teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|border]]&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
:We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
:The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
:A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* The instructors need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Cases==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119617</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119617"/>
		<updated>2018-11-13T05:40:38Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Design Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
*At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_12.png|border]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Also teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png|border]]&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
   We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
   The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
   A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* The instructors need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Cases==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119612</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119612"/>
		<updated>2018-11-13T05:37:18Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_12.png]]&lt;br /&gt;
&lt;br /&gt;
Also teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png]]&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* The instructors need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Cases==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119610</id>
		<title>E1858 Github metrics integration</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1858_Github_metrics_integration&amp;diff=119610"/>
		<updated>2018-11-13T05:37:06Z</updated>

		<summary type="html">&lt;p&gt;Sbhoyar: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction'''==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Expertiza provides '''view submission''' and '''teammate review''' (under view score) functionality for each assignment.&lt;br /&gt;
Purpose of this project is to augment existing assignment submissions with data that can give more realistic view on work contribution of every team member using external tools like Github.&lt;br /&gt;
This external data may include: number of commits, number of lines of code modified, number of lines added, number of lines deleted from each group’s submitted repository link from Github. &lt;br /&gt;
&lt;br /&gt;
:1. '''View submission''' provides list of submission of all the teams for that particular assignment. We can add new column to show work distribution among the whole team from external tools like Github. This new column will provide work distribution on whole team using bar graphs and other statistics.&lt;br /&gt;
&lt;br /&gt;
:2. '''Teammate Reviews''' functionality gauges team mates views on how much each team member contributed, but we would like to augment this data with data from external tools like Github. New metrics will be appended under each student data.&lt;br /&gt;
for example,  &lt;br /&gt;
This information should prove useful for differentiating the performance of team members for grading purposes. Overall data for the team, like number of committers and number of commits may also help instructors to predict which projects are likely to be merged.&lt;br /&gt;
&lt;br /&gt;
=='''Overall Description==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
&lt;br /&gt;
At present, group assignments are submitted as a single submission that shows work done as a whole team. This does not show work contribution done by each teammate.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_12.png]]&lt;br /&gt;
&lt;br /&gt;
Also teammate review shows views of each teammate on every other teammates work. That might leads to discrepancy while validating the reviews.&lt;br /&gt;
&lt;br /&gt;
[[File:Ssdt_22.png]]&lt;br /&gt;
&lt;br /&gt;
Checking commits performed by each team member on Github is one of the solution, but that does not seems efficient from instructor/reviews perspective considering huge number of assignments, number of submissions and tight deadlines.&lt;br /&gt;
&lt;br /&gt;
=='''Design Considerations'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to determine what metrics we are looking for exactly. These are what the requirements document suggests:&lt;br /&gt;
*# Total number of commits.&lt;br /&gt;
*# Number of files changed.&lt;br /&gt;
*# Lines of Code added&lt;br /&gt;
*# Lines of code modified.&lt;br /&gt;
*# Lines of code deleted.&lt;br /&gt;
*# LOCs that survived until final submission - (exclude from MVP due to complexity and lower priority).&lt;br /&gt;
&lt;br /&gt;
We are assuming these metrics are needed on a per-user basis.&lt;br /&gt;
	&lt;br /&gt;
The requirement document expects a view to be created for viewing the metrics under a new tab “Github Metrics” under “View Submissions” in the instructor view.&lt;br /&gt;
A line chart of number of lines vs time needs to be included in the view.&lt;br /&gt;
&lt;br /&gt;
* The next thing is to narrow down what hosting service for version control we will use. For now, the plan is to only support Github integration due to it popularity, ease-of-use and API documentation. Future projects could add in support for Gitlab and others, though it is far easier to just require that all students use Github.&lt;br /&gt;
*# The main impact of this change will be that all submission repositories need to be made public as we need access to pull in the data.&lt;br /&gt;
*# We also need to consider whether to ask students for github repo link separately(changes to views) or to parse all the uploaded links and determine the correct one (extra logic, students uploading multiple links or not giving links at all).&lt;br /&gt;
&lt;br /&gt;
* An important question is whether we need to store metric information in our own db at all. &lt;br /&gt;
*# An older investigation came up with this schema, but this is likely to cause issues with stale information and will be difficult to maintain.&lt;br /&gt;
*# Having a db is redundant as every time a user wants to see the metrics, we would need to sync the db with Github and then show the results. So we end up hitting Github api anyway.&lt;br /&gt;
*# An alternative to the above approach is to take snapshots of metrics and store them in the db right on the submission deadline of projects. This will allow for fairer grading by making sure we pull in data at the correct moment. Unfortunately, doing this for so many projects could put a lot of load on server. Also, for open source projects this would mean that we don’t have the latest data to work with(people will keep committing past deadline). Thus, this approach might be good for grading purposes but doesn’t help with determining the current status of a project.&lt;br /&gt;
*# All that said, we might need to maintain some meta-data in our db- investigation pending.&lt;br /&gt;
&lt;br /&gt;
* We also need to consider if we need to account for different branches. The initial plan is to only consider the master branch.&lt;br /&gt;
&lt;br /&gt;
* A suggestion was also to make sure that there isn’t a lot of padding in the tables we show.&lt;br /&gt;
&lt;br /&gt;
* The instructors need to spell out exact guidelines for committing to the projects repos(like everyone should commit their own code, keep the master as PR branch, commit regularly, be mindful of squashing too many commits for one user), so that we can have proper and correct data and, also so that students can’t weasel their way out later claiming they worked but forgot or didn’t know.&lt;br /&gt;
&lt;br /&gt;
=='''Plan of action'''==&lt;br /&gt;
&lt;br /&gt;
* The first thing is to investigate if there are any rails gems(Octokit/Unicorn maybe?) to get Github data and if we are allowed to use them. The idea is to always get the latest data from Github and show it to the user. For grading purposes, we could alternate a view between latest data and data till submission deadlines.&lt;br /&gt;
* If there are no such gems or if we aren’t allowed to use gems, we need to write to mock endpoints to understand out how to get data from github. There is [https://developer.github.com/v3/ ample] documentation for this. The github api returns JSON which can be easily parsed.&lt;br /&gt;
* We then need to figure out how to load this data(AJAX? or gem?) when instructor selects “Github Rubrics”(if we do this) or &amp;quot;Teammate Review&amp;quot; in the View Scores page. Similar data needs to be loaded in the View Submissions page.&lt;br /&gt;
* We will need a mock up view to display this data in a table.&lt;br /&gt;
* We then implement the view. For charting, suggestion is to use a previous project for charting- [https://www.youtube.com/watch?v=HHdta64VHcY 1] [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2018_E1815:_Improvements_to_review_grader 2] [https://github.com/expertiza/expertiza/pull/1179 3].&lt;br /&gt;
&lt;br /&gt;
=='''Application Flow'''==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Use case Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:E1799_design_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Actors:&lt;br /&gt;
&lt;br /&gt;
:Instructor: This actor is responsible for creating assignments and adding students to the assignment. &lt;br /&gt;
&lt;br /&gt;
:Student: This actor is responsible for submitting, self-reviewing and viewing the scores.&lt;br /&gt;
&lt;br /&gt;
Database:&lt;br /&gt;
&lt;br /&gt;
:The database where all the data of Expertiza is getting stored.&lt;br /&gt;
&lt;br /&gt;
All the other use cases are implemented except “View Scores with self-review column and composite score”&lt;br /&gt;
&lt;br /&gt;
Use Case: View score with self-review column and composite score&lt;br /&gt;
&lt;br /&gt;
Pre Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The Student should submit the assignment and self-review.&lt;br /&gt;
&lt;br /&gt;
2.The other students should submit the reviews of the work submitted.&lt;br /&gt;
&lt;br /&gt;
Primary Sequence:&lt;br /&gt;
&lt;br /&gt;
1.The student should login.&lt;br /&gt;
&lt;br /&gt;
2.The student should browse and upload the assignment.&lt;br /&gt;
&lt;br /&gt;
3.The student should submit the assignment.&lt;br /&gt;
&lt;br /&gt;
4.The student should submit the self-review.&lt;br /&gt;
&lt;br /&gt;
5.The student should choose your scores to view the score.&lt;br /&gt;
&lt;br /&gt;
6.The student should be able to see the peer-review score with the self-review scores and composite score. &lt;br /&gt;
&lt;br /&gt;
Post Conditions:&lt;br /&gt;
&lt;br /&gt;
1.The self-review and composite score will be visible on the page.&lt;br /&gt;
&lt;br /&gt;
=='''Database Design==&lt;br /&gt;
&lt;br /&gt;
1.As of now, we do not have plans for database modifications.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
&lt;br /&gt;
* MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&lt;br /&gt;
* Dry Principle – We are trying to reuse the existing functionalities in Expertiza,thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
* Strategy design pattern –&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=='''Proposed solutions'''==&lt;br /&gt;
* The first change would would be under the &amp;quot;Teammate Review&amp;quot; tab in the &amp;quot;View Scores&amp;quot; page. We either add new rows to the table, one for each of the Github metrics, and display the results for every student in the project as mocked up here: &lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
Or we might add a new tab called &amp;quot;Github Metrics&amp;quot; in the View scores page and then show the metrics and the results in tabular format as mocked up:&lt;br /&gt;
&lt;br /&gt;
[[File:x.png]]&lt;br /&gt;
&lt;br /&gt;
* The second change is in the View Submissions page, where we intend to add a new column to the table that shows a chart per assignment team. This chart will show proportion of contributions per team member.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
&lt;br /&gt;
The last column has the self review scores. The composite score is calculated and is displayed at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:proper view.png]]&lt;br /&gt;
&lt;br /&gt;
The composite score is displayed beside the average peer review score.&lt;br /&gt;
&lt;br /&gt;
[[File:alternate_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Cases==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|Test case ID&lt;br /&gt;
|Test Objective&lt;br /&gt;
|PreConditions&lt;br /&gt;
|Steps&lt;br /&gt;
|Test Data&lt;br /&gt;
|Expected Result&lt;br /&gt;
|Post Conditions&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_1&lt;br /&gt;
|Successfully displaying self review scores in the heat map view&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The self review column is displayed together with the other peer reviews in the end.&lt;br /&gt;
|The student is able to see the self review column.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_2&lt;br /&gt;
|Successfully calculating the proper composite score.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The score of the self review should be present in the database.&lt;br /&gt;
&lt;br /&gt;
3. The function is implemented to calculate the composite score using average of the peer reviews and the self review.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is returned by the method.&lt;br /&gt;
|The method is able to return the expected composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_3&lt;br /&gt;
|Successfully displaying of composite score in the heat map view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to view scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the heat map view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|E1799_Test_Case_4&lt;br /&gt;
|Successfully displaying of composite score in alternate view.&lt;br /&gt;
|1. The student should do the self review.&lt;br /&gt;
2. The scores of the self review should be present in the database.&lt;br /&gt;
|1. Login to the Expertiza Application.&lt;br /&gt;
2. Submit the assignment created by the instructor by browsing it.&lt;br /&gt;
&lt;br /&gt;
3. Choose the self review option and complete the self review.&lt;br /&gt;
&lt;br /&gt;
4. Go to alternate scores option.&lt;br /&gt;
|Submit the relevant assignment before doing the self review.&lt;br /&gt;
|The composite score is displayed in the alternate scores view.&lt;br /&gt;
|The student is able to see the composite score.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References==&lt;br /&gt;
&lt;br /&gt;
http://wiki.expertiza.ncsu.edu/index.php/Main_Page&lt;/div&gt;</summary>
		<author><name>Sbhoyar</name></author>
	</entry>
</feed>