<?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=Snparab</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=Snparab"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Snparab"/>
	<updated>2026-05-18T17:46:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142738</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142738"/>
		<updated>2021-12-08T19:37:10Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Video Link */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
&lt;br /&gt;
These methods had no tests before our project was done.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The output of the controller is the list of answer tags in JSON format. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and index operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and create_edit operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for index&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any answer for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by student if no updated value is provided for the answer tag.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/Xc7SpMhwUyc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://youtu.be/Xc7SpMhwUyc OSS Final Project Testing Video]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142737</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142737"/>
		<updated>2021-12-08T19:36:57Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
&lt;br /&gt;
These methods had no tests before our project was done.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The output of the controller is the list of answer tags in JSON format. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and index operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and create_edit operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for index&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any answer for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by student if no updated value is provided for the answer tag.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/Xc7SpMhwUyc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://youtu.be/Xc7SpMhwUyc]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142736</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142736"/>
		<updated>2021-12-08T19:36:36Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Video Link */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
&lt;br /&gt;
These methods had no tests before our project was done.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The output of the controller is the list of answer tags in JSON format. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and index operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and create_edit operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for index&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any answer for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by student if no updated value is provided for the answer tag.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/WYSUmL6jcHc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://youtu.be/Xc7SpMhwUyc]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142292</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142292"/>
		<updated>2021-11-30T03:54:35Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Controller: answer_tags_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and index operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and create_edit operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for index&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any answer for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by student if no updated value is provided for the answer tag.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/WYSUmL6jcHc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://www.youtube.com/watch?v=WYSUmL6jcHc]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142290</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142290"/>
		<updated>2021-11-30T03:53:49Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Controller: answer_tags_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and index operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and create_edit operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for index&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied for create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any answer for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by the student if no mapping is found related to any tag_prompt_deployment for that tag (foreign key constraint).&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; Restricts updating answer tag by student if no updated value is provided for the answer tag.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/WYSUmL6jcHc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://www.youtube.com/watch?v=WYSUmL6jcHc]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142284</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142284"/>
		<updated>2021-11-30T03:47:30Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/WYSUmL6jcHc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142282</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142282"/>
		<updated>2021-11-30T03:45:15Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Collaborators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140343</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140343"/>
		<updated>2021-11-01T21:20:17Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Controller: answer_tags_controller.rb&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139842</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139842"/>
		<updated>2021-10-21T03:41:14Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/expertiza/expertiza/blob/beta/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. action_allowed? - This is the first action that takes place when user tries to access the popup. This checks whether the current user is authorized to view the pop up. The action is allowed for all users except the student. &lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#action_allowed?' do&lt;br /&gt;
    context 'when user does not have right privilege, it denies action' do&lt;br /&gt;
      it 'for no user' do; expect(controller.send(:action_allowed?)).to be false; end&lt;br /&gt;
      it 'for student' do&lt;br /&gt;
        stub_current_user(student, student.role.name, student.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when role has right privilege, it allows action' do&lt;br /&gt;
      it 'for Super Admin' do&lt;br /&gt;
        stub_current_user(superadmin, superadmin.role.name, superadmin.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for Admin' do&lt;br /&gt;
        stub_current_user(admin, admin.role.name, admin.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for Instructor' do&lt;br /&gt;
        stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for TA' do&lt;br /&gt;
        stub_current_user(ta, ta.role.name, ta.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. author_feedback_popup - This action can be called from response_report by clicking on Student names from Instructor's end.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#author_feedback_popup' do&lt;br /&gt;
    context 'when response_id does not exist' do&lt;br /&gt;
      it 'fail to get any info' do; expect(controller.send(:author_feedback_popup)).to be nil; end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when response_id exists' do&lt;br /&gt;
      it 'passes tests in first block' do        &lt;br /&gt;
        allow(Question).to receive_message_chain(:find, :questionnaire_id).with(answer.question_id).with(no_args).and_return(questionnaire.id)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).with(questionnaire.id).and_return(questionnaire)&lt;br /&gt;
        allow(questionnaire).to receive(:max_question_score).and_return(20)&lt;br /&gt;
        allow(Answer).to receive(:where).with(any_args).and_return([answer]) &lt;br /&gt;
        allow(Response).to receive(:find).with(any_args).and_return(response) &lt;br /&gt;
        allow(response).to receive(:average_score).and_return(16)  &lt;br /&gt;
        allow(response).to receive(:aggregate_questionnaire_score).and_return(20)&lt;br /&gt;
        allow(response).to receive(:maximum_score).and_return(19)&lt;br /&gt;
        allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
        allow(User).to receive(:find).with(participant.user_id).and_return(participant)&lt;br /&gt;
&lt;br /&gt;
        params = {response_id: 1, reviewee_id: 1}&lt;br /&gt;
        session = {user: ta}&lt;br /&gt;
        result = get :author_feedback_popup, params, session&lt;br /&gt;
        expect(result.status).to eq 200&lt;br /&gt;
        expect(controller.instance_variable_get(:@sum)).to eq 20&lt;br /&gt;
        expect(controller.instance_variable_get(:@total_possible)).to eq 19&lt;br /&gt;
        expect(controller.instance_variable_get(:@total_percentage)).to eq 16&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id, &lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
sum&lt;br /&gt;
team&lt;br /&gt;
assignment&lt;br /&gt;
team_users&lt;br /&gt;
reviewer_id&lt;br /&gt;
similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
team,&lt;br /&gt;
team_users,&lt;br /&gt;
ip,&lt;br /&gt;
assignment,&lt;br /&gt;
reviewer_id,&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#team_users_popup' do&lt;br /&gt;
    ## INSERT CONTEXT/DESCRIPTION/CODE HERE&lt;br /&gt;
    it &amp;quot;renders the page successfuly as Instructor&amp;quot; do&lt;br /&gt;
      allow(Team).to receive(:find).and_return(team)&lt;br /&gt;
      allow(Assignment).to receive(:find).and_return(assignment)&lt;br /&gt;
&lt;br /&gt;
      reviewer = double(:reviewer1, reviewer_id: 1)&lt;br /&gt;
      user_id = double(:user_id, user_id: 1)&lt;br /&gt;
      response = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
      answer = double('answer', question_id: 1)&lt;br /&gt;
&lt;br /&gt;
      allow(ResponseMap).to receive(:find).with(1).and_return(reviewer)&lt;br /&gt;
      allow(Participant).to receive(:find).with(1).and_return(user_id)&lt;br /&gt;
      allow(Response).to receive_message_chain(:where, :last).with(map_id: 1, round: 1).with(no_args).and_return(response)&lt;br /&gt;
      allow(Answer).to receive(:where).with(response_id: 1).and_return(answer)&lt;br /&gt;
      allow(Response).to receive_message_chain(:average_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:aggregate_questionnaire_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:maximum_score).with(no_args).and_return(response)&lt;br /&gt;
      &lt;br /&gt;
      params = {id: team.id}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      result = get :team_users_popup, params, session&lt;br /&gt;
      expect(result.status).to eq 200&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id,&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
review_final_versions.questionnaire_id,&lt;br /&gt;
review_final_versions.response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
If Reviewer_id is null,&lt;br /&gt;
If Assignment_id is null,&lt;br /&gt;
Assignment.vary_by_topic true - Provide Flash error,&lt;br /&gt;
Assignment.vary_by_topic false - Does not provide Flash error,&lt;br /&gt;
review_final_versions - Has the structure as expected by the rendering view page&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#view_review_scores_popup'do&lt;br /&gt;
    context 'review tone analysis operation is performed' do&lt;br /&gt;
      it 'Prepares scores and review analysis report for rendering purpose' do&lt;br /&gt;
        allow(Assignment).to receive(:find).and_return(assignment)&lt;br /&gt;
        allow(Participant).to receive(:find).and_return(participant)&lt;br /&gt;
        params = {reviewer_id: participant.id, assignment_id: assignment.id}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        result = get :view_review_scores_popup, params, session&lt;br /&gt;
        expect(controller.instance_variable_get(:@review_final_versions)).to eq final_versions&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#self_review_popup' do&lt;br /&gt;
    context &amp;quot;when current user is the participant&amp;quot; do&lt;br /&gt;
      it &amp;quot;render page successfully as Instructor to get maximum_score &amp;quot; do&lt;br /&gt;
        question1 = double(:question1, questionnaire_id: 1)&lt;br /&gt;
        questionnaire1 = double(:questionnaire1, min_question_score: 1, max_question_score: 3, name: 'Test questionnaire')&lt;br /&gt;
        answer1 = double('Answer', question_id: 1)&lt;br /&gt;
        response1 = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
        allow(Answer).to receive_message_chain(:where, :first).with(response_id: 1).with(no_args).and_return(answer1)&lt;br /&gt;
        allow(Question).to receive(:find).with(1).and_return(question1)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).and_return(questionnaire1)&lt;br /&gt;
        allow(Answer).to receive(:where).with(&amp;quot;1&amp;quot;).and_return(answer1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :average_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :aggregate_questionnaire_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :maximum_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        params = {response_id: 1, user_fullname: questionnaire1.name}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        get :self_review_popup, params, session&lt;br /&gt;
        expect(@response).to have_http_status(200)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 75.59%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://youtu.be/hUpoXL2gfcI here]&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
There were 6 modules in the controller for which we wrote unit tests following behavior driven approach. We did not consider any edge cases for now therefore there is scope to further improve the testing coverage to reach 100%.&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139608</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139608"/>
		<updated>2021-10-21T00:55:07Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/expertiza/expertiza/blob/beta/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#self_review_popup' do&lt;br /&gt;
    context &amp;quot;when current user is the participant&amp;quot; do&lt;br /&gt;
      it &amp;quot;render page successfully as Instructor to get maximum_score &amp;quot; do&lt;br /&gt;
        question1 = double(:question1, questionnaire_id: 1)&lt;br /&gt;
        questionnaire1 = double(:questionnaire1, min_question_score: 1, max_question_score: 3, name: 'Test questionnaire')&lt;br /&gt;
        answer1 = double('Answer', question_id: 1)&lt;br /&gt;
        response1 = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
        allow(Answer).to receive_message_chain(:where, :first).with(response_id: 1).with(no_args).and_return(answer1)&lt;br /&gt;
        allow(Question).to receive(:find).with(1).and_return(question1)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).and_return(questionnaire1)&lt;br /&gt;
        allow(Answer).to receive(:where).with(&amp;quot;1&amp;quot;).and_return(answer1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :average_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :aggregate_questionnaire_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :maximum_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        params = {response_id: 1, user_fullname: questionnaire1.name}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        get :self_review_popup, params, session&lt;br /&gt;
        expect(@response).to have_http_status(200)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id, &lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
sum&lt;br /&gt;
team&lt;br /&gt;
assignment&lt;br /&gt;
team_users&lt;br /&gt;
reviewer_id&lt;br /&gt;
similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
team,&lt;br /&gt;
team_users,&lt;br /&gt;
ip,&lt;br /&gt;
assignment,&lt;br /&gt;
reviewer_id,&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#team_users_popup' do&lt;br /&gt;
    ## INSERT CONTEXT/DESCRIPTION/CODE HERE&lt;br /&gt;
    it &amp;quot;renders the page successfuly as Instructor&amp;quot; do&lt;br /&gt;
      allow(Team).to receive(:find).and_return(team)&lt;br /&gt;
      allow(Assignment).to receive(:find).and_return(assignment)&lt;br /&gt;
&lt;br /&gt;
      reviewer = double(:reviewer1, reviewer_id: 1)&lt;br /&gt;
      user_id = double(:user_id, user_id: 1)&lt;br /&gt;
      response = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
      answer = double('answer', question_id: 1)&lt;br /&gt;
&lt;br /&gt;
      allow(ResponseMap).to receive(:find).with(1).and_return(reviewer)&lt;br /&gt;
      allow(Participant).to receive(:find).with(1).and_return(user_id)&lt;br /&gt;
      allow(Response).to receive_message_chain(:where, :last).with(map_id: 1, round: 1).with(no_args).and_return(response)&lt;br /&gt;
      allow(Answer).to receive(:where).with(response_id: 1).and_return(answer)&lt;br /&gt;
      allow(Response).to receive_message_chain(:average_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:aggregate_questionnaire_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:maximum_score).with(no_args).and_return(response)&lt;br /&gt;
      &lt;br /&gt;
      params = {id: team.id}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      result = get :team_users_popup, params, session&lt;br /&gt;
      expect(result.status).to eq 200&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id,&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
review_final_versions.questionnaire_id,&lt;br /&gt;
review_final_versions.response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
If Reviewer_id is null,&lt;br /&gt;
If Assignment_id is null,&lt;br /&gt;
Assignment.vary_by_topic true - Provide Flash error,&lt;br /&gt;
Assignment.vary_by_topic false - Does not provide Flash error,&lt;br /&gt;
review_final_versions - Has the structure as expected by the rendering view page&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#view_review_scores_popup'do&lt;br /&gt;
    context 'review tone analysis operation is performed' do&lt;br /&gt;
      it 'Prepares scores and review analysis report for rendering purpose' do&lt;br /&gt;
        allow(Assignment).to receive(:find).and_return(assignment)&lt;br /&gt;
        allow(Participant).to receive(:find).and_return(participant)&lt;br /&gt;
        params = {reviewer_id: participant.id, assignment_id: assignment.id}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        result = get :view_review_scores_popup, params, session&lt;br /&gt;
        expect(controller.instance_variable_get(:@review_final_versions)).to eq final_versions&lt;br /&gt;
      end&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;
4. action_allowed? - This checks whether the user in current session is even authorized to access the pop up. The action is allowed for all users except the student. &lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#action_allowed?' do&lt;br /&gt;
    context 'when user does not have right privilege, it denies action' do&lt;br /&gt;
      it 'for no user' do; expect(controller.send(:action_allowed?)).to be false; end&lt;br /&gt;
      it 'for student' do&lt;br /&gt;
        stub_current_user(student, student.role.name, student.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be false&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when role has right privilege, it allows action' do&lt;br /&gt;
      it 'for Super Admin' do&lt;br /&gt;
        stub_current_user(superadmin, superadmin.role.name, superadmin.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for Admin' do&lt;br /&gt;
        stub_current_user(admin, admin.role.name, admin.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for Instructor' do&lt;br /&gt;
        stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
      it 'for TA' do&lt;br /&gt;
        stub_current_user(ta, ta.role.name, ta.role)&lt;br /&gt;
        expect(controller.send(:action_allowed?)).to be true&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139604</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139604"/>
		<updated>2021-10-21T00:54:18Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/expertiza/expertiza/blob/beta/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#self_review_popup' do&lt;br /&gt;
    context &amp;quot;when current user is the participant&amp;quot; do&lt;br /&gt;
      it &amp;quot;render page successfully as Instructor to get maximum_score &amp;quot; do&lt;br /&gt;
        question1 = double(:question1, questionnaire_id: 1)&lt;br /&gt;
        questionnaire1 = double(:questionnaire1, min_question_score: 1, max_question_score: 3, name: 'Test questionnaire')&lt;br /&gt;
        answer1 = double('Answer', question_id: 1)&lt;br /&gt;
        response1 = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
        allow(Answer).to receive_message_chain(:where, :first).with(response_id: 1).with(no_args).and_return(answer1)&lt;br /&gt;
        allow(Question).to receive(:find).with(1).and_return(question1)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).and_return(questionnaire1)&lt;br /&gt;
        allow(Answer).to receive(:where).with(&amp;quot;1&amp;quot;).and_return(answer1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :average_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :aggregate_questionnaire_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :maximum_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        params = {response_id: 1, user_fullname: questionnaire1.name}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        get :self_review_popup, params, session&lt;br /&gt;
        expect(@response).to have_http_status(200)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id, &lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
sum&lt;br /&gt;
team&lt;br /&gt;
assignment&lt;br /&gt;
team_users&lt;br /&gt;
reviewer_id&lt;br /&gt;
similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
team,&lt;br /&gt;
team_users,&lt;br /&gt;
ip,&lt;br /&gt;
assignment,&lt;br /&gt;
reviewer_id,&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#team_users_popup' do&lt;br /&gt;
    ## INSERT CONTEXT/DESCRIPTION/CODE HERE&lt;br /&gt;
    it &amp;quot;renders the page successfuly as Instructor&amp;quot; do&lt;br /&gt;
      allow(Team).to receive(:find).and_return(team)&lt;br /&gt;
      allow(Assignment).to receive(:find).and_return(assignment)&lt;br /&gt;
&lt;br /&gt;
      reviewer = double(:reviewer1, reviewer_id: 1)&lt;br /&gt;
      user_id = double(:user_id, user_id: 1)&lt;br /&gt;
      response = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
      answer = double('answer', question_id: 1)&lt;br /&gt;
&lt;br /&gt;
      allow(ResponseMap).to receive(:find).with(1).and_return(reviewer)&lt;br /&gt;
      allow(Participant).to receive(:find).with(1).and_return(user_id)&lt;br /&gt;
      allow(Response).to receive_message_chain(:where, :last).with(map_id: 1, round: 1).with(no_args).and_return(response)&lt;br /&gt;
      allow(Answer).to receive(:where).with(response_id: 1).and_return(answer)&lt;br /&gt;
      allow(Response).to receive_message_chain(:average_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:aggregate_questionnaire_score).with(no_args).and_return(response)&lt;br /&gt;
      allow(Response).to receive_message_chain(:maximum_score).with(no_args).and_return(response)&lt;br /&gt;
      &lt;br /&gt;
      params = {id: team.id}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      result = get :team_users_popup, params, session&lt;br /&gt;
      expect(result.status).to eq 200&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id,&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
review_final_versions.questionnaire_id,&lt;br /&gt;
review_final_versions.response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
If Reviewer_id is null,&lt;br /&gt;
If Assignment_id is null,&lt;br /&gt;
Assignment.vary_by_topic true - Provide Flash error,&lt;br /&gt;
Assignment.vary_by_topic false - Does not provide Flash error,&lt;br /&gt;
review_final_versions - Has the structure as expected by the rendering view page&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139602</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139602"/>
		<updated>2021-10-21T00:52:42Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/expertiza/expertiza/blob/beta/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#self_review_popup' do&lt;br /&gt;
    context &amp;quot;when current user is the participant&amp;quot; do&lt;br /&gt;
      it &amp;quot;render page successfully as Instructor to get maximum_score &amp;quot; do&lt;br /&gt;
        question1 = double(:question1, questionnaire_id: 1)&lt;br /&gt;
        questionnaire1 = double(:questionnaire1, min_question_score: 1, max_question_score: 3, name: 'Test questionnaire')&lt;br /&gt;
        answer1 = double('Answer', question_id: 1)&lt;br /&gt;
        response1 = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
        allow(Answer).to receive_message_chain(:where, :first).with(response_id: 1).with(no_args).and_return(answer1)&lt;br /&gt;
        allow(Question).to receive(:find).with(1).and_return(question1)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).and_return(questionnaire1)&lt;br /&gt;
        allow(Answer).to receive(:where).with(&amp;quot;1&amp;quot;).and_return(answer1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :average_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :aggregate_questionnaire_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :maximum_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        params = {response_id: 1, user_fullname: questionnaire1.name}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        get :self_review_popup, params, session&lt;br /&gt;
        expect(@response).to have_http_status(200)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id, &lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
sum&lt;br /&gt;
team&lt;br /&gt;
assignment&lt;br /&gt;
team_users&lt;br /&gt;
reviewer_id&lt;br /&gt;
similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
team,&lt;br /&gt;
team_users,&lt;br /&gt;
ip,&lt;br /&gt;
assignment,&lt;br /&gt;
reviewer_id,&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id,&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
review_final_versions,&lt;br /&gt;
review_final_versions.questionnaire_id,&lt;br /&gt;
review_final_versions.response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
If Reviewer_id is null,&lt;br /&gt;
If Assignment_id is null,&lt;br /&gt;
Assignment.vary_by_topic true - Provide Flash error,&lt;br /&gt;
Assignment.vary_by_topic false - Does not provide Flash error,&lt;br /&gt;
review_final_versions - Has the structure as expected by the rendering view page&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139586</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139586"/>
		<updated>2021-10-20T23:17:42Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#self_review_popup' do&lt;br /&gt;
    context &amp;quot;when current user is the participant&amp;quot; do&lt;br /&gt;
      it &amp;quot;render page successfully as Instructor to get maximum_score &amp;quot; do&lt;br /&gt;
        question1 = double(:question1, questionnaire_id: 1)&lt;br /&gt;
        questionnaire1 = double(:questionnaire1, min_question_score: 1, max_question_score: 3, name: 'Test questionnaire')&lt;br /&gt;
        answer1 = double('Answer', question_id: 1)&lt;br /&gt;
        response1 = double('response1', response_id: 1, responses: &amp;quot;this is test response&amp;quot;)&lt;br /&gt;
        allow(Answer).to receive_message_chain(:where, :first).with(response_id: 1).with(no_args).and_return(answer1)&lt;br /&gt;
        allow(Question).to receive(:find).with(1).and_return(question1)&lt;br /&gt;
        allow(Questionnaire).to receive(:find).and_return(questionnaire1)&lt;br /&gt;
        allow(Answer).to receive(:where).with(&amp;quot;1&amp;quot;).and_return(answer1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :average_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :aggregate_questionnaire_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        allow(Response).to receive_message_chain(:find, :maximum_score).with(&amp;quot;1&amp;quot;).with(no_args).and_return(response1)&lt;br /&gt;
        params = {response_id: 1, user_fullname: questionnaire1.name}&lt;br /&gt;
        session = {user: instructor}&lt;br /&gt;
        get :self_review_popup, params, session&lt;br /&gt;
        expect(@response).to have_http_status(200)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
team_users_popup&lt;br /&gt;
&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id&lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
@sum&lt;br /&gt;
@team&lt;br /&gt;
@assignment&lt;br /&gt;
@team_users&lt;br /&gt;
@reviewer_id&lt;br /&gt;
@similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@team&lt;br /&gt;
@team_users&lt;br /&gt;
@ip&lt;br /&gt;
@assignment&lt;br /&gt;
@reviewer_id&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139585</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139585"/>
		<updated>2021-10-20T23:16:25Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email, and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
describe '#reviewer_details_popup' do&lt;br /&gt;
    render_views&lt;br /&gt;
    it &amp;quot;render reviewer_details_popup page successfully&amp;quot; do&lt;br /&gt;
      participant = double(:participant, user_id: 1)&lt;br /&gt;
      user = double(:user, fullname: &amp;quot;Test User&amp;quot;, name: &amp;quot;Test&amp;quot;, email: &amp;quot;test@gmail.com&amp;quot;, handle: 1)&lt;br /&gt;
      allow(Participant).to receive(:find).with(&amp;quot;1&amp;quot;).and_return(participant)&lt;br /&gt;
      allow(User).to receive(:find).with(participant.user_id).and_return(user)&lt;br /&gt;
      params = {id: 1, assignment_id: 1}&lt;br /&gt;
      session = {user: instructor}&lt;br /&gt;
      get :reviewer_details_popup, params, session&lt;br /&gt;
      expect(@response).to have_http_status(200)&lt;br /&gt;
      expect(user.fullname).to eq(&amp;quot;Test User&amp;quot;)&lt;br /&gt;
      expect(user.name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
      expect(user.email).to eq(&amp;quot;test@gmail.com&amp;quot;)&lt;br /&gt;
      expect(user.handle).to eq(1)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
team_users_popup&lt;br /&gt;
&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id&lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
@sum&lt;br /&gt;
@team&lt;br /&gt;
@assignment&lt;br /&gt;
@team_users&lt;br /&gt;
@reviewer_id&lt;br /&gt;
@similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@team&lt;br /&gt;
@team_users&lt;br /&gt;
@ip&lt;br /&gt;
@assignment&lt;br /&gt;
@reviewer_id&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139580</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139580"/>
		<updated>2021-10-20T23:06:04Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
team_users_popup&lt;br /&gt;
&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id&lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
@sum&lt;br /&gt;
@team&lt;br /&gt;
@assignment&lt;br /&gt;
@team_users&lt;br /&gt;
@reviewer_id&lt;br /&gt;
@similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@team&lt;br /&gt;
@team_users&lt;br /&gt;
@ip&lt;br /&gt;
@assignment&lt;br /&gt;
@reviewer_id&lt;br /&gt;
response_round_ ,&lt;br /&gt;
response_id_round_ ,&lt;br /&gt;
scores_round_ ,&lt;br /&gt;
Max_score_round_ ,&lt;br /&gt;
Total_percentage_round_ ,&lt;br /&gt;
sum_round_ ,&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139579</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139579"/>
		<updated>2021-10-20T23:05:18Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
team_users_popup&lt;br /&gt;
&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id&lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
@sum&lt;br /&gt;
@team&lt;br /&gt;
@assignment&lt;br /&gt;
@team_users&lt;br /&gt;
@reviewer_id&lt;br /&gt;
@similar_assignments&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@team&lt;br /&gt;
@team_users&lt;br /&gt;
@ip&lt;br /&gt;
@assignment&lt;br /&gt;
@reviewer_id&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
response_round_&lt;br /&gt;
response_id_round_&lt;br /&gt;
scores_round_&lt;br /&gt;
Max_score_round_&lt;br /&gt;
Total_percentage_round_&lt;br /&gt;
sum_round_&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139578</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139578"/>
		<updated>2021-10-20T23:03:51Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
team_users_popup&lt;br /&gt;
&lt;br /&gt;
team_users_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
id&lt;br /&gt;
id2&lt;br /&gt;
&lt;br /&gt;
Responses:&lt;br /&gt;
@sum&lt;br /&gt;
@team&lt;br /&gt;
@assignment&lt;br /&gt;
@team_users&lt;br /&gt;
@reviewer_id&lt;br /&gt;
@similar_assignments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
response_round_&lt;br /&gt;
response_id_round_&lt;br /&gt;
scores_round_&lt;br /&gt;
max_score_round_&lt;br /&gt;
total_percentage_round_&lt;br /&gt;
sum_round_&lt;br /&gt;
total_possible_round_&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139575</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139575"/>
		<updated>2021-10-20T23:02:46Z</updated>

		<summary type="html">&lt;p&gt;Snparab: /* Test Frame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from the instructor's end. This action is responsible to fetch reviewer details: full name, user id, email and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. team_users_popup - This action can be called from _review_report by clicking the team reviewed link from the instructor's end. This action is responsible to fetch team details that have reviewed the assignment. details: team name, team users, max score round, total possible rounds, comments, etc.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. view_review_scores_popup- This action can be called from _review_report by clicking the summary link from the instructor's end. This action is responsible to fetch the details of the scores that have been received for the assignment which includes further details such as the course, assignment, questions, responses, the team responsible for the review, review summary, etc.&lt;br /&gt;
&lt;br /&gt;
Findings:&lt;br /&gt;
&lt;br /&gt;
View_review_scores_popup.html&lt;br /&gt;
&lt;br /&gt;
Params:&lt;br /&gt;
reviewer_id&lt;br /&gt;
Assignment_id&lt;br /&gt;
&lt;br /&gt;
Response:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
@reviews&lt;br /&gt;
&lt;br /&gt;
Used variables in HTML view:&lt;br /&gt;
@review_final_versions&lt;br /&gt;
keys&lt;br /&gt;
questionnaire_id&lt;br /&gt;
response_ids&lt;br /&gt;
&lt;br /&gt;
Test cases:&lt;br /&gt;
Reviewer_id is null&lt;br /&gt;
Assignment_id is null&lt;br /&gt;
Assignment.vary_by_topic true - correct results&lt;br /&gt;
Assignment.vary_by_topic false - correct results&lt;br /&gt;
@review_final_versions - has questionnaire_id&lt;br /&gt;
@review_final_versions - has response_ids&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139567</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139567"/>
		<updated>2021-10-20T22:48:42Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. self_review_popup - This action can be called from &amp;quot;response_report&amp;quot; by clicking reviewer names from the instructor's end.  In this action for the given response id maximum score is displayed. If the response id is nil maximum score is set to 5, i.e., if a question response is not reviewed then the system automatically assigns five as the maximum score for the response.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
2. reviewer_details_popup - This action can be called from response_report by clicking reviewer names from instructor's end. This action is responsible to fetch reviewer details: full name, user id, email and handle.&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139524</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139524"/>
		<updated>2021-10-20T21:12:24Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project is to add unit testing for the PopupController to raise statement coverage above 60%. See the Test Outline section for specifics of our work.&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. The previous team implemented some of the test cases to improve the coverage. The previous work test coverage was 96%. However, their test cases followed integration testing methodologies which were not consistent with Unit testing.&lt;br /&gt;
We will be implementing Unit testing while retaining the current coverage.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yi Qiu (mentor)&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni Sah, ragesah&lt;br /&gt;
&lt;br /&gt;
*Priya Jakhar, priyajakhar&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the unit tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1. Write RSpec unit test cases to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2. Cover as many boundary cases and the core functionality for all popup controller actions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 6 methods in the popup controller. We created unit test cases with the help of mocked objects (factory objects and stub objects).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's unit testing, we need to test functional logic. &lt;br /&gt;
&lt;br /&gt;
1. *action_allowed?&lt;br /&gt;
Functionality : &lt;br /&gt;
&lt;br /&gt;
Test case :&lt;br /&gt;
&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The total coverage of the test is 63.29%, meeting our minimum coverage requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139112</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139112"/>
		<updated>2021-10-18T21:27:50Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. &lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni &lt;br /&gt;
&lt;br /&gt;
*Priya&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the integration tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1.Write RSpec integration tests to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2.Cover as many edge cases as you can.&lt;br /&gt;
&lt;br /&gt;
3.Achieve as high branch coverage as you can. Teaching staff will use the mutant-rspec gem to measure test thoroughness and fault-finding capability of tests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza/tree/beta here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=139097</id>
		<title>CSC/ECE 517 Fall 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=139097"/>
		<updated>2021-10-18T16:10:38Z</updated>

		<summary type="html">&lt;p&gt;Snparab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - {$num}. {$desc.title}]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2128. Refactor student_quizzes_controller.rb &amp;amp; late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2132. Add tests cases for review mapping helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2134. Write unit tests for admin_controller.rb and institution_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2138. Auto-generate submission directory names based on assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2142. Improve e-mail notifications]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2133. Write tests for popup_controller.rb]]&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139096</id>
		<title>CSC/ECE 517 Fall 2021 - E2133. Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2133._Write_tests_for_popup_controller.rb&amp;diff=139096"/>
		<updated>2021-10-18T16:10:04Z</updated>

		<summary type="html">&lt;p&gt;Snparab: Created page with &amp;quot;== Project Introduction == The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. &lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
*Sayali Parab, snparab1704&lt;br /&gt;
&lt;br /&gt;
*Rageeni &lt;br /&gt;
&lt;br /&gt;
*Priya&lt;br /&gt;
&lt;br /&gt;
=== Files Involved === &lt;br /&gt;
&lt;br /&gt;
popup_controller.rb&lt;br /&gt;
&lt;br /&gt;
popup_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=== Running Tests ===&lt;br /&gt;
What we need to do is to set up the environment and complete the 'popup_controller_spec.rb' to finish the integration tests for popup controller. This rspec test file can be run by calling the following code: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  rspec spec/controllers/popup_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
1.Write RSpec integration tests to make the statement coverage above 90%.&lt;br /&gt;
&lt;br /&gt;
2.Cover as many edge cases as you can.&lt;br /&gt;
&lt;br /&gt;
3.Achieve as high branch coverage as you can. Teaching staff will use the mutant-rspec gem to measure test thoroughness and fault-finding capability of tests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Popup Controller Methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]. The methods are:&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
The main repository can be found [https://github.com/expertiza/expertiza here]&lt;br /&gt;
&lt;br /&gt;
The forked git repository for this project can be found [https://github.com/priyajakhar/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;/div&gt;</summary>
		<author><name>Snparab</name></author>
	</entry>
</feed>