<?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=Arisboo</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=Arisboo"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Arisboo"/>
	<updated>2026-09-29T09:10:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117542</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117542"/>
		<updated>2018-09-02T23:33:44Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.jpg|left]]&lt;br /&gt;
The client folder mainly consists of assets, components and redux folders.&lt;br /&gt;
&lt;br /&gt;
== Redux-Folder ==&lt;br /&gt;
&lt;br /&gt;
The Redux folder further has actions, reducers, ActionTypes and configureStore.&lt;br /&gt;
   - configureStore- this file is the configuration file for the redux store, the &lt;br /&gt;
                     combineReducers middle ware is applied to assemble all the &lt;br /&gt;
                     different elements of the redux reducers defined in the reducers &lt;br /&gt;
                     folder.&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117541</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117541"/>
		<updated>2018-09-02T23:27:40Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.jpg|left]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117540</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117540"/>
		<updated>2018-09-02T23:27:26Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.jpg]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117539</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117539"/>
		<updated>2018-09-02T23:27:16Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.png]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117538</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117538"/>
		<updated>2018-09-02T23:26:09Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.png|200px|thumb|left|alt text]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117537</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117537"/>
		<updated>2018-09-02T23:25:51Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.jpg|200px|thumb|left|alt text]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117536</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117536"/>
		<updated>2018-09-02T23:24:39Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.jpg|200px|thumb|left|alt text]]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Clientfiles.jpg&amp;diff=117535</id>
		<title>File:Clientfiles.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Clientfiles.jpg&amp;diff=117535"/>
		<updated>2018-09-02T23:23:56Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Clientfiles.png&amp;diff=117534</id>
		<title>File:Clientfiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Clientfiles.png&amp;diff=117534"/>
		<updated>2018-09-02T23:16:09Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117533</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117533"/>
		<updated>2018-09-02T23:15:52Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''File Structure''' ==&lt;br /&gt;
[[File:Clientfiles.png|left]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117532</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117532"/>
		<updated>2018-09-02T23:05:51Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117531</id>
		<title>ReactJs Frontend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=ReactJs_Frontend&amp;diff=117531"/>
		<updated>2018-09-02T23:05:27Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: Created page with &amp;quot;'''Background''' This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-pa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Background'''&lt;br /&gt;
This project discusses the new front-end client built on ReactJs framework and Javascipt ES6, the web client uses Redux for state management and Axios(a third-part promise based HTTP client) for interacting with the database.&lt;br /&gt;
The application currently supports all student side interactions of Expertiza and this writeup discusses the file structure, procedures and guidelines used in the design and implementation of the client application.&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=117530</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=117530"/>
		<updated>2018-09-02T22:49:11Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
* [[Expertiza documentation]]&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Summer 2008]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2010]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2011]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2012]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2013]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2017]]&lt;br /&gt;
* [[CSC/Independent Study Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018]]&lt;br /&gt;
* [[CSC 456 Spring 2011|CSC 456 Spring 2012]]&lt;br /&gt;
* [[ECE 633]]&lt;br /&gt;
* [[KCU]]&lt;br /&gt;
* [[Progress reports]]&lt;br /&gt;
* [[ReactJs Frontend]]&lt;br /&gt;
==Application Behavior==&lt;br /&gt;
* [[Grading]]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
* [[CSC/ECE_517_Spring_2013/ch1b_1k_hf|Lecture on Metaprogramming]]&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
''Expertiza now has a Java dependency, so the machine you are using to develop Expertiza on should have the JVM installed.''&lt;br /&gt;
&lt;br /&gt;
* [[Setting Up a Development Machine]]&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
* [[Using git and github for projects]]&lt;br /&gt;
* [[Using heroku to deploy your projects]]&lt;br /&gt;
* [[How to Begin a Project from the Current Expertiza Repository]]&lt;br /&gt;
* [[Git]]&lt;br /&gt;
* [[How to Change a User's Password on a Development Machine]]&lt;br /&gt;
* [[Debugging Rails]]&lt;br /&gt;
* [http://rajanalwan.com/ui_guidelines/ Design Template]&lt;br /&gt;
&lt;br /&gt;
==Production==&lt;br /&gt;
* [[Deploying to Production]]&lt;br /&gt;
* [[Downloading Production Data]]&lt;br /&gt;
* [[Accessing the Production Server]]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
* [[Using Cucumber with Expertiza]]&lt;br /&gt;
* [[Rails Testing Overview]]&lt;br /&gt;
* [[Expertiza Continuous Integration]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [[Object-Oriented Design and Programming]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116274</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116274"/>
		<updated>2018-04-08T17:14:30Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Issue 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
There are some issues with the current review report page with regards to the Metrics column.&lt;br /&gt;
:*Metrics are displayed as plain text.&lt;br /&gt;
:*No comparison on how this student compares with other students.&lt;br /&gt;
:*If more metrics are added, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
Showing a bar chart for the metric rather than just text would improve the user experience. The bar chart can also depict the average for all students for this metric, so the grader can see how this student compares with other students. Also, if several metrics are shown in the column, the bar chart can be made resizable to accommodate multiple bars.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG|center]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:reviewee.PNG|center]]&lt;br /&gt;
&lt;br /&gt;
===Issue 3: Adding color schemes to identify update to reviews as per submissions===&lt;br /&gt;
&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
[[File:Colorscheme.PNG]]&lt;br /&gt;
&lt;br /&gt;
This is what the current color scheme looks like. The text in blue indicates that the student has not been graded, while the text in red indicates the student should not be given credits.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
We plan on replacing the text given in the Metrics column with a bar chart, similar to the one shown below. The bar chart will depict the overall average of all students for this metric, the average of this student for this metric (based on each round) and the metric values for each round for this student. The bar chart can be made resizable to accommodate more metrics that maybe added.&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_chart.jpeg|center]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
We will start of by adding a title to the review summary, this summary will have the information about the reviewer. &lt;br /&gt;
we will span the question text to all three columns instead of it being one, also the width of the first column containing the reviewee information will be reduced appropriately.&lt;br /&gt;
Checkbox questions could be displayed more compactly by showing the question on the left, and then having separate column rather a than separate row for all the reviews. If the reviewer had checked a box for a particular review, the box would be checked, otherwise not.&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) Check if the visualizations are appearing in the review report.&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updates and Review Summary View ===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) In the review report click on the “summary” in the row for any student.&lt;br /&gt;
&lt;br /&gt;
5) Check if the changes are appearing in the page as mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
===Issue 3: Adding Color Schemes to Identify Updates to Review As Per Submission===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116265</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116265"/>
		<updated>2018-04-08T16:57:21Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Issue 2: Updating Review Summary view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
In the current review report page, the metrics are displayed as plain text. There is also no details about how this student compares with the average student on the selected metric. &lt;br /&gt;
Showing a bar chart for the metric rather than just text would improve the user experience. The bar chart can also depict the average for all students for this metric, so the grader can see how this student compares with other students. Also, if several metrics are shown in the column, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:reviewee.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
=='''Adding color schemes to identify update to reviews as per submissions'''==&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
[[File:Colorscheme.PNG]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
We plan on replacing the text given in the Metrics column with a bar chart, similar to the one shown below. The bar chart will depict the overall average of all students for this metric, the average of this student for this metric (based on each round) and the metric values for each round for this student.&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_chart.jpeg|center]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2===&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) Check if the visualizations are appearing in the review report.&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updates and Review Summary View ===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) In the review report click on the “summary” in the row for any student.&lt;br /&gt;
&lt;br /&gt;
5) Check if the changes are appearing in the page as mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
===Issue 3: Adding Color Schemes to Identify Updates to Review As Per Submission===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116259</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116259"/>
		<updated>2018-04-08T16:54:25Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Issue 2: Updating Review Summary view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
In the current review report page, the metrics are displayed as plain text. There is also no details about how this student compares with the average student on the selected metric. &lt;br /&gt;
Showing a bar chart for the metric rather than just text would improve the user experience. The bar chart can also depict the average for all students for this metric, so the grader can see how this student compares with other students. Also, if several metrics are shown in the column, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:reviewee.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
=='''Adding color schemes to identify update to reviews as per submissions'''==&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_chart.jpeg]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2===&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Report===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) Check if the visualizations are appearing in the review report.&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updates and Review Summary View ===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) In the review report click on the “summary” in the row for any student.&lt;br /&gt;
&lt;br /&gt;
5) Check if the changes are appearing in the page as mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
===Issue 3: Adding Color Schemes to Identify Updates to Review As Per Submission===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116258</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116258"/>
		<updated>2018-04-08T16:54:04Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Issue 2: Updating Review Summary view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
In the current review report page, the metrics are displayed as plain text. There is also no details about how this student compares with the average student on the selected metric. &lt;br /&gt;
Showing a bar chart for the metric rather than just text would improve the user experience. The bar chart can also depict the average for all students for this metric, so the grader can see how this student compares with other students. Also, if several metrics are shown in the column, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:File.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
=='''Adding color schemes to identify update to reviews as per submissions'''==&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_chart.jpeg]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2===&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Report===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) Check if the visualizations are appearing in the review report.&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updates and Review Summary View ===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
4) In the review report click on the “summary” in the row for any student.&lt;br /&gt;
&lt;br /&gt;
5) Check if the changes are appearing in the page as mentioned in the proposed solution.&lt;br /&gt;
&lt;br /&gt;
===Issue 3: Adding Color Schemes to Identify Updates to Review As Per Submission===&lt;br /&gt;
&lt;br /&gt;
1) Login as an instructor&lt;br /&gt;
&lt;br /&gt;
2) Navigate to review grader by doing this (Manage &amp;gt; Assignments)&lt;br /&gt;
&lt;br /&gt;
3) Click on the “View review report” icon (the one with the spyglass and two people)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewee.PNG&amp;diff=116256</id>
		<title>File:Reviewee.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewee.PNG&amp;diff=116256"/>
		<updated>2018-04-08T16:53:07Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: Issue2 screenshot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Issue2 screenshot&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116250</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116250"/>
		<updated>2018-04-08T16:41:14Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Updating Review Summary view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
In the current review report page, the metrics are displayed as plain text. Showing a bar chart for the metric rather than just text would make grading easier. Also, if several metrics are shown in the column, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Issue 2: Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
=='''Adding color schemes to identify update to reviews as per submissions'''==&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
== '''UML Diagram''' ==&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Issue 2===&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116248</id>
		<title>CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1815:_Improvements_to_review_grader&amp;diff=116248"/>
		<updated>2018-04-08T16:40:48Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Issue 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
This project aims to enhance the review report and summary page, and display more information necessary for grading. The goal is to help the instructors by making the process of grading reviews easier and more accurate.&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
In the current review report page, the metrics are displayed as plain text. Showing a bar chart for the metric rather than just text would make grading easier. Also, if several metrics are shown in the column, showing multiple lines of text for each metric can make the column cluttered and difficult to read.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: e1815_issue1.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Updating Review Summary view===&lt;br /&gt;
&lt;br /&gt;
To view this page you click the summary in the row for any student.&lt;br /&gt;
&lt;br /&gt;
This page summarizes the peer Reviews given to the Author. They are basically separated into three columns i.e reviewee, score and comments. &lt;br /&gt;
     &lt;br /&gt;
#The first issue in this view is that there is no header saying what course, assignment, or student this relates to.&lt;br /&gt;
#Secondly, The field that lists the team members is wider than the rest of the columns combined. The comments column needs more space it will contain more information&lt;br /&gt;
#Finally, For questions answered with check-boxes, comments are not necessary, but still a blank cell is displayed.&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
=='''Adding color schemes to identify update to reviews as per submissions'''==&lt;br /&gt;
Currently, in review report, each team reviewed is color coded as, red indicating that the review is not yet completed and blue indicating that the review grade is not assigned or updated. So if an instructor sees a name in red, the student should not be given credit for the review.  If text is in blue, then the student has not been graded for the review, so the instructor should grade it now. But there is caveat here. If the reviewer has reviewed the work but the author did not resubmit, the reviewer has nothing new to review in the latest round and should not be downgraded for not re-reviewing the work. This issue needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
== '''UML Diagram''' ==&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions''' ==&lt;br /&gt;
&lt;br /&gt;
===Issue 1: Visualization of Metrics in Review Reports===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Issue 2===&lt;br /&gt;
&lt;br /&gt;
===Issue 3===&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=116227</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=116227"/>
		<updated>2018-04-08T15:36:35Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
* [[Expertiza documentation]]&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Summer 2008]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2010]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2011]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2012]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2013]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project Juniper:Bookmark Enhancements]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1803: Introducing a Student View for Instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management]]&lt;br /&gt;
* [[CSC/ECE_517_Spring_2018- Project E1805: Convolutional data extraction from Github]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1808: Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1810: Show sample submissions and reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018/E1814 Write unit tests for collusion cycle.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project M1802: 2D Canvas Rendering]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018 - E1800: Add past-due assignments to task list]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project M1803: Implement a web page buzzer to find rendering mismatches ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018/E1813 Test Menu Items Model]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1816: Visualization for Instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1817: Adding Student-generated Questions to Rubric]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1822: Extend the functionality of badging]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018- Project E1815: Improvements to review grader]]&lt;br /&gt;
* [[CSC 456 Spring 2011|CSC 456 Spring 2012]]&lt;br /&gt;
* [[ECE 633]]&lt;br /&gt;
* [[KCU]]&lt;br /&gt;
* [[Progress reports]]&lt;br /&gt;
&lt;br /&gt;
==Application Behavior==&lt;br /&gt;
* [[Grading]]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
* [[CSC/ECE_517_Spring_2013/ch1b_1k_hf|Lecture on Metaprogramming]]&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
''Expertiza now has a Java dependency, so the machine you are using to develop Expertiza on should have the JVM installed.''&lt;br /&gt;
&lt;br /&gt;
* [[Setting Up a Development Machine]]&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
* [[Using git and github for projects]]&lt;br /&gt;
* [[Using heroku to deploy your projects]]&lt;br /&gt;
* [[How to Begin a Project from the Current Expertiza Repository]]&lt;br /&gt;
* [[Git]]&lt;br /&gt;
* [[How to Change a User's Password on a Development Machine]]&lt;br /&gt;
* [[Debugging Rails]]&lt;br /&gt;
* [http://rajanalwan.com/ui_guidelines/ Design Template]&lt;br /&gt;
&lt;br /&gt;
==Production==&lt;br /&gt;
* [[Deploying to Production]]&lt;br /&gt;
* [[Downloading Production Data]]&lt;br /&gt;
* [[Accessing the Production Server]]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
* [[Using Cucumber with Expertiza]]&lt;br /&gt;
* [[Rails Testing Overview]]&lt;br /&gt;
* [[Expertiza Continuous Integration]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [[Object-Oriented Design and Programming]]&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115731</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115731"/>
		<updated>2018-04-03T00:28:21Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Created/Modified Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it &lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
  1. scores(question) function returned scores which was being considered as recursive calls and thus we changed the return variable to score which is being modified in the functions.&lt;br /&gt;
  2. score_team[:scores] = Answer.compute_scores(assessments, questions[:review]) line in the scores was changed to score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    this was done because the compute scores function in Answers was throwing an error while trying to deference the index of questions using a symbol.&lt;br /&gt;
  3. grades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions[round_sym]) to rades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    same reason as above.&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
Below is most of the code used in the test case. It is relatively simple.  The first test case is for when assignments vary by rubrics.  We check that the function returns {}.  This is correct because we set reviewer to nil so that reviewer will be set to {} in the &amp;quot;reviewer = {} if reviewer.nil?&amp;quot; statement.  In the second test case we check that it returns {1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}}.  This is correct because we create 2 response maps and set their value to 50 and 30.  &lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment varys rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     allow(assignment).to receive(:varying_rubrics_by_round?).and_return(TRUE)&lt;br /&gt;
     allow(assignment).to receive(:rounds_of_reviews).and_return(1)&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment does not vary rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
This function calculates the average score and score range for each reviewee(team).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def compute_avg_and_ranges_hash&lt;br /&gt;
    scores = {}&lt;br /&gt;
    contributors = self.contributors # assignment_teams&lt;br /&gt;
    if self.varying_rubrics_by_round?&lt;br /&gt;
      rounds = self.rounds_of_reviews&lt;br /&gt;
      (1..rounds).each do |round|&lt;br /&gt;
        review_questionnaire_id = review_questionnaire_id(round)&lt;br /&gt;
        questions = Question.where('questionnaire_id = ?', review_questionnaire_id)&lt;br /&gt;
        contributors.each do |contributor|&lt;br /&gt;
          assessments = ReviewResponseMap.get_assessments_for(contributor)&lt;br /&gt;
          assessments = assessments.select {|assessment| assessment.round == round }&lt;br /&gt;
          scores[contributor.id] = {} if round == 1&lt;br /&gt;
          scores[contributor.id][round] = {}&lt;br /&gt;
          scores[contributor.id][round] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      review_questionnaire_id = review_questionnaire_id()&lt;br /&gt;
      questions = Question.where('questionnaire_id = ?', review_questionnaire_id)&lt;br /&gt;
      contributors.each do |contributor|&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(contributor)&lt;br /&gt;
        scores[contributor.id] = {}&lt;br /&gt;
        scores[contributor.id] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    scores&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method calls a lot of private methods to calculate a score hash. To test this method we had to mock calls made in these private methods.&lt;br /&gt;
&lt;br /&gt;
When ''varying_rubrics_by_round?'' is true this method calls       &lt;br /&gt;
        1. calculate_rounds&lt;br /&gt;
&lt;br /&gt;
        2. calculate_score&lt;br /&gt;
&lt;br /&gt;
        3. calculate_assessment&lt;br /&gt;
&lt;br /&gt;
we mocked the call to 1. so it is not covered in our coverage as it just initializes our hashes.&lt;br /&gt;
&lt;br /&gt;
to mock the call to 2. and 3. calls such as the ones given below can be seen in our test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow(on_the_fly_calc).to receive(:index).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:num_review_rounds).and_return([1,2])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:team).and_return(double('AssignmentTeam'))&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:get_responses_for_team_round).with(any_args).and_return([])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:questions).and_return(questions)&lt;br /&gt;
         allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:round_sym).and_return(:review1)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:grades_by_rounds).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:score_assignment).and_return('')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we are basically mocking calls to run through all lines of the methods and only calls that is returning something or are assigning value to a variable need to be mocked.&lt;br /&gt;
&lt;br /&gt;
for example the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is to mock the call made to ''compute_score'' function in the ''Answer'' class we made it to return an empty hash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when current assignment varys rubrics by round and number of assessments is 0.in this case&lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
     allow(on_the_fly_calc).to receive(:total_num_of_assessments).and_return(0)&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
   this call is made to mask the value of total_num_of_assessments value, similarly for others.&lt;br /&gt;
&lt;br /&gt;
2. when current assignment varys rubrics by round and number of assessments is non-zero.&lt;br /&gt;
&lt;br /&gt;
3. when current assignment does not vary rubrics by round&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.&lt;br /&gt;
&lt;br /&gt;
[[File:on_the_fly_test_results.png]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115729</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115729"/>
		<updated>2018-04-03T00:27:59Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Created/Modified Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
  1. scores(question) function returned scores which was being considered as recursive calls and thus we changed the return variable to score which is being modified in the functions.&lt;br /&gt;
&lt;br /&gt;
  2. score_team[:scores] = Answer.compute_scores(assessments, questions[:review]) line in the scores was changed to score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    this was done because the compute scores function in Answers was throwing an error while trying to deference the index of questions using a symbol.&lt;br /&gt;
  3. grades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions[round_sym]) to rades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    same reason as above.&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
Below is most of the code used in the test case. It is relatively simple.  The first test case is for when assignments vary by rubrics.  We check that the function returns {}.  This is correct because we set reviewer to nil so that reviewer will be set to {} in the &amp;quot;reviewer = {} if reviewer.nil?&amp;quot; statement.  In the second test case we check that it returns {1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}}.  This is correct because we create 2 response maps and set their value to 50 and 30.  &lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment varys rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     allow(assignment).to receive(:varying_rubrics_by_round?).and_return(TRUE)&lt;br /&gt;
     allow(assignment).to receive(:rounds_of_reviews).and_return(1)&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment does not vary rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method calls a lot of private methods to calculate a score hash. To test this method we had to mock calls made in these private methods.&lt;br /&gt;
&lt;br /&gt;
When ''varying_rubrics_by_round?'' is true this method calls       &lt;br /&gt;
        1. calculate_rounds&lt;br /&gt;
&lt;br /&gt;
        2. calculate_score&lt;br /&gt;
&lt;br /&gt;
        3. calculate_assessment&lt;br /&gt;
&lt;br /&gt;
we mocked the call to 1. so it is not covered in our coverage as it just initializes our hashes.&lt;br /&gt;
&lt;br /&gt;
to mock the call to 2. and 3. calls such as the ones given below can be seen in our test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow(on_the_fly_calc).to receive(:index).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:num_review_rounds).and_return([1,2])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:team).and_return(double('AssignmentTeam'))&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:get_responses_for_team_round).with(any_args).and_return([])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:questions).and_return(questions)&lt;br /&gt;
         allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:round_sym).and_return(:review1)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:grades_by_rounds).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:score_assignment).and_return('')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we are basically mocking calls to run through all lines of the methods and only calls that is returning something or are assigning value to a variable need to be mocked.&lt;br /&gt;
&lt;br /&gt;
for example the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is to mock the call made to ''compute_score'' function in the ''Answer'' class we made it to return an empty hash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when current assignment varys rubrics by round and number of assessments is 0.in this case&lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
     allow(on_the_fly_calc).to receive(:total_num_of_assessments).and_return(0)&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
   this call is made to mask the value of total_num_of_assessments value, similarly for others.&lt;br /&gt;
&lt;br /&gt;
2. when current assignment varys rubrics by round and number of assessments is non-zero.&lt;br /&gt;
&lt;br /&gt;
3. when current assignment does not vary rubrics by round&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.&lt;br /&gt;
&lt;br /&gt;
[[File:on_the_fly_test_results.png]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115728</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115728"/>
		<updated>2018-04-03T00:27:41Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Created/Modified Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
  - scores(question) function returned scores which was being considered as recursive calls and thus we changed the return variable to score which is being modified in the functions.&lt;br /&gt;
&lt;br /&gt;
  - score_team[:scores] = Answer.compute_scores(assessments, questions[:review]) line in the scores was changed to score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    this was done because the compute scores function in Answers was throwing an error while trying to deference the index of questions using a symbol.&lt;br /&gt;
  - grades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions[round_sym]) to rades_by_rounds[round_sym] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
    same reason as above.&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
Below is most of the code used in the test case. It is relatively simple.  The first test case is for when assignments vary by rubrics.  We check that the function returns {}.  This is correct because we set reviewer to nil so that reviewer will be set to {} in the &amp;quot;reviewer = {} if reviewer.nil?&amp;quot; statement.  In the second test case we check that it returns {1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}}.  This is correct because we create 2 response maps and set their value to 50 and 30.  &lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment varys rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     allow(assignment).to receive(:varying_rubrics_by_round?).and_return(TRUE)&lt;br /&gt;
     allow(assignment).to receive(:rounds_of_reviews).and_return(1)&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment does not vary rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method calls a lot of private methods to calculate a score hash. To test this method we had to mock calls made in these private methods.&lt;br /&gt;
&lt;br /&gt;
When ''varying_rubrics_by_round?'' is true this method calls       &lt;br /&gt;
        1. calculate_rounds&lt;br /&gt;
&lt;br /&gt;
        2. calculate_score&lt;br /&gt;
&lt;br /&gt;
        3. calculate_assessment&lt;br /&gt;
&lt;br /&gt;
we mocked the call to 1. so it is not covered in our coverage as it just initializes our hashes.&lt;br /&gt;
&lt;br /&gt;
to mock the call to 2. and 3. calls such as the ones given below can be seen in our test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow(on_the_fly_calc).to receive(:index).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:num_review_rounds).and_return([1,2])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:team).and_return(double('AssignmentTeam'))&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:get_responses_for_team_round).with(any_args).and_return([])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:questions).and_return(questions)&lt;br /&gt;
         allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:round_sym).and_return(:review1)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:grades_by_rounds).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:score_assignment).and_return('')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we are basically mocking calls to run through all lines of the methods and only calls that is returning something or are assigning value to a variable need to be mocked.&lt;br /&gt;
&lt;br /&gt;
for example the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is to mock the call made to ''compute_score'' function in the ''Answer'' class we made it to return an empty hash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when current assignment varys rubrics by round and number of assessments is 0.in this case&lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
     allow(on_the_fly_calc).to receive(:total_num_of_assessments).and_return(0)&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
   this call is made to mask the value of total_num_of_assessments value, similarly for others.&lt;br /&gt;
&lt;br /&gt;
2. when current assignment varys rubrics by round and number of assessments is non-zero.&lt;br /&gt;
&lt;br /&gt;
3. when current assignment does not vary rubrics by round&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.&lt;br /&gt;
&lt;br /&gt;
[[File:on_the_fly_test_results.png]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115712</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115712"/>
		<updated>2018-04-03T00:16:08Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: scores */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
Below is most of the code used in the test case. It is relatively simple.  The first test case is for when assignments vary by rubrics.  We check that the function returns {}.  This is correct because we set reviewer to nil so that reviewer will be set to {} in the &amp;quot;reviewer = {} if reviewer.nil?&amp;quot; statement.  In the second test case we check that it returns {1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}}.  This is correct because we create 2 response maps and set their value to 50 and 30.  &lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment varys rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     allow(assignment).to receive(:varying_rubrics_by_round?).and_return(TRUE)&lt;br /&gt;
     allow(assignment).to receive(:rounds_of_reviews).and_return(1)&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment does not vary rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method calls a lot of private methods to calculate a score hash. To test this method we had to mock calls made in these private methods.&lt;br /&gt;
&lt;br /&gt;
When ''varying_rubrics_by_round?'' is true this method calls       &lt;br /&gt;
        1. calculate_rounds&lt;br /&gt;
&lt;br /&gt;
        2. calculate_score&lt;br /&gt;
&lt;br /&gt;
        3. calculate_assessment&lt;br /&gt;
&lt;br /&gt;
we mocked the call to 1. so it is not covered in our coverage as it just initializes our hashes.&lt;br /&gt;
&lt;br /&gt;
to mock the call to 2. and 3. calls such as the ones given below can be seen in our test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow(on_the_fly_calc).to receive(:index).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:num_review_rounds).and_return([1,2])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:team).and_return(double('AssignmentTeam'))&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:get_responses_for_team_round).with(any_args).and_return([])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:questions).and_return(questions)&lt;br /&gt;
         allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:round_sym).and_return(:review1)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:grades_by_rounds).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:score_assignment).and_return('')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we are basically mocking calls to run through all lines of the methods and only calls that is returning something or are assigning value to a variable need to be mocked.&lt;br /&gt;
&lt;br /&gt;
for example the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is to mock the call made to ''compute_score'' function in the ''Answer'' class we made it to return an empty hash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when current assignment varys rubrics by round and number of assessments is 0.in this case&lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
     allow(on_the_fly_calc).to receive(:total_num_of_assessments).and_return(0)&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
   this call is made to mask the value of total_num_of_assessments value, similarly for others.&lt;br /&gt;
&lt;br /&gt;
2. when current assignment varys rubrics by round and number of assessments is non-zero.&lt;br /&gt;
&lt;br /&gt;
3. when current assignment does not vary rubrics by round&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.&lt;br /&gt;
&lt;br /&gt;
[[File:ONTHEFLYTESTRESULTS.png]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115708</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115708"/>
		<updated>2018-04-03T00:15:19Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
Below is most of the code used in the test case. It is relatively simple.  The first test case is for when assignments vary by rubrics.  We check that the function returns {}.  This is correct because we set reviewer to nil so that reviewer will be set to {} in the &amp;quot;reviewer = {} if reviewer.nil?&amp;quot; statement.  In the second test case we check that it returns {1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}}.  This is correct because we create 2 response maps and set their value to 50 and 30.  &lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment varys rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     allow(assignment).to receive(:varying_rubrics_by_round?).and_return(TRUE)&lt;br /&gt;
     allow(assignment).to receive(:rounds_of_reviews).and_return(1)&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 context 'when current assignment does not vary rubrics by round' do&lt;br /&gt;
   it 'scores varying rubrics and returns review scores' do&lt;br /&gt;
     temp = assignment.compute_reviews_hash()&lt;br /&gt;
     expect(temp).to eql({1=&amp;gt;{1=&amp;gt;50}, 2=&amp;gt;{1=&amp;gt;30}})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method calls a lot of private methods to calculate a score hash. To test this method we had to mock calls made in these private methods.&lt;br /&gt;
&lt;br /&gt;
When ''varying_rubrics_by_round?'' is true this method calls       &lt;br /&gt;
        1. calculate_rounds&lt;br /&gt;
&lt;br /&gt;
        2. calculate_score&lt;br /&gt;
&lt;br /&gt;
        3. calculate_assessment&lt;br /&gt;
&lt;br /&gt;
we mocked the call to 1. so it is not covered in our coverage as it just initializes our hashes.&lt;br /&gt;
&lt;br /&gt;
to mock the call to 2. and 3. calls such as the ones given below can be seen in our test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow(on_the_fly_calc).to receive(:index).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:num_review_rounds).and_return([1,2])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:team).and_return(double('AssignmentTeam'))&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:get_responses_for_team_round).with(any_args).and_return([])&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:questions).and_return(questions)&lt;br /&gt;
         allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:round_sym).and_return(:review1)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:grades_by_rounds).and_return(0)&lt;br /&gt;
         allow(on_the_fly_calc).to receive(:score_assignment).and_return('')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we are basically mocking calls to run through all lines of the methods and only calls that is returning something or are assigning value to a variable need to be mocked.&lt;br /&gt;
&lt;br /&gt;
for example the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        allow(Answer).to receive(:compute_scores).with([],[question1]).and_return({})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is to mock the call made to ''compute_score'' function in the ''Answer'' class we made it to return an empty hash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when current assignment varys rubrics by round and number of assessments is 0.&lt;br /&gt;
   in this case&lt;br /&gt;
  &amp;lt;pre&amp;gt;&lt;br /&gt;
     allow(on_the_fly_calc).to receive(:total_num_of_assessments).and_return(0)&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&lt;br /&gt;
   this call is made to mask the value of total_num_of_assessments value, similarly for others.&lt;br /&gt;
&lt;br /&gt;
2. when current assignment varys rubrics by round and number of assessments is non-zero.&lt;br /&gt;
&lt;br /&gt;
3. when current assignment does not vary rubrics by round&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://photos.app.goo.gl/DbstVzVJWSCt73tB2]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115671</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115671"/>
		<updated>2018-04-03T00:01:07Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: scores */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115670</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115670"/>
		<updated>2018-04-03T00:00:55Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: scores */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def scores(questions)&lt;br /&gt;
    index = 0&lt;br /&gt;
    score_assignment&lt;br /&gt;
    self.teams.each do |team|&lt;br /&gt;
      score_team = {}&lt;br /&gt;
      score_team[:team] = team&lt;br /&gt;
      if self.varying_rubrics_by_round?&lt;br /&gt;
        calculate_rounds&lt;br /&gt;
        calculate_score&lt;br /&gt;
        calculate_assessment&lt;br /&gt;
      else&lt;br /&gt;
        assessments = ReviewResponseMap.get_assessments_for(team)&lt;br /&gt;
        score_team[:scores] = Answer.compute_scores(assessments, questions)&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
    score&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115667</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115667"/>
		<updated>2018-04-02T23:56:39Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115666</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115666"/>
		<updated>2018-04-02T23:55:56Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115665</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115665"/>
		<updated>2018-04-02T23:55:43Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115664</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115664"/>
		<updated>2018-04-02T23:55:05Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cases for consideration :'''&lt;br /&gt;
1. when avg score equals nil&lt;br /&gt;
2. when avg score is not equal to nil&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115663</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115663"/>
		<updated>2018-04-02T23:53:31Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Cases'''''Italic text''cases for consideration&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115662</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115662"/>
		<updated>2018-04-02T23:52:50Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
similarly, other calls made to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  self.assignment_questionnaires.find_by(assignment_id: assignment.id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
was mocked using calls that look like :- &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  allow(ReviewQuestionnaire).to receive_message_chain(:assignment_questionnaires,:find_by).with(no_args).with(assignment_id: 1).and_return(double('AssignmentQuestionnaire', id: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115655</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115655"/>
		<updated>2018-04-02T23:49:39Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec line which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115652</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115652"/>
		<updated>2018-04-02T23:47:48Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
The function compute total score totals the scores of each questionnaire in an assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''To test this function'' &lt;br /&gt;
&lt;br /&gt;
we mocked the calls made in the Questionnaire class.&lt;br /&gt;
for example to mock the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  round = AssignmentQuestionnaire.find_by(assignment_id: assignment.id, questionnaire_id: self.id).used_in_round&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we used the rspec thingy which looks like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: nil).and_return(double('AssignmentQuestionnaire', used_in_round: 1))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
We have a 92.74% coverage.  &lt;br /&gt;
Below is a picture of the results from the coverage.  &lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115643</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115643"/>
		<updated>2018-04-02T23:42:39Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Function: compute_total_score */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def compute_total_score(scores)&lt;br /&gt;
    total = 0&lt;br /&gt;
    self.questionnaires.each {|questionnaire| total += questionnaire.get_weighted_score(self, scores) }&lt;br /&gt;
    total&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
The following fragment is the coverage result of our unit tests.&lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115638</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115638"/>
		<updated>2018-04-02T23:40:21Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
The following fragment is the coverage result of our unit tests.&lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115637</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115637"/>
		<updated>2018-04-02T23:39:55Z</updated>

		<summary type="html">&lt;p&gt;Arisboo: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1812: Unit tests for on_the_fly_calc.rb==&lt;br /&gt;
&lt;br /&gt;
This wiki page gives a description of changes made under Expertiza OSS project E1812 assignment for Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
===NOTE to reviewers===&lt;br /&gt;
&lt;br /&gt;
''' This documentation is still under implementation'''&lt;br /&gt;
&lt;br /&gt;
Mocks and stubs are used for the unit tests so they can't be tested by UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Expertiza Background==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source web application developed with [http://rubyonrails.org/ Ruby on Rails] framework. This application allows students to access assignments posted by an instructor, submit their work (articles, codes, websites), review others work submissions. Expertiza gives a chance to improve students’ work based on their peer-reviews, and it can also help in grading students’ submissions based on that feedback. Students can form their teams for an assignment, otherwise, teams can be assigned automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The OnTheFlyCalc model does not have any test cases corresponding to it. Thus, the task of this assignment is to write unit tests for on_the_fly_calc.rb using RSpec. The test cases should be fast, effective, and achieve the maximum code coverage, i.e. &amp;gt; 90%.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== OnTheFlyCalc ===&lt;br /&gt;
&lt;br /&gt;
On_the_fly_calc is a module that is included in assignment.rb. This module calculates the score for both students and instructors. E.g., when a student clicks “view my score”, Expertiza calculates the review scores for each review. This is called “on the fly” because expertiza stores the review scores based on each question (in answers table), but does not store the total score that a reviewer gives to a reviewee. It directly calculates the total review score for each review, using the score values in the answer table during run-time. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=== Created/Modified Files ===&lt;br /&gt;
As a part of the project the file listed below was created and saved under spec/models folder:&lt;br /&gt;
*on_the_fly_calc_spec.rb &lt;br /&gt;
&lt;br /&gt;
The file listed below was modified due to some code issues in it:&lt;br /&gt;
*on_the_fly_calc.rb (path: app/models)&lt;br /&gt;
&lt;br /&gt;
=== Thoughts ===&lt;br /&gt;
What we need to do is to write tests for four public methods listed in the module OnTheFLyCalc. However, the on_the_fly_calc itself has some code issues in #scores, and IDE reports some errors when we run the test case for it. Thus, we need to modify the module itself a little.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
===RSpec ===&lt;br /&gt;
For this project we use [https://en.wikipedia.org/wiki/RSpec RSpec] which is a testing tool for Ruby, created for [https://en.wikipedia.org/wiki/Behavior-driven_development behavior-driven development] (BDD).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Plan of Work ==&lt;br /&gt;
In order to accomplish this task, that is to build tests for the OnTheFlyCalc model, we need to implement the following plan:&lt;br /&gt;
&lt;br /&gt;
1. Set up the Expertiza environment;&lt;br /&gt;
&lt;br /&gt;
2. Understand the functionality of the model;&lt;br /&gt;
&lt;br /&gt;
3. Understand the relative methods and objects involved with each function of the model;&lt;br /&gt;
&lt;br /&gt;
4. Create test objects; &lt;br /&gt;
&lt;br /&gt;
5. Write ‘it block’ test scenarios with appropriate contexts for all public functions of the model, and check if all [https://relishapp.com/rspec/rspec-expectations/docs expectations ] pass.&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Expertiza Environment''' &lt;br /&gt;
&lt;br /&gt;
We installed VM VirtualBox, and imported Ubuntu-Expertiza image into VirtualBox. In Git, Expertiza master brunch was forked, in the VM terminal we cloned it and then run all required commands to finish setting up the environment. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Listed below are the functions in on_the_fly_calc.rb and the RSpec unit tests corresponding to the function names along with a list of scenarios tested.&lt;br /&gt;
&lt;br /&gt;
===Function: compute_total_score===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_reviews_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: compute_avg_and_ranges_hash===&lt;br /&gt;
&lt;br /&gt;
===Function: scores===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Running RSpec===&lt;br /&gt;
*To run RSpec for a particular file (on_the_fly_calc_spec.rb):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rspec spec/models/on_the_fly_calc_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Coverage Results===&lt;br /&gt;
&lt;br /&gt;
The following fragment is the coverage result of our unit tests.&lt;br /&gt;
 &lt;br /&gt;
[[to be added]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. [https://en.wikipedia.org/wiki/RSpec RSpec Wiki] &amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://rspec.info/ RSpec.info] &amp;lt;br&amp;gt;&lt;br /&gt;
3. [https://www.youtube.com/watch?v=dzkVfaKChSU&amp;amp;feature=youtu.be&amp;amp;t=35s youtube.com TDD: RSpec Test Structure] &amp;lt;br&amp;gt;&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/blob/3ce553a2d0258ea05bced910abae5d209a7f55d6/spec/models/response_spec.rb github/expertiza response_spec example] &amp;lt;br&amp;gt;&lt;br /&gt;
5. [https://relishapp.com/rspec RSpec Documentation] &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arisboo</name></author>
	</entry>
</feed>