<?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=Agarg9</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=Agarg9"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Agarg9"/>
	<updated>2026-08-10T01:44:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100534</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100534"/>
		<updated>2015-12-16T09:51:37Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps to Implement the Automated Deployment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100531</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100531"/>
		<updated>2015-12-16T09:38:02Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps to Implement the Automated Deployment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install packages for Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
4. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
5. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
6. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100530</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100530"/>
		<updated>2015-12-16T09:18:54Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps to Implement the Automated Deployment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install packages for Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
4. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
5. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
6. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
7. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Drop.png&amp;diff=100526</id>
		<title>File:Drop.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Drop.png&amp;diff=100526"/>
		<updated>2015-12-16T08:36:33Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99997</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99997"/>
		<updated>2015-11-17T02:20:58Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Classes involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questionnaires_controller.rb&lt;br /&gt;
*questionnaires_quiz_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality has been moved to different controller to make this controller slim.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There was a valid_quiz in this controller which is moved to questionnaires_quiz_controller now, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99996</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99996"/>
		<updated>2015-11-17T02:19:30Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Future Consideration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality has been moved to different controller to make this controller slim.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There was a valid_quiz in this controller which is moved to questionnaires_quiz_controller now, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99995</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99995"/>
		<updated>2015-11-17T02:17:14Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality has been moved to different controller to make this controller slim.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99994</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99994"/>
		<updated>2015-11-17T02:16:05Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Future Consideration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99993</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99993"/>
		<updated>2015-11-17T02:12:35Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality needs to be moved to different controllers to make them slim.&lt;br /&gt;
*The Quiz methods are to be treated as any different kind of questionnaire, and the functionality be implemented in the model class of quiz_questionnaire.&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99992</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99992"/>
		<updated>2015-11-17T02:11:48Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Changes made */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 10 || new_quiz || Moved this method to Questionnaires_quiz_controller || Questionnaire method should not contain quiz related methods, thus moved it out to a new controller&lt;br /&gt;
|-&lt;br /&gt;
| 11 || update_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 12 || edit_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 13 || create_quiz_questionnaire || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
|-&lt;br /&gt;
| 14 || valid_quiz || Moved this method to Questionnaires_quiz_controller and updated routes.rb and views accordingly || Quiz related methods was needed to move out of this Questionnaire controller&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality needs to be moved to different controllers to make them slim.&lt;br /&gt;
*The Quiz methods are to be treated as any different kind of questionnaire, and the functionality be implemented in the model class of quiz_questionnaire.&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99985</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99985"/>
		<updated>2015-11-16T20:19:30Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality needs to be moved to different controllers to make them slim.&lt;br /&gt;
*The Quiz methods are to be treated as any different kind of questionnaire, and the functionality be implemented in the model class of quiz_questionnaire.&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been written for this functionality under spec/models with testcase name questionnaire_spec.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc07globalrules.JPG&amp;diff=99984</id>
		<title>File:Qc07globalrules.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc07globalrules.JPG&amp;diff=99984"/>
		<updated>2015-11-16T20:13:30Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc06valid.JPG&amp;diff=99983</id>
		<title>File:Qc06valid.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc06valid.JPG&amp;diff=99983"/>
		<updated>2015-11-16T20:13:15Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc05choose.JPG&amp;diff=99982</id>
		<title>File:Qc05choose.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc05choose.JPG&amp;diff=99982"/>
		<updated>2015-11-16T20:12:55Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc04savechoice.JPG&amp;diff=99981</id>
		<title>File:Qc04savechoice.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc04savechoice.JPG&amp;diff=99981"/>
		<updated>2015-11-16T20:12:44Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc03node.JPG&amp;diff=99980</id>
		<title>File:Qc03node.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc03node.JPG&amp;diff=99980"/>
		<updated>2015-11-16T20:12:29Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc02copy.JPG&amp;diff=99979</id>
		<title>File:Qc02copy.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc02copy.JPG&amp;diff=99979"/>
		<updated>2015-11-16T20:12:08Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc01assign.JPG&amp;diff=99978</id>
		<title>File:Qc01assign.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Qc01assign.JPG&amp;diff=99978"/>
		<updated>2015-11-16T20:11:33Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99972</id>
		<title>CSC/ECE 517 Fall 2015/oss E1563 ASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_E1563_ASA&amp;diff=99972"/>
		<updated>2015-11-16T18:11:25Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: Created page with &amp;quot;=Introduction= Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Questionnaire Controller is responsible for creating, editing and reviewing quizes. The Questionnaire controller is also used for peer-review, teammate-review and creating and managing quizes. The basic functionality of adding, removing, editing questions and or options is handled by this controller. This wikipedia page explains the Open Source Project of refactoring the questionnaire controller on expertiza.&amp;lt;bR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;B&amp;gt;&amp;lt;U&amp;gt;The need of refactoring&amp;lt;/u&amp;gt;&amp;lt;/B&amp;gt;&lt;br /&gt;
# Maintainability. It is easier to fix bugs because the source code is easy to read and the intent of its author is easy to grasp.&amp;lt;ref name=martin&amp;gt;{{cite book | last = Martin | first = Robert |title = Clean Code | publisher = Prentice Hall | year = 2009}}&amp;lt;/ref&amp;gt; This might be achieved by reducing large monolithic routines into a set of individually concise, well-named, single-purpose methods. It might be achieved by moving a method to a more appropriate class, or by removing misleading comments.&lt;br /&gt;
# Extensibility. It is easier to extend the capabilities of the application if it uses recognizable [[design patterns]], and it provides some flexibility where none before may have existed.&amp;lt;ref name=kerievsky/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Overview=&lt;br /&gt;
The scope of our project is to refactor the questionnaires controller. The questionnaires controller at this moment is very big and hence, difficult to understand. The aim of the project was to distribute the functionality in different controllers, so that the questionnaires controller will be slim and easy to understand.&lt;br /&gt;
&lt;br /&gt;
==Classes involved==&lt;br /&gt;
*questionnaire.rb &lt;br /&gt;
*quiz_questionnaire.rb&lt;br /&gt;
*questions_controller.rb&lt;br /&gt;
&lt;br /&gt;
==Changes made==&lt;br /&gt;
&lt;br /&gt;
*copy, update_quiz, valid_quiz methods were long and have been broken up.  clone_questionnaire_details was also broken up and renamed.&lt;br /&gt;
*Changed code to follow the global rules.&lt;br /&gt;
*A lot of code duplication has been removed.&lt;br /&gt;
*Test cases are written using rspec for the functions in questionnaire_controller.rb.&lt;br /&gt;
*Copy method was broken(error page was shown), fixed it partially.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! S.No. !! Place changes implemented!! Change Made !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Complete controller || Replaced 'and' with '&amp;amp;&amp;amp;' and 'or' with 'II' in all places || Refactored as per global rule 1 to keep Boolean precedence&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Complete controller || Replaced if (var == true) with if var || Refactored as per global rule 4 as default check for 'if' is for true&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Complete controller || Replaced :key =&amp;gt; ‘value’ with key: ‘value’ for 88 instance in controller|| Refactored  as per global rules&lt;br /&gt;
|-&lt;br /&gt;
| 4 || assign_instructor_id || Removed duplicate code for assigning instructor id from copy and clone_questionnaire_details methods  || Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || check_create_new_node|| Removed duplicate code for checking creation of new node from copy_questionnaire,save and clone_questionnaire_details methods|| Removed duplication suggested by code climate.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || update_quiz|| Refactored this method and extracted choose_question_type out of this method || Refactoring was needed for this huge method&lt;br /&gt;
|-&lt;br /&gt;
| 7 || valid_quiz || Refactored this method and extracted valid_quiz_option out of this method to check validity of options|| Refactoring was needed as method was performing 2 actions&lt;br /&gt;
|-&lt;br /&gt;
| 8 || save_choices || Refactored this method and created 3 new methods namely save_truefalse_choice,save_single_choice and save_multiple_choice|| Refactoring was needed for this huge method&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Project Resources==&lt;br /&gt;
[https://github.com/agarg9/expertiza GitHub Project Repository]&lt;br /&gt;
&lt;br /&gt;
[http://152.1.13.70:3000/ VCL IP Address]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code Snippets=&lt;br /&gt;
1. This code was duplicated in Copy and clone_questionnaire_details method. So new method with name  assign_instructor_id is created and that duplication is removed.&lt;br /&gt;
[[Image:Qc01assign.JPG]]&lt;br /&gt;
&lt;br /&gt;
2. Copy method was very big,so created new method copy_questionnaire method out of it, which helps while debugging.&lt;br /&gt;
[[Image:Qc02copy.JPG]]&lt;br /&gt;
&lt;br /&gt;
3. This code was also duplicated in save,copy and clone_questionnaire_details method. New method with name check_create_new_node is created to remove this duplication.&lt;br /&gt;
[[Image:Qc03node.JPG]]&lt;br /&gt;
&lt;br /&gt;
4. Save_choices method was very big too,thus created new methods namely,save_truefalse_choice,save_single_choice and save_multiple_choice for different choice types.&lt;br /&gt;
[[Image:Qc04savechoice.JPG]]&lt;br /&gt;
&lt;br /&gt;
5. Update quiz method was also huge, so created save_question_type out of it and called it in quiz_method.&lt;br /&gt;
[[Image:Qc05choose.JPG]]&lt;br /&gt;
&lt;br /&gt;
6. Valid quiz method was checking quiz validity and options validity too. So extracted valid_quiz_options to check validity of quiz options.&lt;br /&gt;
[[Image:Qc06valid.JPG]]&lt;br /&gt;
&lt;br /&gt;
7. Refactored whole controller as per global rules.&lt;br /&gt;
&lt;br /&gt;
[[Image:Qc07globalrules.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Future Consideration==&lt;br /&gt;
*Controller was very big than what the name describes. Appropriate functionality needs to be moved to different controllers to make them slim.&lt;br /&gt;
*The Quiz methods are to be treated as any different kind of questionnaire, and the functionality be implemented in the model class of quiz_questionnaire.&lt;br /&gt;
*Turn the questionnaire into a “form object.”  The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.&lt;br /&gt;
*There is a valid_quiz in this controller, but it only check if the quiz is valid when new quiz is created, but not when the existing quiz is updated. The reason is that, the format for params is not the same. Please fix this issue and make the valid _quiz work both for quiz creation and quiz_update.&lt;br /&gt;
*Write tests for quiz creation, for both scenario which the input quiz questions are valid and not valid.&lt;br /&gt;
*Test (and fix if they are broken) the export and import functionality. Write test for importing and exporting questionnaires (Issue 577).&lt;br /&gt;
&lt;br /&gt;
=Object Oriented Design Principles Followed=&lt;br /&gt;
&lt;br /&gt;
The following object oriented design principles were followed during refactoring: &amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Single Responsibility Principle&amp;lt;/b&amp;gt;: The single responsibility principle states that every context (class, function, variable, etc.) should have a single responsibility. It was maintained that each method should be involved with a single responsibility and the code that was not related to that particular functionality was moved to other method. This was also taken care of in terms of classes.&lt;br /&gt;
*&amp;lt;b&amp;gt;DRY Principle&amp;lt;/b&amp;gt;: Don't Repeat Yourself! The repetitive and redundant code was removed from the associated classes and methods.&lt;br /&gt;
&lt;br /&gt;
=Running Project &amp;amp; Testing Functionality=&lt;br /&gt;
*Test Cases have been implemented for the functionality in quiz_controller.rb&lt;br /&gt;
*This testing has been done using RSpec, a behavior-driven development framework.&lt;br /&gt;
'''&lt;br /&gt;
Test from UI'''&lt;br /&gt;
*Navigate to  [http://152.1.13.70:3000/]  login with username: instructor6 and password: password.&lt;br /&gt;
*Go to Manage&amp;gt;Questionnaire.&lt;br /&gt;
*Click on Questionnaire link and create a new public item in review section.&lt;br /&gt;
*Expand Review portion and click on edit action for questionnaire create above.&lt;br /&gt;
*Here you can add different questions and its weight.&lt;br /&gt;
*Go back to questionnaire list and try copy,edit,delete Questionnaire.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
*Refactoring was performed as per the requirements in the files questionnaire_controller.rb&lt;br /&gt;
*Code duplication has been removed efficiently by extracting them into separate methods.&lt;br /&gt;
*Test cases were written to some of the functionality in questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Code_refactoring Code Refactoring Wiki]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1qQD7fcypFk77nq7Jx7ZNyCNpLyt1oXKaq5G-W7zkV3k/edit Global Rules for Refactoring]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.agiledeveloper.com/presentations/how_to_approach_refactoring_2up.pdf Why Refactor]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://en.wikipedia.org/wiki/Single_responsibility_principle Single Responsibility Principle]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=99971</id>
		<title>CSC/ECE 517 Fall 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=99971"/>
		<updated>2015-11-16T18:09:53Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/sample_page]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1558BGJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss/M1502/AAAASS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss/M1503/IntegrateXMLParser]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1568BZHXJS]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1572VGA]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/oss_E1573_sap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1559 rrz]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1570 avr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1556 CHM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1504 JJD]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1562 APS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1501 GSN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1501 GSN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1550 KMM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1551 RGS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1555 GMR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1552 NFR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1565 AAJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1561 WZL]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1553 AAJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1554 AAR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1569 JNR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1560 PSV]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1505 MSV]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1557 GXM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1566 ARB]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1567 APT]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1574 BKS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/ossA1550RAN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1571]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1563 ASA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1577 MayYellowRoverJump]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1586 AnonymousChatBetweenAuthorAndReviewer]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1580 Text metrics]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1582 Create integration tests for the instructor interface using capybara and rspec]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1576 Refactoring submitted content (hyperlinks and files)]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1590 Integration testing for Team creation]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1585 Use Ajax for Add Participants, Add TA ,Edit Questionnaires Screens]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1581 Integration testing for student interface]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1583 Fix the CSS used for Menu Item]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1591 Integration testing for peer review]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1502 Improve HTTP monitoring devtool support]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1503 Integrate xml5ever XML parser]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1505 Add conformance tests to unicode-bidi and fix conformance bugs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1501 Report CSS errors to the devtools, both stored and live]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1579 Instructor account creation over the web]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 A1550 Web Socket Implementation in Apache Ambari]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1584 Send Feedback to Support]]&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99006</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99006"/>
		<updated>2015-11-09T02:17:20Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Automating production setup and deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png]]&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
&lt;br /&gt;
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&lt;br /&gt;
&lt;br /&gt;
===unicorn===&lt;br /&gt;
==Steps to Implement the Automated Deployment Process==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla Ubuntu Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99005</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99005"/>
		<updated>2015-11-09T02:15:53Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps to Implement the Automated Deployment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
&lt;br /&gt;
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&lt;br /&gt;
&lt;br /&gt;
===unicorn===&lt;br /&gt;
==Steps to Implement the Automated Deployment Process==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla Ubuntu Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99004</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99004"/>
		<updated>2015-11-09T02:15:02Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
&lt;br /&gt;
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&lt;br /&gt;
&lt;br /&gt;
===unicorn===&lt;br /&gt;
==Steps to Implement the Automated Deployment Process==&lt;br /&gt;
[[File:Img01ExpInfra.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla Ubuntu Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99003</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99003"/>
		<updated>2015-11-09T02:13:42Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
&lt;br /&gt;
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&lt;br /&gt;
&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;br /&gt;
[[File:Img01ExpInfra.png]]&lt;br /&gt;
&lt;br /&gt;
Steps to Implement the Automated Deployment Process&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla Ubuntu Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99001</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99001"/>
		<updated>2015-11-09T01:58:54Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* nginx */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
&lt;br /&gt;
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&lt;br /&gt;
&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;br /&gt;
[[File:Img01ExpInfra.png]]&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99000</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=99000"/>
		<updated>2015-11-09T01:53:46Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;br /&gt;
[[File:Img01ExpInfra.png]]&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Img01ExpInfra.png&amp;diff=98998</id>
		<title>File:Img01ExpInfra.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Img01ExpInfra.png&amp;diff=98998"/>
		<updated>2015-11-09T01:52:52Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98990</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98990"/>
		<updated>2015-11-09T00:03:32Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Chef Solo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*Node:&lt;br /&gt;
A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*Recipe:  &lt;br /&gt;
A recipe specifies the resources to use and the order in which they are to be applied.&lt;br /&gt;
It is mostly a collection of resources, defined using patterns (resource names, attribute-value pairs, and actions). A recipe must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*Cookbook: &lt;br /&gt;
A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a   scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*WorkStation:&lt;br /&gt;
A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery.&lt;br /&gt;
The workstation is the location from which most users do most of their work.&lt;br /&gt;
One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*Chef Server:&lt;br /&gt;
The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*Chef-client:&lt;br /&gt;
The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98989</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98989"/>
		<updated>2015-11-08T23:59:52Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Terminology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo===&lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
===nginx===&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98988</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=98988"/>
		<updated>2015-11-08T23:56:36Z</updated>

		<summary type="html">&lt;p&gt;Agarg9: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Automating production setup and deployment===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually.  &lt;br /&gt;
The task is to write a Chef-solo recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby code.&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup, database setup. Many open sourced recipes for many individual components are available &lt;br /&gt;
*It should also include recipe for regular deployment. &lt;br /&gt;
This will provide one step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===nginx===&lt;br /&gt;
===unicorn===&lt;br /&gt;
===Steps===&lt;/div&gt;</summary>
		<author><name>Agarg9</name></author>
	</entry>
</feed>