<?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=Rdmarshb</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=Rdmarshb"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rdmarshb"/>
	<updated>2026-06-02T18:58:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123743</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123743"/>
		<updated>2019-04-11T01:51:16Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Proposed Import Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. However, these functions might be deprecated, as it appears that Question importing is now routed through the ImportFileController unsuccessfully. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper (Appears to be deprecated/unused)&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper''' (Appears to be deprecated/unused)&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
* Add ability for ImportFileController to import Question objects for Questionnaires. (Add question view to views/import_file, introduce Question logic into the controller.)&lt;br /&gt;
** Note: Why does QuizQuestionnaire have a different view?&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
*Username: instructor6&lt;br /&gt;
*Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123426</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123426"/>
		<updated>2019-04-07T17:01:55Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. However, these functions might be deprecated, as it appears that Question importing is now routed through the ImportFileController unsuccessfully. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper (Appears to be deprecated/unused)&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper''' (Appears to be deprecated/unused)&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
* Add ability for ImportFileController to import Question objects for Questionnaires. (Add question view to views/import_file, introduce Question logic into the controller.)&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
*Username: instructor6&lt;br /&gt;
*Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123424</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123424"/>
		<updated>2019-04-07T16:54:00Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Proposed Import Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. However, these functions might be deprecated, as it appears that Question importing is now routed through the ImportFileController unsuccessfully. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
* Add ability for ImportFileController to import Question objects for Questionnaires. (Add question view to views/import_file, introduce Question logic into the controller.)&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
*Username: instructor6&lt;br /&gt;
*Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123423</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123423"/>
		<updated>2019-04-07T16:52:52Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. However, these functions might be deprecated, as it appears that Question importing is now routed through the ImportFileController unsuccessfully. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
*Username: instructor6&lt;br /&gt;
*Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123411</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123411"/>
		<updated>2019-04-07T16:24:57Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
*Username: instructor6&lt;br /&gt;
*Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123410</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123410"/>
		<updated>2019-04-07T16:24:35Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
&lt;br /&gt;
Username: instructor6&lt;br /&gt;
&lt;br /&gt;
Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123409</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123409"/>
		<updated>2019-04-07T16:23:30Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;br /&gt;
&lt;br /&gt;
== Deployment ==&lt;br /&gt;
&lt;br /&gt;
The project is deployed on an NCSU VCL server. It can be accessed at http://152.46.16.252:8080/.&lt;br /&gt;
&lt;br /&gt;
A sample instructor login is:&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123408</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123408"/>
		<updated>2019-04-07T14:36:20Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;br /&gt;
&lt;br /&gt;
== Proposed Import Changes ==&lt;br /&gt;
&lt;br /&gt;
Most import functionality is routed through the ImportFileController and import class methods on models that are being imported. We intend to remove other helpers and files, such as the ImportFileHelper, the ImportTopicHelper, and the QuestionnaireHelper to keep import routing consistent. We will also remove the QuestionnaireController and route that import through the ImportFileController. In addition, we will update ImportFileController methods (in particular, #hash_rows_with_headers and #import_from_hash) to make better use of polymorphism and eliminate large and unnecessary if/else blocks.&lt;br /&gt;
&lt;br /&gt;
We will also insert more specific object creation specifications. Consider if a user's import contains objects that do not exist in the database. We will provide an option for the user to specify whether or not new/dependent objects should be created and account for this boolean in relevant ::import functions for the models.&lt;br /&gt;
&lt;br /&gt;
To summarize our changes:&lt;br /&gt;
&lt;br /&gt;
* Route all import traffic through ImportFileController and ::import calls on models.&lt;br /&gt;
* Refactor ImportFileController.&lt;br /&gt;
* Insert object creation conditions into all relevant ::import functions and into the ImportFileController form.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123407</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123407"/>
		<updated>2019-04-07T14:18:40Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
=== Helpers ===&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123406</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123406"/>
		<updated>2019-04-07T14:18:09Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
&lt;br /&gt;
All models have an ::import method called by the ImportFileController. In addition, SignUpTopic and User objects rely on their helpers, which are mentioned above.&lt;br /&gt;
&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123405</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123405"/>
		<updated>2019-04-07T14:16:06Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import Question objects from a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for User object from hash.&lt;br /&gt;
** ::create_new_user - Makes a user object in the database.&lt;br /&gt;
&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
** ::define_attributes - Sets and returns attributes for a SignUpTopic from hash.&lt;br /&gt;
** ::create_new_sign_up_topic - Makes SignUpTopic objects in the database.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
** ::get_questions_from_csv - Allows Question and QuestionAdvice import/creation with CSV file.&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123404</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123404"/>
		<updated>2019-04-07T14:12:43Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import/export Question objects from/to a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
** File processing methods:&lt;br /&gt;
*** #get_delimiter - Sets proper delimiter for filetype&lt;br /&gt;
*** #parse_line - Processes line (row) of the file&lt;br /&gt;
*** #parse_to_grid - Turns file into 2D array&lt;br /&gt;
*** #parse_to_hash - Turns file into hash where 'header' stores header row and 'body' stores all contents.&lt;br /&gt;
*** #hash_rows_with_headers - Creates hash for each row of file. Keys are headers, values are row values.&lt;br /&gt;
** Import methods:&lt;br /&gt;
*** #import_from_hash - Primary import functionality. Creates objects for hashed rows (from #hash_rows_with_headers).&lt;br /&gt;
*** #import - Larger controller of import, sets error messages and displays.&lt;br /&gt;
&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
** ::import - Allows import from CSV using QuestionnaireHelper&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123403</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123403"/>
		<updated>2019-04-07T14:05:45Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Existing Import Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
Existing import functionality is primarily routed through the import_file_controller and an import class method for various models. Two models, SignUpTopic and User, rely on helper classes that extract attributes from a hash and create an ActiveRecord object. Additionally, Questionnaire relies on a helper that can import/export Question objects from/to a CSV and adjust the size of the associated QuestionAdvice. More detail about specific functions is provided below.&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123402</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123402"/>
		<updated>2019-04-07T13:47:27Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&lt;br /&gt;
What it does:  The export/import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc from their learning management system. Being able to export/import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What should be done:  Expertiza provides multiple export and import features for eg. export students, teams etc. Essentially what it does is it fetches some data from database and save it as a file in desired format. However, same functionality is implemented multiple times for exporting and importing different things. The aim of this project is to design a generic export/import feature. What you need to do is implement a framework which supports exporting and importing functionality based on input. There are substantial degrees of freedom in this project. You need to design the module which will take the database table names, column names from which data needs to be exported or the imported into. So that this module can be used for every export/import feature that expertiza provides.&lt;br /&gt;
Most imports and exports just import or export a single table.  But sometimes exports involve “details.”  For example, when questionnaires are imported or exported, the “advice” (guidelines on what characteristics of work merit each score) may be imported or exported along with the questionnaire.  I suspect that all instances of import/export of multiple tables are called “details” in the current code.  Provide a mechanism so that “details” can be imported or exported along with the main table involved.&lt;br /&gt;
&lt;br /&gt;
== Existing Import Functionality ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Controllers&lt;br /&gt;
*'''import_file_controller'''&lt;br /&gt;
*'''questionnaires_controller'''&lt;br /&gt;
&lt;br /&gt;
Helpers&lt;br /&gt;
*'''import_file_helper'''&lt;br /&gt;
*'''import_topics_helper'''&lt;br /&gt;
*'''questionnaire_helper'''&lt;br /&gt;
&lt;br /&gt;
Models&lt;br /&gt;
*'''assignment_participant'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
*'''course_participant'''&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''team'''&lt;br /&gt;
*'''metareview_response_map'''&lt;br /&gt;
*'''question'''&lt;br /&gt;
*'''review_response_map'''&lt;br /&gt;
*'''sign_up_sheet'''&lt;br /&gt;
*'''sign_up_topic'''&lt;br /&gt;
*'''user'''&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123195</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123195"/>
		<updated>2019-04-05T14:32:31Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
*Veeha Khanna, vkhanna&lt;br /&gt;
*Randy Paluszkiewicz, rpalusz&lt;br /&gt;
*Drew Marshburn, rdmarshb&lt;br /&gt;
*Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Proposed Design ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123194</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123194"/>
		<updated>2019-04-05T14:30:56Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Veeha Khanna, vkhanna&lt;br /&gt;
&lt;br /&gt;
Rpalusz rpalusz&lt;br /&gt;
&lt;br /&gt;
Drew Marshburn, rdmarshb&lt;br /&gt;
&lt;br /&gt;
Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Proposed Design ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123193</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123193"/>
		<updated>2019-04-05T14:30:46Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Veeha Khanna, vkhanna&lt;br /&gt;
Rpalusz rpalusz&lt;br /&gt;
Drew Marshburn, rdmarshb&lt;br /&gt;
Andrew Miller, asmille5&lt;br /&gt;
&lt;br /&gt;
== Proposed Design ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123192</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123192"/>
		<updated>2019-04-05T14:27:43Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Design ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123191</id>
		<title>CSC517 Spring 2019/E1923 New Framework For Import/Export</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC517_Spring_2019/E1923_New_Framework_For_Import/Export&amp;diff=123191"/>
		<updated>2019-04-05T14:27:04Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: Created page with &amp;quot;  === Team ===   === Proposed Design ===&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Proposed Design ===&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122713</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122713"/>
		<updated>2019-03-31T14:53:00Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We made one change to the factory.rb file to build an instance of Team. We assume that the Team class may be used in other tests globally, so this should be added to the factory file and thus can be built more easily in future tests. Our addition to the factory.rb file is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
factory :team, class: Team do&lt;br /&gt;
  id 1&lt;br /&gt;
  parent_id 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following section shows the Rspec outline of the tests we created. The full test code can be found [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Check action permission with four different roles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response stats when the response map exists, otherwise only find the team and users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculate scores depending on the existence of the response. If a review questionnaire is present, calculate scores with a max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All tone analysis tests are run together. Both popup_* methods set instance variables before calling a build_* method. build_* methods are responsible for actually creating tone analysis tests and returning JSON information/graphics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        answer is provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
        answer is not provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        sentiment is empty&lt;br /&gt;
          build tone analysis heatmap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test showing details about the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get reviews done by self.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41%, meeting our 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://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested in each 'describe'. In addition, we used the Byebug gem to debug our test code.&lt;br /&gt;
The key to building successful tests is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122712</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122712"/>
		<updated>2019-03-31T14:47:31Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Outline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We made one change to the factory.rb file to build an instance of Team. We assume that the Team class may be used in other tests globally, so this should be added to the factory file and thus can be built more easily in future tests. Our addition to the factory.rb file is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
factory :team, class: Team do&lt;br /&gt;
  id 1&lt;br /&gt;
  parent_id 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following section shows the Rspec outline of the tests we created. The full test code can be found [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Check action permission with four different roles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response stats when the response map exists, otherwise only find the team and users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculate scores depending on the existence of the response. If a review questionnaire is present, calculate scores with a max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All tone analysis tests are run together. Both popup_* methods set instance variables before calling a build_* method. build_* methods are responsible for actually creating tone analysis tests and returning JSON information/graphics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        answer is provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
        answer is not provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        sentiment is empty&lt;br /&gt;
          build tone analysis heatmap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test showing details about the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get reviews done by self.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122711</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122711"/>
		<updated>2019-03-31T14:46:47Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Outline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We made one change to the factory.rb file to build an instance of Team. We assume that the Team class may be used in other tests globally, so this should be added to the factory file and thus can be built more easily in future tests. Our addition to the factory.rb file is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
factory :team, class: Team do&lt;br /&gt;
  id 1&lt;br /&gt;
  parent_id 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following section shows the Rspec outline of the tests we created. The full test code can be found [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Check action permission with four different roles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response stats when the response map exists, otherwise only find the team and users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculate scores depending on the existence of the response. If a review questionnaire is present, calculate scores with a max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All tone analysis tests are run together. Both popup_* methods set instance variables before calling a build_* method. build_* methods are responsible for actually creating tone analysis tests and returning JSON information/graphics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        answer is provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
        answer is not provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        sentiment is empty&lt;br /&gt;
          build tone analysis heatmap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test showing details about the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get reviews done by self.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122710</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122710"/>
		<updated>2019-03-31T14:46:34Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Outline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We made one change to the factory.rb file to build an instance of Team. We assume that the Team class may be used in other tests globally, so this should be added to the factory file and thus can be built more easily in future tests. Our addition to the factory.rb file is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
factory :team, class: Team do&lt;br /&gt;
  id 1&lt;br /&gt;
  parent_id 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following section shows the Rspec outline of the tests we created. The full test code can be found in [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Check action permission with four different roles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response stats when the response map exists, otherwise only find the team and users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculate scores depending on the existence of the response. If a review questionnaire is present, calculate scores with a max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All tone analysis tests are run together. Both popup_* methods set instance variables before calling a build_* method. build_* methods are responsible for actually creating tone analysis tests and returning JSON information/graphics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        answer is provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
        answer is not provided&lt;br /&gt;
          build tone analysis report&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        sentiment is empty&lt;br /&gt;
          build tone analysis heatmap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test showing details about the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get reviews done by self.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122706</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122706"/>
		<updated>2019-03-31T13:27:15Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We made one change to the factory.rb file to build an instance of Team. We assume that the Team class may be used in other tests globally, so this should be added to the factory file and thus can be built more easily in future tests. Our addition to the factory.rb file is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
factory :team, class: Team do&lt;br /&gt;
  id 1&lt;br /&gt;
  parent_id 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created. The whole test code can be found in [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Use four different roles to go into the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response when the response map exists.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Show different score when the reponse exists or not. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test all tone analysis related test together.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        when answer not exists&lt;br /&gt;
          return answer is none&lt;br /&gt;
        when answer exists&lt;br /&gt;
          return answer&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        test some constant value&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test the review details.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get sef review.&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122705</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122705"/>
		<updated>2019-03-31T13:22:50Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====Mock Models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models. This factory can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here]. As you can see from our setup below, most of the objects we created relied on the factory with the exception of the final_versions array, which is not used in enough tests to warrant its own factory statement. Other objects are just built with additional/overwritten attributes, such as the student object.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test Frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created. The whole test code can be found in [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Use four different roles to go into the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response when the response map exists.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Show different score when the reponse exists or not. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test all tone analysis related test together.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        when answer not exists&lt;br /&gt;
          return answer is none&lt;br /&gt;
        when answer exists&lt;br /&gt;
          return answer&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        test some constant value&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test the review details.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get sef review.&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122704</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122704"/>
		<updated>2019-03-31T13:19:37Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we wrote tests to cover all 10 methods in the popup controller. We mocked many different objects involved in the controller.&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;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====mock models====&lt;br /&gt;
Based on the controller, we mocked models to test different conditions. Models have complex and interdependent relationships, but the Expertiza project already includes a factory to build many of the models that can be seen [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here]. Additional database information can be accessed [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====test frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created. The whole test code can be found in [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Use four different roles to go into the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response when the response map exists.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Show different score when the reponse exists or not. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test all tone analysis related test together.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        when answer not exists&lt;br /&gt;
          return answer is none&lt;br /&gt;
        when answer exists&lt;br /&gt;
          return answer&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        test some constant value&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test the review details.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get sef review.&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122703</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122703"/>
		<updated>2019-03-31T13:15:51Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* What needs to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 96%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Zhewei Hu, zhu6 (mentor)&lt;br /&gt;
&lt;br /&gt;
*Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
*Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
*Drew Marshburn, rdmarshb&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;
== Test Plan ==&lt;br /&gt;
In total, we write tests to cover all 10 methods in popup controller. We mock several different roles involved in the controller.&lt;br /&gt;
&lt;br /&gt;
====popup controller methods====&lt;br /&gt;
&lt;br /&gt;
The code of the controller can be found in [https://github.com/YChen239/expertiza/blob/master/app/controllers/popup_controller.rb here]&lt;br /&gt;
&lt;br /&gt;
*action_allowed?&lt;br /&gt;
*author_feedback_popup&lt;br /&gt;
*team_users_popup&lt;br /&gt;
*participants_popup&lt;br /&gt;
*tone_analysis_chart_popup&lt;br /&gt;
*view_review_scores_popup&lt;br /&gt;
*build_tone_analysis_report&lt;br /&gt;
*build_tone_analysis_heatmap&lt;br /&gt;
*reviewer_details_popup&lt;br /&gt;
*self_review_popup&lt;br /&gt;
&lt;br /&gt;
====mock models====&lt;br /&gt;
Base on the controller, we mock several models to test different conditions. Each model has different relationship with each other and we can see the factory in [https://github.com/expertiza/expertiza/blob/master/spec/factories/factories.rb here] and DB [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:assignment_team) { build(:assignment_team, id: 1, name: &amp;quot;team1&amp;quot;, assignment: assignment) }&lt;br /&gt;
  let(:team) {build(:team)}&lt;br /&gt;
  let(:team_user) {build(:team_user)}&lt;br /&gt;
  let(:student) { build(:student, id: 1, name: &amp;quot;student&amp;quot;) }&lt;br /&gt;
  let(:student2) { build(:student, id: 2, name: &amp;quot;student2&amp;quot;) }&lt;br /&gt;
  let(:admin) { build(:admin) }&lt;br /&gt;
  let(:instructor) { build(:instructor) }&lt;br /&gt;
  let(:ta) { build(:teaching_assistant) }&lt;br /&gt;
  let(:participant) { build(:participant, id: 1, user_id: 1, user: student, assignment: assignment) }&lt;br /&gt;
  let(:participant2) { build(:participant, id: 2, user: student2, assignment: assignment) }&lt;br /&gt;
&lt;br /&gt;
  let(:response) { build(:response, id: 1) }&lt;br /&gt;
  let(:questionnaire) { build(:questionnaire, id: 1, max_question_score: 15)}&lt;br /&gt;
  let(:question) { build(:question, id: 1, questionnaire_id: questionnaire.id)}&lt;br /&gt;
  let(:answer) { build(:answer, id: 1, question_id: question.id, response_id: response.id, answer: 10) }&lt;br /&gt;
&lt;br /&gt;
  let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
  let(:response_map) { build(:review_response_map, id: 1, reviewee_id: assignment_team.id, reviewer_id: participant2.id, response: [response], assignment: assignment) }&lt;br /&gt;
  let(:final_versions) {{&lt;br /&gt;
      review_round_one: {questionnaire_id: 1, response_ids: [1]},&lt;br /&gt;
      review_round_two: {questionnaire_id: 2, response_ids: [2]},&lt;br /&gt;
      review_round_three: {questionnaire_id: 3, response_ids: [3], }&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
  test_url = &amp;quot;http://peerlogic.csc.ncsu.edu/reviewsentiment/viz/478-5hf542&amp;quot;&lt;br /&gt;
  mocked_comments_one = OpenStruct.new(comments: &amp;quot;test comment&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====test frame====&lt;br /&gt;
Since it's integration test, we need to test basic logic and return value in both methods in the controller and related methods in the controller. However, some of the methods have been tested in other rspec, all we need to do is to test the methods that haven't been tested. For 'action_allowed?', 'author_feedback_popup', 'team_users_popup', 'participants_popup', 'reviewer_details_popup', 'self_review_popup' methods, we test it separately. With 'tone_analysis_chart_popup', 'view_review_scores_popup', 'build_tone_analysis_report', 'build_tone_analysis_heatmap', we test them together since they both need to get each assignment'answer. Also 'tone_analysis_chart_popup' and 'view_review_scores_popup' all get 'build_tone_analysis_report' and 'build_tone_analysis_heatmap' in their method.&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created. The whole test code can be found in [https://github.com/YChen239/expertiza/blob/master/spec/controllers/popup_controller_spec.rb here]&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
Use four different roles to go into the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ger feedback when feedback exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get response when the response map exists.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Show different score when the reponse exists or not. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test all tone analysis related test together.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        when answer not exists&lt;br /&gt;
          return answer is none&lt;br /&gt;
        when answer exists&lt;br /&gt;
          return answer&lt;br /&gt;
      #build_tone_analysis_heatmap&lt;br /&gt;
        test some constant value&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Test the review details.&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get sef review.&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&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 96.41% which meets the requirment.&lt;br /&gt;
&lt;br /&gt;
=== Related Links===&lt;br /&gt;
&lt;br /&gt;
A video of all tests running can be seen [https://www.youtube.com/watch?v=G-e0onrIy3M&amp;amp;feature=youtu.be here]. &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/YChen239/expertiza here]&lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
The testing framework in the assignment_team_spec.rb used integration tests to test the methods in the controller. The mock instances are created at the beginning and the method logic is tested the each 'require'. For 'context', it gives the conditions for each test and for 'it'. For it, it excutes the code. For 'get', it goes through the whole method. Besides, we use gem 'byebug' to debug our test code.&lt;br /&gt;
In building the test framework, the key is to understand the logic in the method and understand the input and output value for the method.&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122367</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1921. 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_Spring_2019_-_Project_E1921._Write_tests_for_popup_controller.rb&amp;diff=122367"/>
		<updated>2019-03-26T00:55:24Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Project Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to 70%.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
Drew Marshburn, rdmarshb&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;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created.&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
 &lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
  &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=122193</id>
		<title>E1921 Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=122193"/>
		<updated>2019-03-25T20:32:13Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to '''INSERT%'''.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yuhan Chen, ychen239&lt;br /&gt;
&lt;br /&gt;
Hao Lu, hlu6&lt;br /&gt;
&lt;br /&gt;
Drew Marshburn, rdmarshb&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;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created.&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
 &lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
  &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=122192</id>
		<title>E1921 Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=122192"/>
		<updated>2019-03-25T20:32:01Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: /* Team */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to '''INSERT%'''.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
Yuhan Chen, ychen239&lt;br /&gt;
Hao Lu, hlu6&lt;br /&gt;
Drew Marshburn, rdmarshb&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;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created.&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
 &lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
  &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=121958</id>
		<title>E1921 Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=121958"/>
		<updated>2019-03-24T22:47:14Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: Added introduction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. 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. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to '''INSERT%'''.&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
=== File and Running Tests ===&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created.&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
 &lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
  &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=121956</id>
		<title>E1921 Write tests for popup controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1921_Write_tests_for_popup_controller.rb&amp;diff=121956"/>
		<updated>2019-03-24T22:34:45Z</updated>

		<summary type="html">&lt;p&gt;Rdmarshb: Added outline and test outline&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Project Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Team ===&lt;br /&gt;
&lt;br /&gt;
=== File and Running Tests ===&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Test Outline ==&lt;br /&gt;
&lt;br /&gt;
The following sections show the Rspec outline of the tests we created.&lt;br /&gt;
&lt;br /&gt;
'''PopupController'''&lt;br /&gt;
&lt;br /&gt;
     #action_allowed?&lt;br /&gt;
       when the role current user is student&lt;br /&gt;
         does not allow certain action&lt;br /&gt;
       when the role current user is ta&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role name of current user is super admin or admin&lt;br /&gt;
         allows certain action&lt;br /&gt;
       when the role current user is super instructor&lt;br /&gt;
         allows certain action&lt;br /&gt;
&lt;br /&gt;
    #author_feedback_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
 &lt;br /&gt;
    #team_users_popup&lt;br /&gt;
      when a response map exists&lt;br /&gt;
        calculates response stats for one response&lt;br /&gt;
      when a response map does not exist&lt;br /&gt;
        finds team and users&lt;br /&gt;
&lt;br /&gt;
    #participants_popup&lt;br /&gt;
      called with no response&lt;br /&gt;
        does not calculate scores&lt;br /&gt;
      called with a response&lt;br /&gt;
        assignment has a review questionnaire&lt;br /&gt;
          calculates the scores with a max&lt;br /&gt;
        assignment has no review questionnaire&lt;br /&gt;
          calculates the scores without a max&lt;br /&gt;
&lt;br /&gt;
    tone analysis tests&lt;br /&gt;
      #tone_analysis_chart_popup&lt;br /&gt;
        review tone analysis is calculated&lt;br /&gt;
          prepares tone analysis report for building&lt;br /&gt;
      #build_tone_analysis_report&lt;br /&gt;
        upon selecting summery, the tone analysis for review comments is calculated and applied to the page&lt;br /&gt;
          builds a tone analysis report and returns the heat map URLs&lt;br /&gt;
      #view_review_scores_popup&lt;br /&gt;
        prepares tone analysis report for building&lt;br /&gt;
  &lt;br /&gt;
    #reviewer_details_popup&lt;br /&gt;
      it will show the reviewer details&lt;br /&gt;
        it will show the reviewer details&lt;br /&gt;
  &lt;br /&gt;
    #self_review_popup&lt;br /&gt;
      when response_id exists&lt;br /&gt;
        get the result&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;/div&gt;</summary>
		<author><name>Rdmarshb</name></author>
	</entry>
</feed>